- Open CASCADE Technology source repository
- -----------------------------------------
+Open CASCADE Technology
+=======================
This directory contains sources of Open CASCADE Technology (OCCT), a collection
of C++ libraries providing services for 3D surface and solid modeling, CAD data
software dealing with 3D modeling (CAD), manufacturing / measuring (CAM) or
numerical simulation (CAE).
-The OCCT code is subject to the Open CASCADE Technology Public License Version
-6.5 (the "License"). You may not use the content of the relevant files except in
-compliance with the License. Please see the LICENSE file or obtain a copy of the
-License at http://www.opencascade.org and read it completely before using this
-software.
+License
+-------
-In order to build OCCT libraries from these sources for use in your program,
-you need to:
+The OCCT code is subject to the Open CASCADE Technology Public License
+(the "License"). You may not use the content of the relevant files except
+in compliance with the License. Please see the LICENSE file or obtain a copy
+of the License at http://www.opencascade.org and read it completely before
+using this software.
-1. Download, build, and install the required third-party libraries.
+Packaging
+---------
- Follow the instructions provided in the documents titled "Building 3rd party
- products for OCCT" on http://dev.opencascade.org/?q=home/resources for
- installation and building.
+You can receive certified version of OCCT code in different packages.
-2. Install and configure WOK development environment.
+- Snapshot of Git repository: contains only bare sources of OCCT; many C++
+ files, HTML documentation, and project files / makefiles for building OCCT
+ need to be generated.
- See http://dev.opencascade.org/?q=home/resources for the latest build of the
- WOK and instructions of configuring it.
+- Complete source archive: contains all sources of OCCT, including C++ files
+ generated by WOK, HTML and PDF documentation, and projects / makefiles for
+ building on all officially supported platforms.
-3. Use WOK to generate build scripts or project files for your compiler,
- then build the libraries.
+- Binary package (platform-specific): in addition to complete source archive,
+ includes binaries of OCCT and third-party libraries built on one platform.
+ This package allows using OCCT immediately after installation.
-Note that you may use also the pre-processed source packages that include
-makefiles and projects, or binary packages, available for official releases of
-OCCT at http://www.opencascade.org. In this case however you will not be able
-to re-generate derived files after changing the CDL files (requires WOK).
+Certified versions of OCCT can be downloaded from http://www.opencascade.org
+
+You can also find OCCT pre-installed on your system, or install it from
+packages provided by a third party. Note that packaging and functionality
+of such versions can be different from certified releases. Please consult
+documentation accompanyog your version for details.
+
+Documentation
+-------------
+
+Open file doc/html/index.html to browse HTML documentation.
+
+If HTML documentation is not available in your package, you can:
+
+- Generate it from sources.
+ You need to have Tcl and Doxygen 1.8.4 (or above) in PATH.
+ In Tcl prompt, cd to OCCT root folder and run "source dox/start.tcl".
+ On Windows you can also run shortcut batch file *gendoc.bat*.
+
+- Read documentation in source plain text (MarkDown) format found in
+ subfolder *dox*
+
+See *dox/dev_guides/documentation/documentation.md* for details.
+
+Building
+--------
+
+In most cases you need to rebuild OCCT on your platform (OS, compiler) before
+using it in your project, to ensure binary compatibility.
+
+Consult the file *dox/dev_guides/building/building.md* for instructions on
+building OCCT from sources on supported platforms.
+
+Version
+-------
The current version of OCCT can be consulted in the file
-src/Standard/Standard_Version.hxx
+*src/Standard/Standard_Version.hxx*
-For more information regarding OCCT code development please consult the official
-OCCT Collaborative Development Portal:
+Development
+-----------
- http://dev.opencascade.org
+For information regarding OCCT code development please consult the official
+OCCT Collaborative Development Portal:
+http://dev.opencascade.org
p BOPDS
p BOPCol
p BOPInt
-r OpenCL
+# This file contains list of documentation files of OCCT which are processed
+# by Doxygen to generate HTML documentation.
+# Files are listed one file per line, with paths relative to dox folder.
+# Empty spaces are allowed, part of string starting with # is ignored.
+# The order of files in this list determines order of top-level pages
+# in the generated documentation.
+
overview/overview.md
-overview/tutorial/tutorial.md
+tutorial/tutorial.md
technical_overview/technical_overview.md
user_guides/user_guides.md
user_guides/ocaf/ocaf.md
user_guides/tobj/tobj.md
user_guides/shape_healing/shape_healing.md
-user_guides/draw_test_harness/draw_test_harness.md
+user_guides/draw_test_harness.md
dev_guides/dev_guides.md
dev_guides/cdl/cdl.md
dev_guides/wok/wok.md
dev_guides/building/building.md
+dev_guides/building/3rdparty/3rdparty_windows.md
+dev_guides/building/3rdparty/3rdparty_linux.md
+dev_guides/building/3rdparty/3rdparty_osx.md
dev_guides/building/wok/wok.md
dev_guides/building/automake.md
-dev_guides/building/cmake.md
+dev_guides/building/cmake/cmake.md
dev_guides/building/code_blocks.md
dev_guides/building/msvc.md
dev_guides/building/xcode.md
-overview/license.md
\ No newline at end of file
+license.md
--- /dev/null
+License {#occt_pubic_license}
+=======
+
+## Open CASCADE Technology Public License
+
+*License version: 6.6* @htmlonly<br />@endhtmlonly
+*March, 2013*
+
+Open CASCADE S.A.S. releases and makes publicly available the source code of the software Open CASCADE Technology to the free software development community under the terms and conditions of this license.
+
+It is not the purpose of this license to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this license 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.
+
+
+Please read this license carefully and completely before downloading this software. By downloading, using, modifying, distributing and sublicensing this software, you indicate your acceptance to be bound by the terms and conditions of this license. If you do not want to accept or cannot accept for any reasons the terms and conditions of this license, please do not download or use in any manner this software.
+
+### 1. Definitions
+
+Unless there is something in the subject matter or in the context inconsistent therewith, the capitalized terms used in this License shall have the following meaning.
+
+"Applicable Intellectual Property Rights" means (a) with respect to the Initial Developer, any rights under patents or patents applications or other intellectual property rights that are now or hereafter acquired, owned by or assigned to the Initial Developer and that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce, modify, distribute or sublicense the Original Code without infringement; and (b) with respect to You or any Contributor, any rights under patents or patents applications or other intellectual property rights that are now or hereafter acquired, owned by or assigned to You or to such Contributor and that cover subject matter contained in Your Modifications or in such Contributor's Modifications, taken alone or in combination with Original Code.
+
+"Contributor" means each individual or legal entity that creates or contributes to the creation of any Modification, including the Initial Developer.
+
+"Derivative Program": means a new program combining the Software or portions thereof with other source code not governed by the terms of this License.
+
+"Initial Developer": means Open CASCADE S.A.S., with main offices at 1, place des Frères Montgolfier, 78280 Guyancourt, France.
+
+"Modifications": mean any addition to, deletion from or change to the substance or the structure of the Software. When source code of the Software is released as a series of files, a Modification is: (a) any addition to, deletion from or change to the contents of a file containing the Software or (b) any new file or other representation of computer program statements that contains any part of the Software. By way of example, Modifications include any debug of, or improvement to, the Original Code or any of its components or portions as well as its next versions or releases thereof.
+
+"Original Code": means (a) the source code of the software Open CASCADE Technology originally made available by the Initial Developer under this License, including the source code of any updates or upgrades of the Original Code and (b) the object code compiled from such source code and originally made available by Initial Developer under this License.
+
+"Software": means the Original Code, the Modifications, the combination of Original Code and any Modifications or any respective portions thereof.
+
+"You" or "Your": means an individual or a legal entity exercising rights under this License.
+
+
+### 2. Acceptance of license
+
+By using, reproducing, modifying, distributing or sublicensing the Software or any portion thereof, You expressly indicate Your acceptance of the terms and conditions of this License and undertake to act in accordance with all the provisions of this License applicable to You.
+
+
+### 3. Scope and purpose
+
+This License applies to the Software and You may not use, reproduce, modify, distribute, sublicense or circulate the Software, or any portion thereof, except as expressly provided under this License. Any attempt to otherwise use, reproduce, modify, distribute or sublicense the Software is void and will automatically terminate Your rights under this License.
+
+
+### 4. Contributor license
+
+Subject to the terms and conditions of this License, the Initial Developer and each of the Contributors hereby grant You a world-wide, royalty-free, irrevocable and non-exclusive license under the Applicable Intellectual Property Rights they own or control, to use, reproduce, modify, distribute and sublicense the Software provided that:
+
+You reproduce in all copies of the Software the copyright and other proprietary notices and disclaimers of the Initial Developer as they appear in the Original Code and attached hereto as Schedule "A" and any other notices or disclaimers attached to the Software and keep intact all notices in the Original Code that refer to this License and to the absence of any warranty;
+You include a copy of this License with every copy of the Software You distribute;
+If you distribute or sublicense the Software (as modified by You or on Your behalf as the case may be), You cause such Software to be licensed as a whole, at no charge, to all third parties, under the terms and conditions of the License, making in particular available to all third parties the source code of the Software;
+You document all Your Modifications, indicate the date of each such Modifications, designate the version of the Software You used, prominently include a file carrying such information with respect to the Modifications and duplicate the copyright and other proprietary notices and disclaimers attached hereto as Schedule "B" or any other notices or disclaimers attached to the Software with your Modifications.
+
+For greater certainty, it is expressly understood that You may freely create Derivative Programs (without any obligation to publish such Derivative Program) and distribute same as a single product. In such case, You must ensure that all the requirements of this License are fulfilled for the Software or any portion thereof.
+
+
+### 5. Your license
+
+You hereby grant all Contributors and anyone who becomes a party under this License a world-wide, non-exclusive, royalty-free and irrevocable license under the Applicable Intellectual Property Rights owned or controlled by You, to use, reproduce, modify, distribute and sublicense all Your Modifications under the terms and conditions of this License.
+
+
+### 6. Software subject to license
+
+Your Modifications shall be governed by the terms and conditions of this License. You are not authorized to impose any other terms or conditions than those prevailing under this License when You distribute and/or sublicense the Software, save and except as permitted under Section 7 hereof.
+
+
+### 7. Additional terms
+
+You may choose to offer, on a non-exclusive basis, and to charge a fee for any warranty, support, maintenance, liability obligations or other rights consistent with the scope of this License with respect to the Software (the "Additional Terms") to the recipients of the Software. However, You may do so only on Your own behalf and on Your sole and exclusive responsibility. You must obtain the recipient's agreement that any such Additional Terms are offered by You alone, and You hereby agree to indemnify, defend and hold the Initial Developer and any Contributor harmless for any liability incurred by or claims asserted against the Initial Developer or any Contributors with respect to any such Additional Terms.
+
+
+### 8. Disclaimer of warranty
+
+The Software is provided under this License on an "as is" basis, without warranty of any kind, including without limitation, warranties that the Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Software is with You.
+
+
+### 9. Liability
+
+Under no circumstances shall You, the Initial Developer or any Contributor be liable to any person for any direct or indirect damages of any kind including, without limitation, damages for loss of goodwill, loss of data, work stoppage, computer failure or malfunction or any and all other commercial damages or losses resulting from or relating to this License or indirectly to the use of the Software.
+
+
+### 10. Trademark
+
+This License does not grant any rights to use the trademarks, trade names and domain names "MATRA", "EADS Matra Datavision", "CAS.CADE", "Open CASCADE", "opencascade.com" and "opencascade.org" or any other trademarks, trade names or domain names used or owned by the Initial Developer.
+
+
+### 11. Copyright
+
+The Initial Developer retains all rights, title and interest in and to the Original Code. You may not remove the copyright (c) notice which appears when You download the Software.
+
+
+### 12. Term
+
+This License is granted to You for a term equal to the remaining period of protection covered by the intellectual property rights applicable to the Original Code.
+
+
+### 13. Termination
+
+In case of termination, as provided in Section 3 above, You agree to immediately stop any further use, reproduction, modification, distribution and sublicensing of the Software and to destroy all copies of the Software that are in Your possession or control. All sublicenses of the Software which have been properly granted prior to termination shall survive any termination of this License. In addition, Sections 5, 8 to 11, 13.2 and 15.2 of this License, in reason of their nature, shall survive the termination of this License for a period of fifteen (15) years.
+
+
+### 14. Versions of the license
+
+The Initial Developer may publish new versions of this License from time to time. Once Original Code has been published under a particular version of this License, You may choose to continue to use it under the terms and conditions of that version or use the Original Code under the terms of any subsequent version of this License published by the Initial Developer.
+
+
+### 15. Miscellaneous
+
+#### 15.1 Relationship of Parties
+
+This License will not be construed as creating an agency, partnership, joint venture or any other form of legal association between You and the Initial Developer, and You will not represent to the contrary, whether expressly, by implication or otherwise.
+
+#### 15.2 Independent Development
+
+Nothing in this License will impair the Initial Developer's right to acquire, license, develop, have others develop for it, market or distribute technology or products that perform the same or similar functions as, or otherwise compete with, Modifications, Derivative Programs, technology or products that You may develop, produce, market or distribute.
+
+#### 15.3 Severability
+
+If for any reason a court of competent jurisdiction finds any provision of this License, or portion thereof, to be unenforceable, that provision of the License will be enforced to the maximum extent permissible so as to effect the economic benefits and intent of the parties, and the remainder of this License will continue in full force and extent.
+
+
+@htmlonly<center>@endhtmlonly
+#### END OF THE TERMS AND CONDITIONS OF THIS LICENSE
+
+Open CASCADE S.A.S. is a French société par actions simplifiée having its main offices at 1, place in Frères Montgolfier, 78280 Guyancourt, France. Its web site is located at the following address http://www.opencascade.com
+
+
+#### Open CASCADE Technology Public License
+
+#### Schedule "A"
+
+The content of this file is subject to the Open CASCADE Technology Public License Version 6.5 (the "License").
+You may not use the content of this file except in compliance with the License.
+Please obtain a copy of the License at http://www.opencascade.org and read it completely before using this file. The Initial Developer of the Original Code is Open CASCADE S.A.S., with main offices at 1, place des Frères Montgolfier, 78280 Guyancourt, France. The Original Code is copyright (c) Open CASCADE S.A.S., 2001. All rights reserved.
+
+"The Original Code and all software distributed under the License are distributed on an "AS IS" basis, without warranty of any kind, and the Initial Developer hereby disclaims all such warranties, including without limitation, any warranties of merchantability, fitness for a particular purpose or non-infringement.
+
+Please see the License for the specific terms and conditions governing rights and limitations under the License".
+
+#### End of Schedule "A"
+
+
+#### Open CASCADE Technology Public License
+
+#### Schedule "B"
+
+"The content of this file is subject to the Open CASCADE Technology Public License Version 6.5 (the "License"). You may not use the content of this file except in compliance with the License. Please obtain a copy of the License at http://www.opencascade.org and read it completely before using this file. The Initial Developer of the Original Code is Open CASCADE S.A.S., with main offices at 1, place des Frères Montgolfier, 78280 Guyancourt, France. The Original Code is copyright (c) Open CASCADE S.A.S., 2001. All rights reserved.
+
+Modifications to the Original Code have been made by ________________________. Modifications are copyright (c) [Year to be included]. All rights reserved.
+
+The software Open CASCADE Technology and all software distributed under the License are distributed on an "AS IS" basis, without warranty of any kind, and the Initial Developer hereby disclaims all such warranties, including without limitation, any warranties of merchantability, fitness for a particular purpose or non-infringement. Please see the License for the specific terms and conditions governing rights and limitations under the License".
+
+#### End of Schedule "B"
+
+@htmlonly</center>@endhtmlonly
\ No newline at end of file
--- /dev/null
+ Building 3rd-party libraries on Linux {#dev_guides__building_3rdparty_linux}
+============================================
+@tableofcontents
+
+@section dev_guides__building_3rdparty_linux_1 Introduction
+
+ This document presents additional guidelines for building third-party
+ products used by Open CASCADE Technology and samples on Linux platform.
+
+ The links for downloading the third-party products are available on the web site
+ of OPEN CASCADE SAS at
+ http://www.opencascade.org/getocc/require/.
+
+ There are two types of third-party products, which are necessary to build OCCT:
+
+ * Mandatory products: Tcl 8.5, Tk 8.5, FreeType 2.4.10
+ * Optional products: TBB 3.x or 4.x, gl2ps 1.3.5, FreeImage 3.14.1
+
+@section dev_guides__building_3rdparty_linux_2 Building Mandatory Third-party Products
+
+@subsection dev_guides__building_3rdparty_linux_2_1 Tcl/Tk 8.5
+
+ Tcl/Tk is required for DRAW test harness. Version 8.5 or 8.6 can be used with OCCT.
+
+@subsubsection dev_guides__building_3rdparty_linux_2_1_1 Installation from binaries
+
+ It is possible to download ready-to-install binaries from
+ http://www.activestate.com/activetcl/downloads
+
+ * 1. Download the binaries archive and unpack them to some TCL_SRC_DIR.
+ * 2. Enter the directory TCL_SRC_DIR.
+
+ @verbatim
+ cd TCL_SRC_DIR
+ @endverbatim
+
+ * 3. Run the install command
+
+ @verbatim
+ install.sh
+ @endverbatim
+
+ and follow instructions.
+
+@subsubsection dev_guides__building_3rdparty_linux_2_1_2 Installation from sources: Tcl 8.5
+
+ Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
+
+ * 1. Enter the unix sub-directory of the directory where the source files of Tcl are located (TCL_SRC_DIR).
+
+ @verbatim
+ cd TCL_SRC_DIR/unix
+ @endverbatim
+
+ * 2. Run the configure command
+
+ @verbatim
+ configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
+ @endverbatim
+
+ For a 64 bit platform also add --enable-64bit option to the command line.
+
+ * 3. If the configure command has finished successfully, start the building process
+
+ @verbatim
+ make
+ @endverbatim
+
+ * 4. If building is finished successfully, start the installation of Tcl.
+ All binary and service files of the product will be copied to the directory defined by TCL_INSTALL_DIR
+
+ @verbatim
+ make install
+ @endverbatim
+
+@subsubsection dev_guides__building_3rdparty_linux_2_1_3 Installation from sources: Tk 8.5
+
+ Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
+
+ * 1. Enter the unix sub-directory of the directory where the source files of Tk are located (TK_SRC_DIR).
+
+ @verbatim
+ cd TK_SRC_DIR/unix
+ @endverbatim
+
+ * 2. Run the configure command, where TCL_LIB_DIR is TCL_INSTALL_DIR/lib
+
+ @verbatim
+ configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
+ @endverbatim
+
+ where TCL_LIB_DIR is TCL_INSTALL_DIR/lib
+
+ For a 64 bit platform also add --enable-64bit option to the command line.
+
+ * 3. If the configure command has finished successfully, start the building process
+
+ @verbatim
+ make
+ @endverbatim
+
+ * 4. If building has finished successfully, start the installation of Tk.
+ All binary and service files of the product will be copied
+ to the directory defined by TK_INSTALL_DIR (usually TK_INSTALL_DIR is TCL_INSTALL_DIR)
+
+ @verbatim
+ make install
+ @endverbatim
+
+@subsection dev_guides__building_3rdparty_linux_2_2 FreeType 2.4.10
+
+ FreeType is required for display of text in 3D viewer.
+ Download the necessary archive from http://sourceforge.net/projects/freetype/files/ and unpack it.
+
+ * 1. Enter the directory where the source files of FreeType are located (FREETYPE_SRC_DIR).
+
+ @verbatim
+ cd FREETYPE_SRC_DIR
+ @endverbatim
+
+ * 2. Run the configure command
+
+ @verbatim
+ configure --prefix=FREETYPE_INSTALL_DIR
+ @endverbatim
+
+ For a 64 bit platform also add CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC' option to the command line.
+
+ * 3. If the configure command has finished successfully, start the building process
+
+ @verbatim
+ make
+ @endverbatim
+
+ * 4. If building has finished successfully, start the installation of FreeType.
+ All binary and service files of the product will be copied to the directory defined by FREETYPE_INSTALL_DIR
+
+ @verbatim
+ make install
+ @endverbatim
+
+@section dev_guides__building_3rdparty_linux_3 Building Optional Third-party Products
+
+@subsection dev_guides__building_3rdparty_linux_3_1 TBB 3.x or 4.x
+
+ This third-party product is installed with binaries from the archive that can be downloaded from http://threadingbuildingblocks.org.
+ Go to \"Downloads page\", find the release version you need (e.g. tbb30_018oss) and pick the archive for Linux platform.
+ To install, unpack the downloaded archive of TBB 3.0 product (*tbb30_018oss_lin.tgz*).
+
+@subsection dev_guides__building_3rdparty_linux_3_2 gl2ps 1.3.5
+
+ Download the necessary archive from http://geuz.org/gl2ps/ and unpack it.
+
+ * 1. Install or build cmake product from source file.
+ * 2. Start cmake in GUI mode with the directory where the source files of gl2ps are located:
+ @verbatim
+ ccmake GL2PS_SRC_DIR
+ @endverbatim
+ * 2.1. Press [c] to make the initial configuration
+ * 2.2. Define the necessary options CMAKE_INSTALL_PREFIX
+ * 2.3. Press [c] to make the final configuration
+ * 2.4. Press [g] to generate Makefile and exit
+
+ or just run the following command:
+
+ @verbatim
+ cmake –DCMAKE_INSTALL_PREFIX=GL2PS_INSTALL_DIR –DCMAKE_BUILD_TYPE=Release
+ @endverbatim
+
+ * 3. Start building of gl2ps
+
+ @verbatim
+ make
+ @endverbatim
+
+ * 4. Start the installation of gl2ps. Binaries will be installed according to the CMAKE_INSTALL_PREFIX option
+
+ @verbatim
+ make install
+ @endverbatim
+
+@subsection dev_guides__building_3rdparty_linux_3_3 FreeImage 3.14.1
+
+ Download the necessary archive from http://sourceforge.net/projects/freeimage/files/Source%20Distribution/
+ and unpack it. The directory with unpacked sources is further referred to as FREEIMAGE_SRC_DIR.
+
+ * 1. Modify FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h:
+ In line 60 insert the following:
+
+ @verbatim
+ #include string.h
+ @endverbatim
+
+ * 2. Enter the directory where the source files of FreeImage are located (FREEIMAGE_SRC_DIR).
+
+ @verbatim
+ cd FREEIMAGE_SRC_DIR
+ @endverbatim
+
+ * 3. Run the building process
+
+ @verbatim
+ make
+ @endverbatim
+
+ * 4. Run the installation process
+ * 4.1. If you have permissions to write to /usr/include and /usr/lib directories then run the following command:
+ @verbatim
+ make install
+ @endverbatim
+ * 4.2. If you don’t have permissions to write to /usr/include and
+ /usr/lib directories then you need to modify the file FREEIMAGE_SRC_DIR/Makefile.gnu:
+
+ Change lines 7-9 from:
+
+ @verbatim
+ DESTDIR ?= /
+ INCDIR ?= $(DESTDIR)/usr/include
+ INSTALLDIR ?= $(DESTDIR)/usr/lib
+ @endverbatim
+
+ to:
+
+ @verbatim
+ DESTDIR ?= $(DESTDIR)
+ INCDIR ?= $(DESTDIR)/include
+ INSTALLDIR ?= $(DESTDIR)/lib
+ @endverbatim
+
+ Change lines 65-67 from:
+
+ @verbatim
+ install -m 644 -o root -g root $(HEADER) $(INCDIR)
+ install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
+ install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
+ @endverbatim
+
+ to:
+
+ @verbatim
+ install -m 755 $(HEADER) $(INCDIR)
+ install -m 755 $(STATICLIB) $(INSTALLDIR)
+ install -m 755 $(SHAREDLIB) $(INSTALLDIR)
+ @endverbatim
+
+ Change line 70 from:
+
+ @verbatim
+ ldconfig
+ @endverbatim
+
+ to:
+
+ @verbatim
+ \#ldconfig
+ @endverbatim
+
+ Then run the installation process by the following command:
+
+ @verbatim
+ make DESTDIR=FREEIMAGE_INSTALL_DIR install
+ @endverbatim
+
+ * 5. Clean the temporary files
+
+ @verbatim
+ make clean
+ @endverbatim
+
+@section dev_guides__building_3rdparty_linux_4 Installation From Official Repositories
+
+@subsection dev_guides__building_3rdparty_linux_4_1 Debian-based distributives
+
+ All 3rd-party products required for building of OCCT could be installed
+ from official repositories. You may install them from console using apt-get utility:
+
+ @verbatim
+ sudo apt-get install \
+ tcllib tklib tcl-dev tk-dev \
+ libfreetype-dev \
+ libxt-dev libxmu-dev \
+ libgl1-mesa-dev \
+ libfreeimage-dev \
+ libtbb-dev \
+ libgl2ps-dev
+ @endverbatim
+
+ To launch WOK-prebuilt binaries you need install C shell and 32-bit libraries on x86_64 distributives:
+
+ @verbatim
+ sudo apt-get install \
+ csh \
+ libstdc++5:i386 libxt6:i386
+ @endverbatim
+
+ Any compliant C++ compiler is required for building anyway:
+
+ @verbatim
+ sudo apt-get install \
+ g++ \
+ @endverbatim
+
+@see http://www.opencascade.org for details
--- /dev/null
+ Building 3rd-party libraries on MacOS X {#dev_guides__building_3rdparty_osx}
+==============================================
+@tableofcontents
+
+@section dev_guides__building_3rdparty_osx_1 Introduction
+
+ This document presents additional guidelines for building third-party products
+ used by Open CASCADE Technology and samples on Mac OS X platform (10.6.4 and later).
+
+ The links for downloading the third-party products are available
+ on the web site of OPEN CASCADE SAS at
+ http://www.opencascade.org/getocc/require/</a>.
+
+ There are two types of third-party products, which are necessary to build OCCT:
+
+ * Mandatory products: Tcl 8.5, Tk 8.5, FreeType 2.4.10
+ * Optional products: TBB 3.x or 4.x, gl2ps 1.3.5, FreeImage 3.14.1 or 3.15.x
+
+@section dev_guides__building_3rdparty_osx_2 Building Mandatory Third-party Products
+
+@subsection dev_guides__building_3rdparty_osx_2_1 Tcl/Tk 8.5
+
+ Tcl/Tk is required for DRAW test harness. Version 8.5 or 8.6 can be used with OCCT.
+
+@subsubsection dev_guides__building_3rdparty_osx_2_1_1 Installation from binaries
+
+ It is possible to download ready-to-install binaries from
+ http://www.activestate.com/activetcl/downloads
+
+ * 1. Download the disk image to some TCL_DOWNLOAD_DIR.
+ * 2. Open in Finder the directory TCL_DOWNLOAD_DIR.
+ * 3. Open disk image and follow instructions.
+
+@subsubsection dev_guides__building_3rdparty_osx_2_1_2 Installation from sources: Tcl 8.5
+
+ Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
+
+ * 1. Enter the macosx sub-directory of the directory where the source files of Tcl are located (TCL_SRC_DIR).
+
+ @verbatim
+ cd TCL_SRC_DIR/macosx
+ @endverbatim
+
+ * 2. Run the configure command
+
+ @verbatim
+ configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
+ @endverbatim
+
+ For a 64 bit platform also add --enable-64bit option to the command line.
+
+ * 3. If the configure command has finished successfully, start the building process
+
+ @verbatim
+ make
+ @endverbatim
+
+ * 4. If building is finished successfully, start the installation of Tcl.
+ All binary and service files of the product will be copied to the directory defined by TCL_INSTALL_DIR
+
+ @verbatim
+ make install
+ @endverbatim
+
+@subsubsection dev_guides__building_3rdparty_osx_2_1_3 Installation from sources: Tk 8.5
+
+ Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
+
+ * 1. Enter the macosx sub-directory of the directory where the source files of Tk are located (TK_SRC_DIR).
+
+ @verbatim
+ cd TK_SRC_DIR/macosx
+ @endverbatim
+
+ * 2. Run the configure command, where TCL_LIB_DIR is TCL_INSTALL_DIR/lib
+
+ @verbatim
+ configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
+ @endverbatim
+
+ where TCL_LIB_DIR is TCL_INSTALL_DIR/lib. For a 64 bit platform also add --enable-64bit option to the command line.
+
+ * 3. If the configure command has finished successfully, start the building process
+
+ @verbatim
+ make
+ @endverbatim
+
+ * 4. If building has finished successfully, start the installation of Tk.
+ All binary and service files of the product will be copied to the directory
+ defined by TK_INSTALL_DIR (usually TK_INSTALL_DIR is TCL_INSTALL_DIR)
+
+ @verbatim
+ make install
+ @endverbatim
+
+@subsection dev_guides__building_3rdparty_osx_2_2 FreeType 2.4.10
+
+ FreeType is required for display of text in 3D viewer.
+
+ Download the necessary archive from http://sourceforge.net/projects/freetype/files/ and unpack it.
+
+ * 1. Enter the directory where the source files of FreeType are located (FREETYPE_SRC_DIR).
+
+ @verbatim
+ cd FREETYPE_SRC_DIR
+ @endverbatim
+
+ * 2. Run the configure command
+
+ @verbatim
+ configure --prefix=FREETYPE_INSTALL_DIR
+ @endverbatim
+
+ For a 64 bit platform also add CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC' option to the command line.
+
+ * 3. If the configure command has finished successfully, start the building process
+
+ @verbatim
+ make
+ @endverbatim
+
+ * 4. If building has finished successfully, start the installation of FreeType.
+ All binary and service files of the product will be copied to the directory defined by FREETYPE_INSTALL_DIR
+
+ @verbatim
+ make install
+ @endverbatim
+
+@section dev_guides__building_3rdparty_osx_3 Building Optional Third-party Products
+
+@subsection dev_guides__building_3rdparty_osx_3_1 TBB 3.x or 4.x
+
+ This third-party product is installed with binaries from the archive
+ that can be downloaded from http://threadingbuildingblocks.org/.
+ Go to \"Downloads / Commercial Aligned Release\", find the release version you need (e.g. tbb30_018oss)
+ and pick the archive for Mac OS X platform.
+ To install, unpack the downloaded archive of TBB 3.0 product (*tbb30_018oss_osx.tgz*).
+
+@subsection dev_guides__building_3rdparty_osx_3_2 gl2ps 1.3.5
+
+ Download the necessary archive from http://geuz.org/gl2ps/ and unpack it.
+
+ * 1. Install or build cmake product from source file.
+
+ * 2. Start cmake in GUI mode with the directory where the source files of fl2ps are located
+ @verbatim
+ ccmake GL2PS_SRC_DIR
+ @endverbatim
+ * 2.1. Press [c] to make the initial configuration
+ * 2.2. Define the necessary options CMAKE_INSTALL_PREFIX
+ * 2.3. Press [c] to make the final configuration
+ * 2.4. Press [g] to generate Makefile and exit
+
+ or just run the following command:
+
+ @verbatim
+ cmake –DCMAKE_INSTALL_PREFIX=GL2PS_INSTALL_DIR –DCMAKE_BUILD_TYPE=Release
+ @endverbatim
+
+ * 3. Start building of gl2ps
+
+ @verbatim
+ make
+ @endverbatim
+
+ * 4. Start the installation of gl2ps. Binaries will be installed according to the CMAKE_INSTALL_PREFIX option
+
+ @verbatim
+ make install
+ @endverbatim
+
+@subsection dev_guides__building_3rdparty_osx_3_3 FreeImage 3.14.1 or 3.15.x
+
+ Download the necessary archive from
+ http://sourceforge.net/projects/freeimage/files/Source%20Distribution/
+ and unpack it. The directory with unpacked sources is further referred to as FREEIMAGE_SRC_DIR.
+
+ Note that for building FreeImage on Mac OS X 10.7 you should replace Makefile.osx
+ in FREEIMAGE_SRC_DIR by corrected one which you can find in attachment to issue #22811 in OCCT Mantis bug tracker
+ (http://tracker.dev.opencascade.org/file_download.php?file_id=6937&type=bug) or elsewhere.
+
+ * 1.If you are building FreeImage 3.15.x you can skip this step.
+ Modify FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h:
+
+ In line 60 insert the following:
+
+ @verbatim
+ #include string.h
+ @endverbatim
+
+ Modify FREEIMAGE_SRC_DIR/Source/FreeImage/PluginTARGA.cpp:
+
+ In line 320 replace:
+ @verbatim
+ SwapShort(value);
+ @endverbatim
+
+ with:
+ @verbatim
+ SwapShort(&value);
+ @endverbatim
+
+ * 2.Enter the directory where the source files of FreeImage are located (FREEIMAGE_SRC_DIR).
+
+ @verbatim
+ cd FREEIMAGE_SRC_DIR
+ @endverbatim
+
+ * 3.Run the building process
+
+ @verbatim
+ make
+ @endverbatim
+
+ * 4.Run the installation process
+ * 4.1. If you have permissions to write to /usr/local/include and /usr/local/lib directories then run the following command:
+ @verbatim
+ make install
+ @endverbatim
+ * 4.2. If you don’t have permissions to write to /usr/include and /usr/lib directories
+ then you need to modify the file FREEIMAGE_SRC_DIR/Makefile.osx:
+
+ Change line 49 from:
+
+ @verbatim
+ PREFIX ?= /usr/local
+ @endverbatim
+
+ to:
+
+ @verbatim
+ PREFIX ?= $(PREFIX)
+ @endverbatim
+
+ Change lines 65-69 from:
+
+ @verbatim
+ install -d -m 755 -o root -g wheel $(INCDIR) $(INSTALLDIR)
+ install -m 644 -o root -g wheel $(HEADER) $(INCDIR)
+ install -m 644 -o root -g wheel $(SHAREDLIB) $(STATICLIB) $(INSTALLDIR)
+ ranlib -sf $(INSTALLDIR)/$(STATICLIB)
+ ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)
+ @endverbatim
+
+ to:
+
+ @verbatim
+ install -d $(INCDIR) $(INSTALLDIR)
+ install -m 755 $(HEADER) $(INCDIR)
+ install -m 755 $(STATICLIB) $(INSTALLDIR)
+ install -m 755 $(SHAREDLIB) $(INSTALLDIR)
+ ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
+ ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
+ @endverbatim
+
+ Then run the installation process by the following command:
+
+ @verbatim
+ make PREFIX=FREEIMAGE_INSTALL_DIR install
+ @endverbatim
+
+ * 5.Clean the temporary files
+
+ @verbatim
+ make clean
+ @endverbatim
+
+@see http://www.opencascade.org for details
--- /dev/null
+ Building 3rd-party libraries on Windows {#dev_guides__building_3rdparty_windows}
+==============================================
+@tableofcontents
+
+@section dev_guides__building_3rdparty_win_1 Introduction
+
+ This document presents guidelines for building third-party products
+ used by Open CASCADE Technology (OCCT) and samples on Windows platform.
+
+ In order to understand these guidelines, you need to be familiar with MS Visual Studio / Visual C++.
+
+ You need to use the same version of MS Visual Studio for building
+ all third-party products and OCCT itself, in order to receive a consistent set of run-time binaries.
+
+ The links for downloading the third-party products are available on the web site
+ of OPEN CASCADE SAS at http://www.opencascade.org/getocc/require/.
+ There are two types of third-party products which are used by OCCT:
+
+ * Mandatory products: Tcl 8.5, Tk 8.5 and FreeType 2.4.10
+ * Optional products: TBB 3.x or 4.x, gl2ps * 1.3.5, FreeImage 3.14.1
+
+ It is recommended to create a separate new folder on your workstation where
+ you will unpack the downloaded archives of the third-party products,
+ and where you will build these products (for example, *c:\\occ3rdparty*).
+
+ Further in this document, this folder is referred to as *3rdparty*.
+
+@section dev_guides__building_3rdparty_win_2 Building Mandatory Third-party Products
+
+@subsection dev_guides__building_3rdparty_win_2_1 Tcl/Tk 8.5
+
+ Tcl/Tk is required for DRAW test harness. Version 8.5 or * 8.6 can be used for OCCT.
+ We recommend installing a binary distribution that could be downloaded from
+ http://www.activestate.com/activetcl.
+
+ Go to \"Free Downloads\" and pick the version of the Install Wizard
+ that matches your target platform – 32 bit (x86) or 64 bit (x64).
+ The version of Visual Studio you use is irrelevant when choosing the Install Wizard.
+
+ Run the Install Wizard you downloaded, and install Tcl/Tk products
+ to 3rdparty\\tcltk-win32 folder (for 32-bit platform) or
+ to 3rdparty\\tcltk-win64 folder (for 64-bit platform).
+
+ Further in this document, this folder is referred to as *tcltk*.
+
+@subsection dev_guides__building_3rdparty_win_2_2 FreeType 2.4.10
+
+ FreeType is required for display of text in 3D viewer.
+ You can download its sources from http://sourceforge.net/projects/freetype/files/
+
+ The building process is the following:
+
+ * 1. Unpack the downloaded archive of FreeType 2.4.10 product into the *3rdparty* folder.
+
+ As a result, you should have a folder named *3rdparty\\freetype-2.4.10*. Further in this document, this folder is referred to as *freetype*.
+
+ * 2. Open the solution file *freetype\\builds\\win32\\vc20xx\\freetype.sln* in Visual Studio, where vc20xx stands for the version of Visual Studio you are using.
+ * 3. Select a configuration to build: either Debug or Release.
+ * 4. Build the *freetype* project.
+
+ As a result, you will get a freetype import library (.lib) in the *freetype\\obj\\win32\\vc20xx* folder.
+
+ * 5. If you are building for 64 bit platform, start the Configuration Manager (Build - Configuration Manager),
+ and add *x64* platform to the solution configuration by copying the settings from Win32 platform:
+
+@image html /dev_guides/building/3rdparty/images/3rdparty_image001.png
+@image latex /dev_guides/building/3rdparty/images/3rdparty_image001.png
+
+ Update the value of the Output File for x64 configuration:
+
+@image html /dev_guides/building/3rdparty/images/3rdparty_image003.png
+@image latex /dev_guides/building/3rdparty/images/3rdparty_image003.png
+
+ Build the *freetype* project.
+
+ As a result, you should obtain a 64 bit import library (.lib) file in the *freetype\\x64\\vc20xx* folder.
+ If you want to build freetype as an import library (.lib) and a dynamic library (.dll) you should follow items 6, 7 and 8 of this list.
+
+ * 6. Open Project-Properties-Configuration Properties-General and change option 'Configuration Type' to \"*Dynamic Library (.dll)*\".
+ * 7. Edit file *freetype\\include\\freetype\\config\\ftoption.h*:
+
+ in line 255, uncomment the definition of macro FT_EXPORT and change it as follows:
+
+ @verbatim
+ #define FT_EXPORT(x) __declspec(dllexport) x
+ @endverbatim
+
+ * 8. Build the *freetype* project.
+
+ As a result, you should obtain import library (.lib) and dynamic library (.dll)
+ files in *freetype \\objs\\release or \\objs\\debug folders.*
+ If you are building for a 64 bit platform, follow item 5 of this list.
+
+ In order to facilitate use of the FreeType libraries in OCCT with minimal adjustment of its build procedures,
+ it is recommended to copy the include files and libraries of FreeType to a separate folder, named according to the pattern:
+ *freetype-compiler-bitness-building mode*
+ where
+
+ * compiler is vc8 or vc9 or vc10 or vc11;
+ * bitness is 32 or 64;
+ * building mode is opt (for Release) or deb (for Debug)
+
+ The include subfolder should be copied as is, while libraries should be renamed to
+ *freetype.lib* and *freetype.dll* (suffixes removed) and placed to subdirectories
+ *lib *and *bin*, respectively. If Debug configuration is built,
+ the Debug libraries should be put in subdirectories *libd* and *bind*.
+
+@section dev_guides__building_3rdparty_win_3 Building Optional Third-party Products
+
+@subsection dev_guides__building_3rdparty_win_3_1 TBB 3.x or 4.x
+
+ This third-party product is installed with binaries
+ from the archive that can be downloaded from http://threadingbuildingblocks.org/.
+ Go to \"Downloads page\", find the release version you need (e.g. tbb30_018oss) and pick the archive for Windows platform.
+ Unpack the downloaded archive of TBB product into the *3rdparty* folder.
+ Further in this document, this folder is referred to as *tbb*.
+
+@subsection dev_guides__building_3rdparty_win_3_2 gl2ps * 1.3.5
+
+ This third-party product should be built as a dynamically loadable library (dll file).
+ You can download its sources from http://geuz.org/gl2ps/src/
+
+ The building process is the following:
+
+ * 1. Unpack the downloaded archive of gl2ps * 1.3.5 product (*gl2ps-* 1.3.5.tgz*) into the *3rdparty* folder.
+ As a result, you should have a folder named *3rdparty\\gl2ps-* 1.3.5-source*.
+ Rename it according to the rule: gl2ps-platform-compiler-building mode, where
+ platform is win32 or win64;
+ compiler is vc8 or vc9 or vc10;
+ building mode - opt (for release) or deb (for debug)
+ Further in this document, this folder is referred to as *gl2ps*.
+
+ * 2. Download (from http://www.cmake.org/cmake/resources/software.html)
+ and install the *CMake* build system.
+
+ * 3. Edit the file *gl2ps\\CMakeLists.txt*.
+ After line 113 in CMakeLists.txt:
+
+ @verbatim
+ set_target_properties(shared PROPERTIES COMPILE_FLAGS \"-DGL2PSDLL -DGL2PSDLL_EXPORTS\")
+ @endverbatim
+
+ add the following line:
+
+ @verbatim
+ add_definitions(-D_USE_MATH_DEFINES)
+ @endverbatim
+
+ Attention: If cygwin was installed on your computer make sure that there is no path
+ to the latter in the PATH variable in order to avoid possible conflicts during the configuration.
+
+ * 4. Launch CMake (cmake-gui.exe) using the Program menu.
+ In CMake:
+
+ * Define where the source code is.
+ This path must point to *gl2ps* folder.
+ * Define where to build the binaries.
+ This path must point to the folder where generated gl2ps project binaries will be placed
+ (for example, *gl2ps\\bin*).
+ Further in this document, this folder is referred to as *gl2ps_bin*.
+ * Press the \"Configure\" button.
+@image html /dev_guides/building/3rdparty/images/3rdparty_image004.png
+@image latex /dev_guides/building/3rdparty/images/3rdparty_image004.png
+ * Select the generator (the compiler and the target platform - 32 or 64 bit) in the pop-up window.
+@image html /dev_guides/building/3rdparty/images/3rdparty_image005.png
+@image latex /dev_guides/building/3rdparty/images/3rdparty_image005.png
+ * Then press the \"Finish\" button to return to the main CMake window.
+ Expand the ENABLE group and uncheck ENABLE_PNG and ENABLE_ZLIB check boxes.
+@image html /dev_guides/building/3rdparty/images/3rdparty_image006.png
+@image latex /dev_guides/building/3rdparty/images/3rdparty_image006.png
+ * Expand the CMAKE group and define CMAKE_INSTALL_PREFIX
+ (path where you want to install the build results, for example, *c:\\occ3rdparty\\gl2ps\-1.3.5*).
+@image html /dev_guides/building/3rdparty/images/3rdparty_image007.png
+@image latex /dev_guides/building/3rdparty/images/3rdparty_image007.png
+ * Press the \"Configure\" button again, and then the \"Generate\" button in order to generate
+ Visual Studio projects. After completion, close CMake application.
+
+ * 5. Open the solution file *gl2ps_bin\\gl2ps.sln* in Visual Studio.
+ * Select a configuration to build
+ * Choose \"*Release*\" if you are building Release binaries.
+ * Choose \"*Debug*\" if you are building Debug binaries.
+ * Select a platform to build.
+ * Choose \"*Win32*\" if you are building for a 32 bit platform.
+ * Choose \"*x64*\" if you are building for a 64 bit platform.
+ * Build the solution.
+ * Build the *INSTALL* project.
+
+ As a result, you should have the installed gl2ps product in the *CMAKE_INSTALL_PREFIX* path.
+
+@subsection dev_guides__building_3rdparty_win_3_3 FreeImage 3.14.1
+
+ This third-party product should be built as a dynamically loadable library (.dll file).
+ You can download its sources from
+ http://sourceforge.net/projects/freeimage/files/Source%20Distribution/
+
+ The building process is the following:
+
+ * 1. Unpack the downloaded archive of FreeImage 3.14.1 product (*FreeImage314* 1.zip*) into *3rdparty* folder.
+
+ As a result, you should have a folder named *3rdparty\\FreeImage*.
+ Rename it according to the rule: freeimage-platform-compiler-building mode, where
+ platform is win32 or win64;
+ compiler is vc8 or vc9 or vc10 or vc11;
+ building mode is opt (for release) or deb (for debug)
+ Further in this document, this folder is referred to as *freeimage*.
+
+ * 2. Open the solution file *freeimage\\FreeImage.*.sln* in Visual Studio that corresponds to the version of Visual Studio you use.
+
+ Since the version of Visual Studio you use is higher than VC++ 2008, apply conversion of the workspace.
+ Such conversion should be suggested automatically by Visual Studio.
+
+ * 3. Select a configuration to build.
+ Choose \" *Release* \" if you are building Release binaries.
+ Choose \" *Debug* \" if you are building Debug binaries.
+ *Note:*
+ If you want to build a debug version of FreeImage binaries then you must rename
+ the following files for projects FreeImage and FreeimagePlus:
+
+ Project-Properties-Configuration Properties-Linker-General-Output File
+
+ @verbatim
+ from FreeImage*d*.dll to FreeImage.dll
+ from FreeImagePlus*d*.dll to FreeImagePlus.dll
+ @endverbatim
+
+ Project-Properties-Configuration Properties-Linker-Debugging-Generate Program Database File
+
+ @verbatim
+ from FreeImage*d*.pdb to FreeImage.pdb
+ from FreeImagePlus*d*.pdb to FreeImagePlus.pdb
+ @endverbatim
+
+ Project-Properties-Configuration Properties-Linker-Advanced-Import Library
+
+ @verbatim
+ from FreeImage*d*.lib to FreeImage.lib
+ from FreeImagePlus*d*.lib to FreeImagePlus.lib
+ @endverbatim
+
+ Project-Properties-Configuration Properties-Build Events-Post-Build Event-Comand Line
+
+ @verbatim
+ from FreeImage*d*.dll to FreeImage.dll
+ from FreeImage*d*.lib to FreeImage.lib
+ from FreeImagePlus*d*.dll to FreeImagePlus.dll
+ from FreeImagePlus*d*.lib to FreeImagePlus.lib
+ @endverbatim
+
+ Additionally, for project FreeImagePlus rename:
+ Project-Properties-Configuration Properties-Linker-Input-Additional Dependencies
+
+ @verbatim
+ from FreeImage*d*.lib to FreeImage.lib
+ @endverbatim
+
+ * 4. Select a platform to build.
+
+ Choose \" *Win32* \" if you are building for a 32 bit platform.
+ Choose \" *x64* \" if you are building for a 64 bit platform.
+
+ * 5. Start the building process.
+
+ As a result, you should have the library files of FreeImage product in the *freeimage\\Dist*
+
+ @verbatim
+ folder (FreeImage.dll and FreeImage.lib files) and in the *freeimage\\Wrapper\\FreeImagePlus\\dist*
+ folder (FreeImagePlus.dll and FreeImagePlus.lib files).
+ @endverbatim
+
+@see http://www.opencascade.org for details
If you are building OCCT from bare sources (as in Git repository), or do some
changes affecting CDL files, you need to use WOK to re-generate header files
-and build scripts / projects. See file \ref wok "WOK" for instructions.
+and build scripts / projects. See \ref dev_guides__building__wok for instructions.
Before building OCCT, you need to install required third-party libraries; see
OCCT_Build3rdParty_Linux.pdf for instructions.
-Building OCCT Libraries {#dev_guides__building}
+Building OCCT from sources {#dev_guides__building}
=========
-The source package of the Open CASCADE Technology including the source files of samples
-and tools and the set of building procedures is available for self-dependent preparation
-binary files on UNIX and Windows platforms.
-
In order to build OCCT libraries from these sources for use in your program,
you need to:
-1. Install the required third-party libraries.
+1. Make sure you have all required third-party libraries installed (check
+ software requirements in \ref OCCT_OVW_SECTION_5 "Overview").
+
+ See the following documents for short guide to installation of
+ third-party libraries on different platforms:
+ - \subpage dev_guides__building_3rdparty_windows
+ - \subpage dev_guides__building_3rdparty_linux
+ - \subpage dev_guides__building_3rdparty_osx
- Follow the instructions provided in the documents titled "Building 3rd party
- products for OCCT" on http://dev.opencascade.org/?q=home/resources for
- choice of the needed libraries, their installation and building.
-2. If you use OCCT sources from Git repository or do come changes affecting
- CDL files or dependencies of OCCT toolkit, update header files generated
- from CDL, and regenerate build scripts for your environment using WOK.
- See \subpage dev_guides__building__wok "WOK" for details.
+2. If you use bare OCCT sources from Git repository or made some changes affecting
+ CDL files or dependencies of OCCT toolkits, you need to update header files generated
+ from \ref dev_guides__cdl "CDL", and regenerate build scripts for your environment using WOK.
+ See \subpage dev_guides__building__wok for details.
Skip to step 3 if you use complete source package (e.g. official OCCT
release) without changes in CDL.
- \subpage dev_guides__building__automake "Building on Linux with Autotools"
- \subpage dev_guides__building__cmake "Building with CMake (cross-platform)"
- \subpage dev_guides__building__code_blocks "Building on Mac OS X with Code::Blocks"
- - \subpage dev_guides__building__msvc "Building on Windows with MS Visual Studio 2005-2012"
+ - \subpage dev_guides__building__msvc "Building on Windows with MS Visual Studio"
- \subpage dev_guides__building__xcode "Building on Mac OS X with Xcode"
The current version of OCCT can be consulted in the file src/Standard/Standard_Version.hxx
\ No newline at end of file
+++ /dev/null
-Building with CMake {#dev_guides__building__cmake}
-===================
-
-This file describes steps to build OCCT libraries from complete source package
-with CMake. CMake is free software that can create GNU Makefiles, KDevelop,
-XCode, and Visual Studio project files. Version 2.6 or above of CMake is
-required.
-
-If you are building OCCT from bare sources (as in Git repository), or do some
-changes affecting CDL files, you need to use WOK to re-generate header files
-and build scripts / projects. See file \ref wok "WOK" for instructions.
-
-Before building OCCT, you need to install required third-party libraries; see
-instructions for your platform on Resources page at http://dev.opencascade.org
-
-1. Decide on location of build and install directories.
-
- The build directory is the one where intermediate files will be created
- (projects / makefiles, objects, binaries).
- The install directory is the one where binaries will be installed after
- build, along with header files and resources required for OCCT use in
- applications.
-
- OCCT CMake scripts assume use of separate build and one install directories
- for each configuration (Debug or Release).
-
- It is recommended to separate build and install directories from OCCT
- source directory, for example:
-
- /user/home/occt/ros - sources
- /user/home/tmp/occt-build-release - intermediate files (release)
- /user/home/occt-install-release - installed binaries (release)
-
-2. Run CMake indicating path to OCCT sources (ros subdirectory) and selected build directory.
- It is recommended to use GUI tools provided by CMake: cmake-gui on Windows
- and Mac, ccmake on Linux.
-
- Example:
-
- Linux> cd /user/home/occt-install-release
- Linux> ccmake /user/home/occt/ros
-
-3. Run Configure
-
- You will likely get CMake errors due to missing paths to 3rd-party
- libraries. This is normal; proceed with configuration as follows.
-
-4. Check parameters shown by CMake, set them in accordance with your
- environment, and repeat Configure until it runs without error:
-
- - 3RDPARTY_DIR: path to directory whethe 3rd-party libraries are installed
- (for the cases when they are not in default locations, or on Windows)
- - 3RDPARTY_USE_\<library\>: select to use optional libraries
- - Other options in 3RDPARTY group can be used to fine-tune paths to
- 3rd-party libraries
-
- - BUILD_TYPE: configuration to build (Debug or Release)
- - BUILD_BITNESS: bitness (32 or 64)
- - BUILD_TOOLKITS: optional string containing list of toolkits to be built
- in addition to those included in completely built modueles
- - BUILD_\<module\>: select to build corresponding OCCT module
-
- - INSTALL_DIR: directory to install OCCT
- - INSTALL_\<library\>: select to copy corresponding 3rd-party library to OCCT
- install dir
-
-5. Run Generate
-
- This will create makefiles or project files for your build system.
-
-6. Build OCCT:
-
- - on Windows with MSVC: open solution OCCT.sln and build it, when build project INSTALL_ALL explicitly to have binaries and headers installed
- - on Linux with make files: run 'make install'
-
-
-
\ No newline at end of file
--- /dev/null
+Building with CMake {#dev_guides__building__cmake}
+===================
+
+@tableofcontents
+
+This file describes steps to build OCCT libraries from complete source package
+with CMake. CMake is free software that can create GNU Makefiles, KDevelop,
+XCode, and Visual Studio project files. Version 2.6 or above of CMake is
+required.
+
+If you are building OCCT from bare sources (as in Git repository), or do some
+changes affecting CDL files, you need to use WOK to re-generate header files
+and build scripts / projects. See \ref dev_guides__building__wok for instructions.
+
+Before building OCCT, you need to install required third-party libraries; see
+instructions for your platform on Resources page at http://dev.opencascade.org
+and @ref dev_guides__building article for details.
+
+## Decide on location of build and install directories.
+
+The build directory is the one where intermediate files will be created (projects / makefiles, objects, binaries).
+The install directory is the one where binaries will be installed after build, along with header files and resources required for OCCT use in applications.
+
+OCCT CMake scripts assume use of separate build and one install directories for each configuration (Debug or Release).
+
+It is recommended to separate build and install directories from OCCT source directory, for example:
+
+ /user/home/occt/ - sources
+ /user/home/tmp/occt-build-release - intermediate files (release)
+ /user/home/occt-install-release - installed binaries (release)
+
+## CMake usage
+
+Run CMake indicating path to OCCT sources ($CASROOT; in previous example CASROOT equal to /user/home/occt in lin case, and d:/occt in win case) and selected build directory (in prev example build directory is /user/home/tmp/occt-build-release).
+
+It is recommended to use GUI tools provided by CMake: cmake-gui on Windows and Mac, ccmake on Linux.
+
+### Windows:
+
+@image html /dev_guides/building/cmake/images/cmake_image001.png
+@image latex /dev_guides/building/cmake/images/cmake_image001.png
+
+* Specify "main" CMakelists.txt meta-project location by clicking Browse Source (e.g., $CASROOT)
+* Specify location (build folder) for Cmake generated project files by clicking Browse Build (e.g., d:/occt/build/win32-vc9-debug) (each cmake configuration of the project uses a specific build directory and a specific directory for installed files. It is recommended to compose names of the binary and install directory from system, bitness, compiler and build type.)
+* Configure opens the window with a drop-down list of generators supported by CMake project. Select the required generator (e.g., Visual Studio 2008) and click Finish)
+
+@image html /dev_guides/building/cmake/images/cmake_image002.png
+@image latex /dev_guides/building/cmake/images/cmake_image002.png
+
+### Linux:
+
+In the console, change to the build directory and call ccmake with the path to the source directory of the project:
+
+ > cd ~/occt/build/debug
+ > ccmake ~/occt/adm/cmake
+
+@image html /dev_guides/building/cmake/images/cmake_image003.png
+@image latex /dev_guides/building/cmake/images/cmake_image003.png
+
+Press "c" to configure.
+
+### Mac OS:
+
+Use cmake-gui (Applications -> CMake 2.8-10.app) to generate project files for the chosen build environment (e.g., XCode).
+
+@image html /dev_guides/building/cmake/images/cmake_image004.png
+@image latex /dev_guides/building/cmake/images/cmake_image004.png
+
+## OCCT Configuration
+
+The error message which appears at the end of configuration process, informs you about the required variables
+which need to be defined. This error will appear until all required variables are defined correctly.
+Note: In cmake-gui there is "grouped" option, which groups variables with a common prefix.
+
+###The variables with BUILD_ prefix:
+
+* BUILD_TYPE - defines build configuration of the future project (Release by default)
+* BUILD_<MODULE> - allows including the toolkit set of the specified module to the future project or excluding it from the project.
+* BUILD_TOOLKITS - allows including additional specified toolkits (list of items separated by a space or a semicolon) to the common set of the future project.
+
+Check USE_\<PRODUCT\> variable (USE_FREEIMAGE, USE_GL2PS, USE_TBB and USE_OPENCL) if you want to use this 3rd-party product in the future project.
+
+### 3rd-party configuration
+
+If you have 3rd-party libraries in a non-default location
+(e.g., on Windows, binaries downloaded from "http://www.opencascade.org/getocc/download/3rdparty/"),
+specify 3RDPARTY_DIR variable that points to the folders of 3rdparty products (some or all).
+At the next configuration 3rd-party product paths stored in 3RDPARTY_\<PRODUCT\>_DIR variable
+will be searched for in 3RDPARTY_DIR directory. If the structure of 3RDPARTY_DIR directory
+is the same as adopted in the OCCT, the directory will contain product dir, lib and header files.
+Press "Configure" ("c" key for ccmake)
+Important: The names of searched libraries and header files are hardcoded.
+The result of the 3rdparty product search will be recorded in the corresponding variables:
+
+* 3RDPARTY_\<PRODUCT\>_DIR - path to the product directory (with directory name) (e.g., D:/3rdparty/Tcl-8.5.12.0-32)
+* 3RDPARTY_\<PRODUCT\>_LIBRARY - path to the .lib libraries (with the library name) (e.g., D:/3rdparty/Tcl-8.5.12.0-32/lib/tcl85.lib). In non-windows case, this variable is the same as 3RDPARTY_\<PRODUCT\>_DLL.
+* 3RDPARTY_\<PRODUCT\>_INCLUDE - path to the include directory that contains the required header file (with "include" name) (e.g., D:/3rdparty/Tcl-8.5.12.0-32/include including tcl.h)
+* 3RDPARTY_\<PRODUCT\>_DLL - path to the .dll/.so/.dylib library (with the library name) (e.g., D:/3rdparty/Tcl-8.5.12.0-32/bin/tcl85.dll)
+
+The search process is as follows:
+
+1 level:. 3RDPARTY_DIR
+ 2 level: 3RDPARTY_\<PRODUCT\>_DIR\
+ 3 level: 3RDPARTY_\<PRODUCT\>_LIBRARY
+ 3 level: 3RDPARTY_\<PRODUCT\>_INCLUDE
+ 3 level: 3RDPARTY_\<PRODUCT\>_DLL
+
+If a variable of any level is not defined (empty or \<variable name\>-NOTFOUND)
+and the upper level variable is defined, the content of the non-defined variable
+will be searched for at the next configuration step. If search process in level 3
+doesn't find the required files, it searches in default places also.
+
+*Note*: Freetype search process tries to find ft2build.h file in 3RDPARTY_FREETYPE INCLUDE dir
+and after that adds "3RDPARTY_FREETYPE_INCLUDE /freetype2" path to common includes if it exists.
+Important: If BUILD_TYPE or BITNESS variable is changed - at the next configuration
+3RDPARTY_ variables will be replaced by the search process result, except for the 3RDPARTY_DIR variable.
+
+*Note*: CMake will produce an error after the configuration step until all required variables are defined correctly.
+If the search result (include path, or library path, or dll path) does not meet your expectations -
+you can change 3RDPARTY_\<PRODUCT\>_DIR variable, clear (if they are not empty)
+3RDPARTY_\<PRODUCT\>_DLL, 3RDPARTY_\<PRODUCT\>_INCLUDE_DIR and 3RDPARTY_\<PRODUCT\>_LIBRARY variables
+(or clear one of them) and run the configuration process again.
+At this time the search will be performed in the new identified directory
+and the result will be recorded to empty variables (non-empty variables will not be replaced).
+
+For example, (Linux case) 3RDPARTY_FREETYPE_DIR variable
+
+/PRODUCTS/maintenance/Mandriva2010/freetype-2.3.7
+
+can be changed to
+
+/PRODUCTS/maintenance/Mandriva2010/freetype-2.4.10
+
+and the related variables: 3RDPARTY_FREETYPE_DLL, 3RDPARTY_FREETYPE_INCLUDE_DIR and 3RDPARTY_FREETYPE_LIBRARY will be cleared.
+
+@image html /dev_guides/building/cmake/images/cmake_image005.png
+@image latex /dev_guides/building/cmake/images/cmake_image005.png
+
+During configuration process the cleaned variables will be filled with new found values.
+
+### Install path configuration
+
+Define in INSTALL_DIR variable the path to the installed OCCT files (libraries, executables and headers).
+If INSTALL_\<PRODUCT\> variable is checked - 3rd-party products will be copied to the install directory.
+At the end of the configuration process "configuring done" message will be shown and the generation process can be started.
+
+## OCCT Generation
+
+This will create makefiles or project files for your build system.
+
+### Windows
+
+Click Generate button and wait until the generation process is finished.
+Then the project files will appear in the build folder (e.g., d:/occt/build/win32-vc9-release).
+
+### Linux
+
+When the configuration is complete, start the generation process by pressing "g".
+
+@image html /dev_guides/building/cmake/images/cmake_image006.png
+@image latex /dev_guides/building/cmake/images/cmake_image006.png
+
+### Mac OS X
+
+Click Generate button and wait until the generation process is finished.
+Then the project files will appear in the build folder (e.g., /Developer/occt/build/XCode).
+
+## OCCT Building
+
+The install folder contains bin, inc, lib and res folders and a script to run DRAWEXE (draw.bat or draw.sh).
+"bin" contains executables, DLL (Windows) style shared libraries and pdb-files in OCCT debug version,.
+"lib" contains the import parts of DLL libraries.
+"inc" contains header files.
+"res" contains all required source files for OCCT.
+
+### Windows (Visual studio)
+
+Go to the build folder, start the Visual Studio solution (OCCT.sln) and build it by clicking Build - Build Solution.
+When the building process finished, build the INSTALL project
+(by default the build solution process skips the building of the INSTALL project) to move the above files to INSTALL_DIR.
+For this in the solution explorer right click on the INSTALL project and select Project Only - Build Only INSTALL.
+
+### Linux (make)
+Change directory to binary dir and run make command
+
+ > make
+
+To copy all libraries, executables and chosen 3rd-party libraries run "make" command with "install" argument
+
+ > make install
+
+This command will move the above files to INSTALL_DIR.
+
+### Mac OS X (XCode)
+
+Go to the build folder, start the XCode solution (OCCT.xcodeproj)
+and build it by clicking Build -> Build.
+Please notice that XCode may have worst responsibility to user actions
+due to sources processing at first start.
+
+When the building process finished, build the INSTALL project
+(by default the build solution process skips the building of the INSTALL project)
+to move the above files to INSTALL_DIR.
+Notice that env.sh (configure PATH and DYLD_LIBRARY_PATH environment variables
+as well as Draw Harness extra variables) and draw.sh (to launch DRAWEXE) will be created in target directory.
+
+## OCCT project debugging for Visual Studio
+Run OCCT.bat from the build directory to start Visual Studio with required environment for debugging.
\ No newline at end of file
If you are building OCCT from bare sources (as in Git repository), or do some
changes affecting CDL files, you need to use WOK to re-generate header files
-and build scripts / projects. See file \ref wok "WOK" for instructions.
+and build scripts / projects. See \ref dev_guides__building__wok for instructions.
Before building OCCT, you need to install required third-party libraries; see
OCCT_Build3rdParty_OSX.pdf for details.
If you are building OCCT from bare sources (as in Git repository), or do some
changes affecting CDL files, you need to use WOK to re-generate header files
-and build scripts / projects. See file \ref wok "WOK" for instructions.
+and build scripts / projects. See \ref dev_guides__building__wok for instructions.
Before building OCCT, you need to install required third-party libraries; see
OCCT_Build3rdParty_Windows.pdf for instructions.
-WOK {#dev_guides__building__wok}
+Using WOK {#dev_guides__building__wok}
=========
-WOK is a legacy build environment for Open CASCADE Technology. It is required
-for generation of header files for classes defined with @ref ug_cdl "CDL"
-("Cascade Definition Language"). Also tools for generation of project files
-for other build systems, and OCCT documentation, are integrated to WOK.
+@tableofcontents
+
+\ref dev_guides__wok "WOK" is a legacy build environment for Open CASCADE Technology.
+It is required for generation of header files for classes defined with
+@ref dev_guides__cdl "CDL" ("Cascade Definition Language").
+Also tools for generation of project files for other build systems, and OCCT
+documentation, are integrated to WOK.
WOK thus is needed in the following situations:
- Building from OCCT sources from Git repository (do not contain generated files)
- Building after some changes made in CDL files
-Before installing and using WOK, make sure that you have installed a compiler (it is assumed that it is Visual Studio on Windows or gcc on Linux and MacOS) and third-party components required for building OCCT.
+Before installing and using WOK, make sure that you have installed a compiler
+(it is assumed that it is Visual Studio on Windows or gcc on Linux and MacOS)
+and third-party components required for building OCCT.
@section wok1 Installing WOK
Run the installer. You will be prompted to read and accept the OCCT Public License to proceed:
- @image html /dev_guides/building/wok/images/wok_image001.jpg
- @image latex /dev_guides/building/wok/images/wok_image001.jpg
+ @image html /dev_guides/building/wok/images/wok_image001.png
+ @image latex /dev_guides/building/wok/images/wok_image001.png
Click Next and proceed with the installation.
At the end of the installation you will be prompted to specify the version and the location of Visual Studio to be used, and the location of third-party libraries:
- @image html /dev_guides/building/wok/images/wok_image002.jpg
- @image latex /dev_guides/building/wok/images/wok_image002.jpg
+ @image html /dev_guides/building/wok/images/wok_image002.png
+ @image latex /dev_guides/building/wok/images/wok_image002.png
You can change these settings at any time later. For this click on the item "Customize environment (GUI tool)" in the WOK group in the Windows Start menu.
@subsection wok12 Linux
- * Unpack the .tgz archive containing WOK distributive into an installation directory <WOK_INSTALL_DIR>.
+ * Unpack the .tgz archive containing WOK distributive into an installation directory \<WOK_INSTALL_DIR\>.
- * Perform the following commands assuming that you have unpacked WOK distributive archive into <WOK_INSTALL_DIR>:
+ * Perform the following commands assuming that you have unpacked WOK distributive archive into \<WOK_INSTALL_DIR\>:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
- cd <WOK_INSTALL_DIR>/site
+ cd \<WOK_INSTALL_DIR\>/site
wok_confgui.sh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Define all necessary paths to third-party products in the dialog window:
- @image html /dev_guides/building/wok/images/wok_image003.jpg
- @image latex /dev_guides/building/wok/images/wok_image003.jpg
+ @image html /dev_guides/building/wok/images/wok_image003.png
+ @image latex /dev_guides/building/wok/images/wok_image003.png
* Run the following commands to create WOK LOC factory:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
- cd <WOK_INSTALL_DIR>/site
+ cd \<WOK_INSTALL_DIR\>/site
wok_init.sh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Your installation procedure is over. To run WOK use one the following commands:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
- cd <WOK_INSTALL_DIR>/site
+ cd \<WOK_INSTALL_DIR\>/site
wok_emacs.sh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
or
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
- cd <WOK_INSTALL_DIR>/site
+ cd \<WOK_INSTALL_DIR\>/site
wok_tclsh.sh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@subsection wok13 Mac OS X
- * In the Finder double click on wokSetup.dmg file. This will open a new window. Drag and drop "wokSetup" folder from this window at the location in the Finder where you want to install WOK, i.e. <WOK_INSTALL_DIR>.
+ * In the Finder double click on wokSetup.dmg file. This will open a new window. Drag and drop "wokSetup" folder from this window at the location in the Finder where you want to install WOK, i.e. \<WOK_INSTALL_DIR\>.
- * Browse in the Finder to the folder <WOK_INSTALL_DIR>/site and double click on WokConfig. This will open a window with additional search path settings. Define all necessary paths to third-party products in the dialog window:
+ * Browse in the Finder to the folder \<WOK_INSTALL_DIR\>/site and double click on WokConfig. This will open a window with additional search path settings. Define all necessary paths to third-party products in the dialog window:
- @image html /dev_guides/building/wok/images/wok_image004.jpg
- @image latex /dev_guides/building/wok/images/wok_image004.jpg
+ @image html /dev_guides/building/wok/images/wok_image004.png
+ @image latex /dev_guides/building/wok/images/wok_image004.png
* Run the following commands to create WOK LOC factory:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
- cd <WOK_INSTALL_DIR>/site
+ cd \<WOK_INSTALL_DIR\>/site
wok_init.sh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- * Your installation procedure is over. To run WOK in Emacs navigate in the Finder to the folder <WOK_INSTALL_DIR>/site and double click on WokEmacs.
+ * Your installation procedure is over. To run WOK in Emacs navigate in the Finder to the folder \<WOK_INSTALL_DIR\>/site and double click on WokEmacs.
@section wok2 Initialization of Workbench
Note: $CASROOT is equal to D:/occt now
- Then you can work with this workbench using normal WOK functionality (wprocess, umake, etc.; see WOK User\92s Guide for details) or use it only for generation of derived sources and project files, and build OCCT with Visual Studio on Windows or make command on Linux, as described below.
+ Then you can work with this workbench using normal WOK functionality (wprocess, umake, etc.; see WOK User's Guide for details) or use it only for generation of derived sources and project files, and build OCCT with Visual Studio on Windows or make command on Linux, as described below.
@section wok3 Generation of building projects
* for vc9 - $CASROOT/adm/msvc/vc9
* for vc10 - $CASROOT/adm/msvc/vc10
* for vc11 - $CASROOT/adm/msvc/vc11
- * for cbp - $CASROOT/adm/<OS> /cbp
+ * for cbp - $CASROOT/adm/\<OS\>/cbp
* for cmake - $CASROOT/adm/cmake
* for amk - $CASROOT/adm/lin/amk
- * xcd - $CASROOT/adm/<OS>/xcd
+ * xcd - $CASROOT/adm/\<OS\>/xcd
@section wok4 Generation of documentation
If you are building OCCT from bare sources (as in Git repository), or do some
changes affecting CDL files, you need to use WOK to re-generate header files
-and build scripts / projects. See file \ref wok "WOK" for instructions.
+and build scripts / projects. See \ref dev_guides__building__wok for instructions.
Before building OCCT, you need to install required third-party libraries; see
OCCT_Build3rdParty_OSX.pdf for details.
Component Definition Language (CDL) {#dev_guides__cdl}
==============================
+@tableofcontents
+
+@section occt_cdl_0 DEPRECATION WARNING
+
+Please note that CDL is considered as obsolete and is to be removed in one of future releases of OCCT.
+
@section occt_1819379591_354121062 CDL and Application Architecture
CDL is the component definition language of the Open CASCADE Technology (**OCCT**) programming platform. Some components, which CDL allows you to create, are specific to OCCT application architecture. These and other components, which you can define using CDL include the following:
* Schema
* Executable
* Client.
-A** class** is the fundamental software component in object-oriented development. Because of a very large number of resources used in large-scale applications, the **class **itself is too small to be used as a basic management unit.
+A **class** is the fundamental software component in object-oriented development. Because of a very large number of resources used in large-scale applications, the **class** itself is too small to be used as a basic management unit.
So, while the class is the basic data component defined in CDL, this language also provides a way to group classes, **enumerations**, and **exceptions **together – the **package**. A package groups together a number of classes, which have semantic links. For example, a geometry package would contain Point, Line, and Circle classes. A package can also contain enumerations, exceptions, and package methods. In practice, a class name is prefixed with the name of its package e.g. Geom_Circle.
To save data in a file, you need to define persistent classes. Then, you group these classes in a schema, which provides the necessary read/write tools.
- @image html /dev_guides/cdl/images/cdl_image003.jpg
- @image latex /dev_guides/cdl/images/cdl_image003.jpg
+ @image html /dev_guides/cdl/images/cdl_image003.png
+ @image latex /dev_guides/cdl/images/cdl_image003.png
Figure 1. Building an Open CASCADE Technology application
@section occt_1819379591_986437237 2. Introduction to CDL
@subsection occt_1819379591_98643723721 Purposes of the Language
-You can use CDL to **define data **in the Open CASCADE Technology environment. CDL allows you to define various kinds of data types supporting the application architecture and development methodology, which you envision. CDL is neither an analysis formalism (e.g. Booch methodology) nor a data manipulation language (e.g. C++).
+You can use CDL to **define** **data** in the Open CASCADE Technology environment. CDL allows you to define various kinds of data types supporting the application architecture and development methodology, which you envision. CDL is neither an analysis formalism (e.g. Booch methodology) nor a data manipulation language (e.g. C++).
-You use CDL in the **design phase **of a development process to define a set of software components which best model the concepts stated in the application specification.
+You use CDL in the **design** **phase** of a development process to define a set of software components which best model the concepts stated in the application specification.
- @image html /dev_guides/cdl/images/cdl_image004.jpg
- @image latex /dev_guides/cdl/images/cdl_image004.jpg
+ @image html /dev_guides/cdl/images/cdl_image004.png
+ @image latex /dev_guides/cdl/images/cdl_image004.png
Figure 2. The Development Process
* Data types manipulated by handle (or reference)
* Data types manipulated by value
- @image html /dev_guides/cdl/images/cdl_image005.jpg
- @image latex /dev_guides/cdl/images/cdl_image005.jpg
+ @image html /dev_guides/cdl/images/cdl_image005.png
+ @image latex /dev_guides/cdl/images/cdl_image005.png
Figure 3. Manipulation of data types
* Types defined using classes inheriting from the **Transient **class.
These types are not storable as such in a file.
-@image html /dev_guides/cdl/images/cdl_image006.jpg
-@image latex /dev_guides/cdl/images/cdl_image006.jpg
+@image html /dev_guides/cdl/images/cdl_image006.png
+@image latex /dev_guides/cdl/images/cdl_image006.png
Figure 4. Manipulation of a data type by reference
You can store types known to the schema (i.e. either primitives or inheriting from Storable) and manipulated by value inside a persistent object as part of the representation. This is the only way for you to store objects “manipulated by value” in a file.
- @image html /dev_guides/cdl/images/cdl_image007.jpg
- @image latex /dev_guides/cdl/images/cdl_image007.jpg
+ @image html /dev_guides/cdl/images/cdl_image007.png
+ @image latex /dev_guides/cdl/images/cdl_image007.png
Figure 5. Manipulation of a data type by value
Three types are manipulated by value:
* the internal representation
* the friend methods and friend classes.
- @image html /dev_guides/cdl/images/cdl_image009.jpg
- @image latex /dev_guides/cdl/images/cdl_image009.jpg
+ @image html /dev_guides/cdl/images/cdl_image009.png
+ @image latex /dev_guides/cdl/images/cdl_image009.png
**Figure 7. Contents of a class**
*** a deferred class does not have to contain a constructor**
The methods you declare in a package do not belong to any particular class. **Package methods ***must *carry a name different from the data types contained in the package. Like any other method, they can be overloaded. With the exception of the keyword **me **and the visibility (a package method can *only *be either public or private) package methods are described in the same way as **instance methods**.
-@image html /dev_guides/cdl/images/cdl_image010.jpg
-@image latex /dev_guides/cdl/images/cdl_image010.jpg
+@image html /dev_guides/cdl/images/cdl_image010.png
+@image latex /dev_guides/cdl/images/cdl_image010.png
Figure 8. Contents of a package
The example of the package below includes some of the basic data structures:
A method can be a friend to many classes. The class to which the method belongs does *not *need to appear in the **uses **clause of other classes of which it is a friend.
- @image html /dev_guides/cdl/images/cdl_image011.jpg
- @image latex /dev_guides/cdl/images/cdl_image011.jpg
+ @image html /dev_guides/cdl/images/cdl_image011.png
+ @image latex /dev_guides/cdl/images/cdl_image011.png
When the methods of a class are all friends of another class, you can establish the friendship at the level of the class.
-@subsection occt_1819379591_213955286151 Comparison of CDL & C++ Syntax for Data Types manipulated by Handle and by Value
+@subsection occt_1819379591_213955286151 Comparison of CDL & C++ Syntax for Data Types manipulated by Handle and by Value
- @image html /dev_guides/cdl/images/cdl_image012.jpg
- @image latex /dev_guides/cdl/images/cdl_image012.jpg
+ @image html /dev_guides/cdl/images/cdl_image012.png
+ @image latex /dev_guides/cdl/images/cdl_image012.png
\ No newline at end of file
Developer Guides {#dev_guides}
================
-## Source Repository
+The following documents provide information on OCCT building, development and testing:
-This directory contains sources of Open CASCADE Technology (OCCT), a collection
-of C++ libraries providing services for 3D surface and solid modeling, CAD data
-exchange, and visualization. OCCT can be best applied in development of
-software dealing with 3D modeling (CAD), manufacturing / measuring (CAM) or
-numerical simulation (CAE).
+* @subpage dev_guides__building "Building OCCT from sources"
+* @subpage dev_guides__documentation "Documentation system"
+* Coding Rules
+* Contribution Workflow
+* Guide to installing and using Git for OCCT development
+* @subpage dev_guides__tests "Automatic Testing system"
-The OCCT code is subject to the Open CASCADE Technology Public License Version
-6.6 (the "License"). You may not use the content of the relevant files except in
-compliance with the License. Please see the LICENSE file or obtain a copy of the
-License at http://www.opencascade.org and read it completely before using this
-software.
+Two other documents provide details on obsolete technologies used by OCCT,
+to be removed in future releases:
-## Automatic tests
-
-OCCT automatic testing system is integrated with @ref draw "DRAW Test Harness",
-a console application based on Tcl (a scripting language).
-All tests are run from DRAW command prompt (run **draw.bat** or
-**draw.sh** to start it).
-
-Standard OCCT tests are located in subdirectory **tests** of the OCCT root
-folder. This location is set as default at DRAW start (see environment variable
-_CSF_TestScriptsPath_ defined in **src/DrawResources/DrawDefaults**).
-
-The tests are organized in three levels:
-- Group: a group of related test grids, usually testing a particular subset of OCCT functionality (e.g. *blend*).
-- Grid: a set of test cases within a group, usually aimed at testing a particular aspect or mode of execution of the relevant functionality (e.g. *buildevol*).
-- Test case: a script implementing an individual test (e.g. *K4*).
-
-To run all tests, type command *testgrid*:
-
- Draw[]\> testgrid
-
-For running only a group or a grid of tests, give additional arguments indicating the group and (if needed) the grid name:
-
- Draw[]\> testgrid blend simple
-
-As the tests progress, the result of each test case is reported.
-At the end of the log a summary of test cases is output, including the list of
-detected regressions and improvements, if any.
-The tests are considered as non-regressive if only OK, BAD (i.e. known problem),
-and SKIPPED (i.e. not executed, typically because of lack of a data file)
-statuses are reported.
-
-To run a single test, type command 'test' followed by the names of
-group, grid, and test case.
-
- Draw[1]\> test blend simple A1
- CASE blend simple A1: OK
-
-To see intermediate commands and their output during the test execution,
-add one more argument '-echo' at the end of the command line, or type 'dlog get'
-after test completion.
-
-For more information consult \subpage dev_guides__tests
-
-## docs
-**short description**
-
-\subpage dev_guides__documentation
-
-## wok
-**short description**
-
-\subpage dev_guides__wok
-
-## building
-**short description**
-
-\subpage dev_guides__building
-
-## cdl
-**short description**
-
-\subpage dev_guides__cdl
\ No newline at end of file
+* @subpage dev_guides__wok "Workshop Organization Kit (WOK)"
+* @subpage dev_guides__cdl "Component Definition Language (CDL)"
- Documentation {#dev_guides__documentation}
-=================
+ Documentation System {#dev_guides__documentation}
+======================
+
+@tableofcontents
@section OCCT_DM_SECTION_1 Introduction
@section OCCT_DM_SECTION_2 Prerequisites
<b>Tcl/Tk</b>
-The lates version: http://www.tcl.tk/software/tcltk/download.html
+Version 8.5 or 8.6: http://www.tcl.tk/software/tcltk/download.html
-<b>Doxygen</b> ( >= 1.8.4 )
-The latest version: http://www.stack.nl/~dimitri/doxygen/download.html
+<b>Doxygen</b>
+Version 1.8.4 or above: http://www.stack.nl/~dimitri/doxygen/download.html
-<b>MathJax</b> (used for rendering math formulas in browser). Download it for local installation or use the MathJax Content Delivery Network. \(read
-@htmlonly <a href="#OCCT_DM_SECTION_A_9">Formulas</a> @endhtmlonly paragraph for more detailed description\).
+<b>MathJax</b> (used for rendering math formulas in browser).
+See \ref OCCT_DM_SECTION_A_9 paragraph for more detailed description.
The latest version: http://www.mathjax.org/download/
<b>MiKTeX</b> or equivalent tool (used for PDF document creation)
+
Latest version: http://miktex.org/download
-**Note**: to generate pdf documentation with MiKTeX you should execute gen.bat with MiKTeX environment
-(e.g. into MiKTeX command promt)
+**Note**: to generate pdf documentation with MiKTeX you should execute gendoc.bat within MiKTeX environment
+(run gendoc.bat in MiKTeX command promt or update PATH for MiKTeX bin folder). Also in process of pdf generation
+MiKTeX can request you to download missing packages if MiKTeX was installed with option below:
+
+@image html /dev_guides/documentation/images/documentation_image002.png
+@image latex /dev_guides/documentation/images/documentation_image002.png
+
+If this option is set to "Yes", MiKTeX will download missing packages automatically.
@section OCCT_DM_SECTION_2_1 Documentation Generation
* -html : To generate HTML files (cannot be used with -pdf);
* -pdf : To generate PDF files (cannot be used with -html);
- * -m=<modules_list> : Specifies list of articles to generate. If it is not specified, all files, mentioned in FILES.txt are processed;
- * -l=<document_name> : Specifies the article caption for a single document;
+ * -m=\<modules_list\> : Specifies list of articles to generate. If it is not specified, all files, mentioned in FILES.txt are processed;
+ * -l=\<document_name\> : Specifies the article caption for a single document;
* -h : Prints help message;
* -v : Specifies the Verbose mode (info on all script actions is shown).
* use this name with -m option in the generation process:
@verbatim
-% gen.bat -html -m=devs_guid/documentation/documentation.md
+% gendoc.bat -html -m=devs_guid/documentation/documentation.md
@endverbatim
Multiple files are separated with comma:
@verbatim
-% gen.bat -html -m=MD_FILE_1,MD_FILE_2
+% gendoc.bat -html -m=MD_FILE_1,MD_FILE_2
@endverbatim
-To sepcify a article name with -l option, use tcl list to prevent whitespaces incorrect interpretation:
+To sepcify a article name with -l option, use quotes to prevent incorrect interpretation of whitespaces:
@verbatim
-% gen.bat -pdf -m=MD_FILE_1 -l=[list MD File 1 Label]
+% gendoc.bat -pdf -m=MD_FILE_1 -l="Label of MD_FILE_1 document"
@endverbatim
@section OCCT_DM_SECTION_3 Documentation Conventions
More information on MarkDown and Doxygen syntax can be found at:
http://www.stack.nl/~dimitri/doxygen/manual
+
+@section OCCT_DM_SECTION_A Appendix 1: Document Syntax
+
+Each OCCT document file in *.md format has a simple structure.
+It can contain:
+
+| Content type | Obligation |
+| :---------------- | :-------------------: |
+| Header | M |
+| Footer | M |
+| Plain text | O |
+| List | O |
+| Table | O |
+| Code | O |
+| Formula | O |
+| Image | O |
+| Page numbers | M (auto generation) |
+| Table of contents | M (auto generation) |
+
+The legend:
+
+ * M is for Mandatory
+ * O is for Optional
+
+@subsection OCCT_DM_SECTION_A_1 Text Caption (a header)
+
+headings of different levels can be specified with the following code:
+
+@verbatim
+Header 1 {#header1}
+=======
+@endverbatim
+
+ to get
+
+ Header 1
+=========
+
+ and with the following code:
+
+@verbatim
+Header 2 {#header2}
+--------
+@endverbatim
+
+to get
+
+Header 2
+---------
+
+Where a word in curly braces is a MarkDown-style reference, which can be used in table of contents.
+If you would like to have the table of contents, it is recommended to use \@section,
+\@subsection and \@subsubsection pages instead of MarkDown headers as follows:
+
+@verbatim
+ @section Section_Name Section Header
+ @subsection SubSection_Name SubSection Header
+ @subsubsection SubSubSection_Name SubSubSection Header
+@endverbatim
+
+@subsection OCCT_DM_SECTION_A_2 Plain Text
+
+Plain text is a text in a notepad-like format. To insert special symbols,
+like \< , \> or \\, prepend them with \\ character: \\\<, \\\>, \\\\
+To emphasize some words, write one pair of asterisks ( * ) or underscores ( _ ) across the word
+to make it *italic* and two pairs of these symbols to make a word **Bold**.
+
+@subsection OCCT_DM_SECTION_A_3 Lists
+
+To create a bulleted list, start each line with a hyphen or an asterisk,
+followed by a space. List items can be nested. This code:
+
+@verbatim
+ * Bullet 1
+ * Bullet 2
+ * Bullet 2a
+ * Bullet 2b
+ * Bullet 3
+@endverbatim
+
+ produces this list:
+
+ * Bullet 1
+ * Bullet 2
+ * Bullet 2a
+ * Bullet 2b
+ * Bullet 3
+
+To create a numbered list, start each line with number and a period, then a space. Thus this code
+
+@verbatim
+ 1. ListItem_1
+ 2. ListItem_2
+ 3. ListItem_3
+@endverbatim
+
+ produces this list:
+
+ 1. ListItem_1
+ 2. ListItem_2
+ 3. ListItem_3
+
+It is recommended to indent lists with 2 spaces.
+
+@subsection OCCT_DM_SECTION_A_4 Tables
+
+A table consists of a header line, a separator line, and at least one row line.
+Table columns are separated by the pipe (|) character. The following example:
+
+@verbatim
+First Header | Second Header
+------------- | -------------
+Content Cell | Content Cell
+Content Cell | Content Cell
+@endverbatim
+
+ will produce the following table:
+
+First Header | Second Header
+------------ | -------------
+Content Cell | Content Cell
+Content Cell | Content Cell
+
+Column alignment can be controlled via one or two colons at the header separator line:
+
+@verbatim
+| Right | Center | Left |
+| ----: | :----: | :---- |
+| 10 | 10 | 10 |
+| 1000 | 1000 | 1000 |
+@endverbatim
+
+which will looks as follows:
+
+| Right | Center | Left |
+| ----: | :----: | :---- |
+| 10 | 10 | 10 |
+| 1000 | 1000 | 1000 |
+
+@subsection OCCT_DM_SECTION_A_5 Code Blocks
+
+It is recommended to indent a code lines with 4 spaces.
+A fenced code block does not require indentation, and is defined by a pair of "fence lines".
+Such line consists of 3 or more tilde (~) characters on a line.
+The end of the block should have the same number of tildes. Here is an example:
+
+~~~~~~~~~~~~~~~~~~~~~~~
+ a one-line code block
+~~~~~~~~~~~~~~~~~~~~~~~
+
+By default the output is the same as for a normal code block.
+To highlight the code, the developer has to indicate the typical file extension,
+which corresponds to the programming language, after the opening fence.
+For highlighting according to the C++ language, for instance, write the following code (the curly braces and dot are optional):
+
+@verbatim
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ int func(int a,int b) { return a*b; }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+@endverbatim
+
+which will produce:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ int func(int a,int b) { return a*b; }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Verbatim content can be written by using framing \@verbatim \@endverbatim . For instance
+
+@verbatim
+ verbatim text
+@endverbatim
+
+@subsection OCCT_DM_SECTION_A_6 References
+
+To insert a reference to a website, it is proposed to write a URL. For example: http://en.wikipedia.org
+To insert a reference to another part of the same document, the developer can write:
+
+@verbatim
+ @htmlonly
+ <a href="#OCCT_DOC_SECTION_5">Doxygen Configuration file</a>
+ @endhtmlonly
+@endverbatim
+
+to get a link to paragraph : @htmlonly <a href="#OCCT_DOC_SECTION_5">Doxygen configuration</a> @endhtmlonly
+
+@subsection OCCT_DM_SECTION_A_7 Images
+
+To insert image into document the developer can write the following code(in Doxygen-style):
+@verbatim
+![alt-caption](relative/path/to/image/image001.svg "Image Caption")
+@endverbatim
+
+This code tells Doxygen to insert a picture right in the place this code was written. Like this:
+@verbatim
+![](/resources/occ_logo.png "OCCT logo")
+@endverbatim
+
+![](/resources/occ_logo.png "OCCT logo")
+
+@subsection OCCT_DM_SECTION_A_8 Table Of Contents
+
+To get the table of contents at the beginning of the document, write \@tableofcontents tag.
+But it is not needed now because TreeView option for HTML is used.
+The TOC in the PDF document will be generated automatically.
+
+@subsection OCCT_DM_SECTION_A_9 Formulas
+
+Formulas within documents will be generated using MathJax tool.
+
+A developer has to specify these parameters in Doxyfile to enable support of MathJax in Doxygen:
+
+ USE_MATHJAX = YES
+ MATHJAX_FORMAT = HTML-CSS
+ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
+ MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+
+To use MathJax tool with the HTML page, it's \<head\> block has to contain
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.html}
+ <script type="text/x-mathjax-config">
+ MathJax.Hub.Config({
+ tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]},
+ displayAlign: "left"
+ });
+ </script>
+
+ <script type="text/javascript"
+ src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
+ </script>
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+First script configures MathJax to understand separator types and to left allign formulas.
+The second script inserts reference to MathJax tool.
+This tool will always be used when the HTML output will be shown.
+
+Equations can be written by several ways:
+
+1.Unnumbered displayed formulas that are centered on a separate line.
+These formulas should be put between \@f\[ and \@f\] tags. An example:
+
+@verbatim
+@f$[
+ |I_2|=\left| \int_{0}^T \psi(t)
+ \left\{
+ u(a,t)-
+ \int_{\gamma(t)}^a
+ \frac{d\theta}{k(\theta,t)}
+ \int_{a}^\theta c(\xi)u_t(\xi,t)\,d\xi
+ \right\} dt
+ \right|
+@f$]
+@endverbatim
+
+gives the following result:
+
+ @f$
+ |I_2|=\left| \int_{0}^T \psi(t)
+ \left\{
+ u(a,t)-
+ \int_{\gamma(t)}^a
+ \frac{d\theta}{k(\theta,t)}
+ \int_{a}^\theta c(\xi)u_t(\xi,t)\,d\xi
+ \right\} dt
+ \right|
+ @f$
+
+2.Formulas can also be put between @verbatim \begin{align} @endverbatim and @verbatim \end{align} @endverbatim tags. An example:
+
+@verbatim
+ \begin{align}
+ \dot{x} & = \sigma(y-x) \\
+ \dot{y} & = \rho x - y - xz \\
+ \dot{z} & = -\beta z + xy
+ \end{align}
+@endverbatim
+
+ gives the following result:
+@latexonly
+ \begin{align}
+ \dot{x} & = \sigma(y-x) \\
+ \dot{y} & = \rho x - y - xz \\
+ \dot{z} & = -\beta z + xy
+ \end{align}
+@endlatexonly
+
+@htmlonly
+ \begin{align}
+ \dot{x} & = \sigma(y-x) \\
+ \dot{y} & = \rho x - y - xz \\
+ \dot{z} & = -\beta z + xy
+ \end{align}
+@endhtmlonly
+
+3.Inline formulas can be specified using this syntax:
+
+@verbatim
+ @f$ \sqrt{3x-1}+(1+x)^2 @f$
+@endverbatim
+
+ that leads to the following result: @f$ \sqrt{3x-1}+(1+x)^2 @f$
+
\ No newline at end of file
Automated Testing System {#dev_guides__tests}
======================================
+@tableofcontents
+
@section testmanual_1 Introduction
This document provides overview and practical guidelines for work with OCCT automatic testing system.
@subsection testmanual_1_1 Basic Information
-OCCT automatic testing system is organized around DRAW Test Harness [1],
+OCCT automatic testing system is organized around DRAW Test Harness @ref user_guides__test_harness "DRAW Test Harness",
a console application based on Tcl (a scripting language) interpreter extended by OCCT-related commands.
+
Standard OCCT tests are included with OCCT sources and are located in subdirectory *tests*
of the OCCT root folder. Other test folders can be included in the scope of the test system,
e.g. for testing applications based on OCCT.
+
Logically the tests are organized in three levels:
* Group: group of related test grids, usually relating to some part of OCCT functionality (e.g. blend)
Example:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
- FAILED /\b[Ee]xception\b/ exception
- FAILED /\bError\b/ error
+ FAILED /\\b[Ee]xception\\b/ exception
+ FAILED /\\bError\\b/ error
SKIPPED /Cannot open file for reading/ data file is missing
SKIPPED /Could not read file .*, abandon/ data file is missing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Example:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
- FAILED /\bFaulty\b/ bad shape
+ FAILED /\\bFaulty\\b/ bad shape
IGNORE /^Error [23]d = [\d.-]+/ debug output of blend command
IGNORE /^Tcl Exception: tolerance ang : [\d.-]+/ blend failure
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Make sure that file parse.rules in the grid or group directory contains
regular expression to catch possible messages indicating failure of the test.
For instance, for catching errors reported by *checkshape* command
-relevant grids define a rule to recognize its report by the word *Faulty*: FAILED /\bFaulty\b/ bad shape
+relevant grids define a rule to recognize its report by the word *Faulty*: FAILED /\\bFaulty\\b/ bad shape
For the messages generated in the script the most natural way is to use the word *Error* in the message.
Example:
@subsection testmanual_3_5 Marking BAD Cases
If the test produces invalid result at a certain moment then the corresponding bug
-should be created in the OCCT issue tracker [3], and the problem should be marked as TODO in the test script.
+should be created in the OCCT issue tracker http://tracker.dev.opencascade.org,
+and the problem should be marked as TODO in the test script.
The following statement should be added to such test script:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
d:/occt/test-data[_path_separator]d:/MyOCCTProject/tests
return ;# this is to avoid an echo of the last command above in cout
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-@section testmanual_5 References
-
--# DRAW Test Harness User’s Guide
--# Perl regular expressions, http://perldoc.perl.org/perlre.html
--# OCCT MantisBT issue tracker, http://tracker.dev.opencascade.org
-Workshop Organisation Toolkit {#dev_guides__wok}
-==============================
+Workshop Organisation Kit {#dev_guides__wok}
+=========================
+
+@tableofcontents
+
+@section occt_wok_0 DEPRECATION WARNING
+
+Please note that this document describes use of WOK as comprehensive
+build system. This use is outdated, and WOK is to be removed in
+one of future releases of OCCT.
+
+Currently only small subset of WOK capabilities described in this document
+are actually necessary for building OCCT. See @ref dev_guides__building__wok
+for more practical guide.
@section occt_wok_1_ Introduction Glossary
In the new WOK model:
* each workbench can have its own database
* the version control environment variables are relative to the workbench.
-@image html /dev_guides/wok/images/wok_image014.jpg "Workshop Installation Model"
-@image latex /dev_guides/wok/images/wok_image014.jpg "Workshop Installation Model"
+@image html /dev_guides/wok/images/wok_image014.png "Workshop Installation Model"
+@image latex /dev_guides/wok/images/wok_image014.png "Workshop Installation Model"
The following procedure explains how to set up the source management environment for a workshop.
1. Open the factory and the workshop.
# Author: omy
# -----------------------------------------------------------------------
-# Generates Doxygen configuration file for Overview documentation
-proc OverviewDoc_MakeDoxyfile {casDir outDir tagFileDir {doxyFileName} {generatorMode ""} DocFilesList verboseMode} {
+# get OCCT version from file Standard_Version.hxx (if available)
+proc OverviewDoc_DetectCasVersion {theCasRoot} {
+ set occt_ver 16.7.0
+ set occt_ver_add ""
+ if { [file exist $theCasRoot/src/Standard/Standard_Version.hxx] } {
+ set fh [open $theCasRoot/src/Standard/Standard_Version.hxx]
+ set fh_loaded [read $fh]
+ close $fh
+ regexp {[^/]\s*#\s*define\s+OCC_VERSION_COMPLETE\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver
+ regexp {#\s*define\s+OCC_VERSION_DEVELOPMENT\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver_add
+ if { "$occt_ver_add" != "" } { set occt_ver ${occt_ver}.$occt_ver_add }
+ }
+ return $occt_ver
+}
- if {$verboseMode == "YES"} {
- puts "INFO: Doxygen is now generating Doxyfile..."
- }
+# Generates Doxygen configuration file for Overview documentation
+proc OverviewDoc_MakeDoxyfile {casDir outDir tagFileDir {doxyFileName} {generatorMode ""} DocFilesList verboseMode searchMode} {
set doxyFile [open $doxyFileName "w"]
set casroot $casDir
# Common configs
puts $doxyFile "DOXYFILE_ENCODING = UTF-8"
puts $doxyFile "PROJECT_NAME = \"Open CASCADE Technology\""
- puts $doxyFile "PROJECT_NUMBER = 6.7.0"
+ puts $doxyFile "PROJECT_NUMBER = [OverviewDoc_DetectCasVersion $casDir]"
puts $doxyFile "PROJECT_BRIEF = "
- puts $doxyFile "PROJECT_LOGO = $inputDir/resources/occt_logo.png"
+ puts $doxyFile "PROJECT_LOGO = $inputDir/resources/occ_logo.png"
puts $doxyFile "OUTPUT_DIRECTORY = $outDir"
puts $doxyFile "CREATE_SUBDIRS = NO"
puts $doxyFile "GENERATE_AUTOGEN_DEF = NO"
puts $doxyFile "GENERATE_PERLMOD = NO"
- set PARAM_INPUT "INPUT = "
- set PARAM_IMAGEPATH "IMAGE_PATH = $inputDir/resources/ "
+ set PARAM_INPUT "INPUT ="
+ set PARAM_IMAGEPATH "IMAGE_PATH = $inputDir/resources/ "
foreach docFile $DocFilesList {
set NEW_IMG_PATH [file normalize [file dirname "$inputDir/$docFile"]]
if { [string compare $NEW_IMG_PATH $casroot] != 0 } {
if {[file isdirectory "$NEW_IMG_PATH/images"]} {
- append PARAM_IMAGEPATH " " "$NEW_IMG_PATH/images"
+ append PARAM_IMAGEPATH " $NEW_IMG_PATH/images"
}
}
append PARAM_INPUT " " $inputDir/$docFile
}
puts $doxyFile $PARAM_INPUT
puts $doxyFile $PARAM_IMAGEPATH
-
- if { $generatorMode == "PDF_ONLY"} {
- set PARAM_LATEX_EF "LATEX_EXTRA_FILES ="
- foreach docFile $DocFilesList {
- set NEW_LEF_PATH [file normalize [file dirname "$inputDir/$docFile"]]
- if { [string compare $NEW_LEF_PATH $casroot] != 0 } {
- append PARAM_LATEX_EF " " "$NEW_LEF_PATH/images"
- }
- }
- puts $doxyFile $PARAM_LATEX_EF
- }
if { $generatorMode == "HTML_ONLY"} {
# Set a reference to a TAGFILE
puts $doxyFile "TAGFILES = $tagFileDir/OCCT.tag=$tagPath/html"
}
}
-
# HTML Output
puts $doxyFile "GENERATE_LATEX = NO"
puts $doxyFile "GENERATE_HTML = YES"
puts $doxyFile "ENUM_VALUES_PER_LINE = 8"
puts $doxyFile "TREEVIEW_WIDTH = 250"
puts $doxyFile "EXTERNAL_PAGES = NO"
- puts $doxyFile "SEARCHENGINE = YES"
- puts $doxyFile "SERVER_BASED_SEARCH = NO"
- puts $doxyFile "EXTERNAL_SEARCH = NO"
+ # HTML Search engine options
+ if { [string tolower $searchMode] == "none" } {
+ puts $doxyFile "SEARCHENGINE = NO"
+ puts $doxyFile "SERVER_BASED_SEARCH = NO"
+ puts $doxyFile "EXTERNAL_SEARCH = NO"
+ } else {
+ puts $doxyFile "SEARCHENGINE = YES"
+ if { [string tolower $searchMode] == "local" } {
+ puts $doxyFile "SERVER_BASED_SEARCH = NO"
+ puts $doxyFile "EXTERNAL_SEARCH = NO"
+ } elseif { [string tolower $searchMode] == "server" } {
+ puts $doxyFile "SERVER_BASED_SEARCH = YES"
+ puts $doxyFile "EXTERNAL_SEARCH = NO"
+ } elseif { [string tolower $searchMode] == "external" } {
+ puts $doxyFile "SERVER_BASED_SEARCH = YES"
+ puts $doxyFile "EXTERNAL_SEARCH = YES"
+ } else {
+ puts "ERROR: Wrong search engine type"
+ close $doxyFile
+ return
+ }
+ }
puts $doxyFile "SEARCHDATA_FILE = searchdata.xml"
puts $doxyFile "SKIP_FUNCTION_MACROS = YES"
# Formula options
# Prints Help message
proc OverviewDoc_PrintHelpMessage {} {
- puts "\nUsage : occdoc \[-h\] \[-html\] \[-pdf\] \[-m=<list of files>\] \[-l=<document name>\] \[-v\]"
+ puts "\nUsage : occdoc \[-h\] \[-html\] \[-pdf\] \[-m=<list of files>\] \[-l=<document name>\] \[-v\] \[-s\]"
puts ""
puts " Options are : "
puts " -html : To generate HTML files"
puts " -h : Prints help message"
puts " -v : Specifies the Verbose mode"
puts " (info on all script actions is shown)"
+ puts " -s=<search_mode> : Specifies the Search mode of HTML documents."
+ puts " Can be: none | local | server | external | "
+ puts " : Can be used only with -html option"
}
# Parses command line arguments
if { [file exists "$INPUTDIR/FILES.txt"] == 1 } {
set FILE [open "$INPUTDIR/FILES.txt" r]
while {1} {
- set line [gets $FILE]
+ set line [string trim [gets $FILE]]
+
+ # trim possible comments starting with '#'
+ set line [regsub {\#.*} $line {}]
+
if {$line != ""} {
lappend available_docfiles $line
}
puts $texfile "\\hfuzz=15pt"
puts $texfile "\\hbadness=750"
puts $texfile "\\setlength{\\emergencystretch}{15pt}"
- puts $texfile "\\setlength{\\parindent}{0.75cm}"
- puts $texfile "\\setlength{\\parskip}{0.2cm}"
+ puts $texfile "\\setlength{\\parindent}{0cm}";#0.75cm
+ puts $texfile "\\setlength{\\parskip}{0.2cm}"; #0.2
puts $texfile "\\makeatletter"
puts $texfile "\\renewcommand{\\paragraph}{%"
puts $texfile " \@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{%"
puts $texfile "\\fancyhead\[RO\]{\\fancyplain{}{\\bfseries\\thepage}}"
puts $texfile "\\fancyfoot\[LE\]{\\fancyplain{}{}}"
puts $texfile "\\fancyfoot\[CE\]{\\fancyplain{}{}}"
- puts $texfile "\\fancyfoot\[RE\]{\\fancyplain{}{\\bfseries\\scriptsize (c) Open CASCADE Technology 2001\-2013}}"
- puts $texfile "\\fancyfoot\[LO\]{\\fancyplain{}{\\bfseries\\scriptsize (c) Open CASCADE Technology 2001\-2013}}"
+ puts $texfile "\\fancyfoot\[RE\]{\\fancyplain{}{\\bfseries\\scriptsize (c) Open CASCADE 2001\-2013}}"
+ puts $texfile "\\fancyfoot\[LO\]{\\fancyplain{}{\\bfseries\\scriptsize (c) Open CASCADE 2001\-2013}}"
puts $texfile "\\fancyfoot\[CO\]{\\fancyplain{}{}}"
puts $texfile "\\fancyfoot\[RO\]{\\fancyplain{}{}}"
puts $texfile "\\renewcommand{\\footrulewidth}{0.4pt}"
puts $texfile "}"
puts $texfile "\n"
puts $texfile "%===== C O N T E N T S =====\n"
-# puts $texfile "\\DeclareUnicodeCharacter{00A0}{ }"
puts $texfile "\\begin{document}"
puts $texfile ""
puts $texfile "% Titlepage & ToC"
puts $texfile "\\begin{titlepage}"
puts $texfile "\\vspace*{7cm}"
puts $texfile "\\begin{center}%"
- puts $texfile "\\includegraphics\[width=0.75\\textwidth, height=0.2\\textheight\]{overview_occttransparent.png}\\\\\\\\"
- puts $texfile "{\\Large Open C\\-A\\-S\\-C\\-A\\-D\\-E Technology \\\\\[1ex\]\\Large 6.\\-6.\\-0 }\\\\"
+ puts $texfile "\\includegraphics\[width=0.75\\textwidth, height=0.2\\textheight\]{../../../dox/resources/occt_logo.png}\\\\"; #\\\\\\\\
+ puts $texfile "{\\Large Open C\\-A\\-S\\-C\\-A\\-D\\-E Technology \\\\\[1ex\]\\Large [OverviewDoc_DetectCasVersion $latexDir/../../../] }\\\\"
puts $texfile "\\vspace*{1cm}"
puts $texfile "{\\Large $docLabel}\\\\"
puts $texfile "\\vspace*{1cm}"
puts $texfile "\\pagenumbering{arabic}"
puts $texfile "\\hypersetup{pageanchor=true}"
puts $texfile ""
+ puts $texfile "\\let\\stdsection\\section"
+ puts $texfile " \\renewcommand\\section{\\pagebreak\\stdsection}"
puts $texfile "\\hypertarget{$fileName}{}"
puts $texfile "\\input{$fileName}"
puts $texfile ""
}
# Main procedure for documents compilation
-proc OverviewDoc_Main { {docfiles {}} generatorMode docLabel verboseMode} {
+proc OverviewDoc_Main { {docfiles {}} generatorMode docLabel verboseMode searchMode} {
set INDIR [file normalize [file dirname [info script]]]
set CASROOT [file normalize [file dirname "$INDIR/../../"]]
if {[file exists $HTMLDIR] == 0} {
file mkdir $HTMLDIR
}
- if {[file exists $LATEXDIR] == 0} {
- file mkdir $LATEXDIR
- }
if {[file exists $PDFDIR] == 0} {
file mkdir $PDFDIR
}
+
+ if {[file exists $LATEXDIR]} {
+ #file delete {*}[glob -nocomplain $LATEXDIR/*.*]
+ file delete -force $LATEXDIR
+ }
+ file mkdir $LATEXDIR
# Run tools to compile documents
- puts ""
- puts " [clock format [clock seconds] -format {%Y.%m.%d %H:%M}] Generation process started..."
- puts ""
- puts " Please, wait while Doxygen finishes it\'s work"
- OverviewDoc_MakeDoxyfile $CASROOT "$OUTDIR/overview" $TAGFILEDIR $DOXYFILE $generatorMode $docfiles $verboseMode
+ puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generating Doxyfile..."
+
+ OverviewDoc_MakeDoxyfile $CASROOT "$OUTDIR/overview" $TAGFILEDIR $DOXYFILE $generatorMode $docfiles $verboseMode $searchMode
# Run doxygen tool
if { $generatorMode == "HTML_ONLY"} {
- puts " [clock format [clock seconds] -format {%Y.%m.%d %H:%M}] Doxygen is now generating HTML files...\n"
+ puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generating HTML files..."
}
set RESULT [catch {exec doxygen $DOXYFILE > $OUTDIR/doxygen_out.log} DOX_ERROR]
if {$RESULT != 0} {
if {[llength [split $DOX_ERROR "\n"]] > 1} {
if {$verboseMode == "YES"} {
- puts "INFO: See Doxygen messages in $OUTDIR/doxygen_warnings_and_errors.log"
+ puts "See Doxygen log in $OUTDIR/doxygen_warnings_and_errors.log"
}
set DOX_ERROR_FILE [open "$OUTDIR/doxygen_warnings_and_errors.log" "w"]
puts $DOX_ERROR_FILE $DOX_ERROR
# Start PDF generation routine
if { $generatorMode == "PDF_ONLY" } {
- puts ""
- puts " [clock format [clock seconds] -format {%Y.%m.%d %H:%M}] Doxygen is now generating PDF files...\n"
+ puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generating PDF files..."
set OS $::tcl_platform(platform)
if { $OS == "unix" } {
}
# Prepare a list of TeX files, generated by Doxygen
- puts "go to $LATEXDIR"
cd $LATEXDIR
set TEXFILES [glob $LATEXDIR -type f -directory $LATEXDIR -tails "*.tex" ]
set IDX [lsearch $TEXFILES "$LATEXDIR"]
}
- puts "Preprocess generated TeX files"
+ if {$verboseMode == "YES"} {
+ puts "Preprocessing generated TeX files..."
+ }
OverviewDoc_ProcessTex $TEXFILES $LATEXDIR $verboseMode
-
- puts "Generate PDF files from"
+
+ if {$verboseMode == "YES"} {
+ puts "Generating PDF files from TeX files..."
+ }
foreach TEX $TEXFILES {
# Rewrite existing REFMAN.tex file...
set TEX [string range $TEX 0 [ expr "[string length $TEX] - 5"]]
if {$verboseMode == "YES"} {
puts "INFO: Generating PDF file from $TEX"
+ # ...and use it to generate PDF from TeX...
+ puts "Executing $LATEXDIR/make$PREFIX..."
}
- # ...and use it to generate PDF from TeX...
- puts "execute $LATEXDIR/make$PREFIX"
set RESULT [catch {eval exec [auto_execok $LATEXDIR/make$PREFIX] > "$OUTDIR/pdflatex_out.log"} LaTeX_ERROR]
if {$RESULT != 0} {
if {[llength [split $LaTeX_ERROR "\n"]] > 1} {
+ if {$verboseMode == "YES"} {
+ puts "See Latex log in $OUTDIR/pdflatex_warnings_and_errors.log"
+ }
set LaTeX_ERROR_FILE [open "$OUTDIR/pdflatex_warnings_and_errors.log" "w"]
puts $LaTeX_ERROR_FILE $LaTeX_ERROR
close $LaTeX_ERROR_FILE
}
if {![file exists "$LATEXDIR/refman.pdf"]} {
- puts "file $LATEXDIR/refman.pdf doesn't exist"
+ puts "Error: file $LATEXDIR/refman.pdf does not exist"
return
}
file rename $LATEXDIR/refman.pdf "$PDFDIR/$TEX.pdf"
}
- if {$verboseMode == "YES"} {
- puts "INFO: See LaTeX messages in $OUTDIR/pdflatex_warnings_and_errors.log"
- }
}
cd $INDIR
- puts " [clock format [clock seconds] -format {%Y.%m.%d %H:%M}] Generation process finished..."
- puts ""
- puts "--------------------------------------------------------------------"
+ puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generation completed"
if { $generatorMode == "HTML_ONLY" } {
- puts " You can look at generated HTML pages by opening: "
+ puts "View generated HTML documentation by opening: "
set RESFILE $OUTDIR/overview/html/index.html
- puts " $RESFILE"
+ puts "$RESFILE"
}
if { $generatorMode == "PDF_ONLY" } {
- puts " You can look at generated PDF files in: "
- puts " $OUTDIR/overview/pdf folder"
+ puts "PDF files are generated in: "
+ puts "$OUTDIR/overview/pdf folder"
}
- puts ""
- puts " Copyright \u00a9 Open CASCADE Technology 2001-2013"
- puts "--------------------------------------------------------------------\n"
}
# A command for User Documentation compilation
proc occdoc {args} {
# Programm options
- set GEN_HTML "NO"
- set GEN_PDF "NO"
+ set GEN_MODE "HTML_ONLY"
+
set DOCFILES {}
- set DOCLABEL "Default OCCT Document"
- set VERB_MODE "NO"
- set GEN_MODE "DEFAULT"
+ set DOCLABEL "Default OCCT Document"
+ set VERB_MODE "NO"
+ set SEARCH_MODE "none"
+
global available_docfiles
global args_names
global args_values
if {[OverviewDoc_ParseArguments $args] == 1} {
return
}
- if {$args_names == {}} {
- set GEN_HTML "YES"
- set VERB_MODE "YES"
- } else {
- foreach arg_n $args_names {
- if {$arg_n == "h"} {
- OverviewDoc_PrintHelpMessage
- return
- } elseif {$arg_n == "html"} {
- set GEN_HTML "YES"
- } elseif {$arg_n == "pdf"} {
- set GEN_PDF "YES"
- } elseif {$arg_n == "v"} {
- set VERB_MODE "YES"
- } elseif {$arg_n == "m"} {
- if {$args_values(m) != "NULL"} {
- set DOCFILES $args_values(m)
- } else {
- puts "Error in argument m"
- return
- }
- # Check if all chosen docfiles are correct
- foreach docfile $DOCFILES {
- if { [lsearch $available_docfiles $docfile] == -1 } {
- puts "File \"$docfile\" is not presented in the list of available docfiles"
- puts "Please, specify the correct docfile name"
- return
- } else {
- puts "File $docfile is presented in FILES.TXT"
- }
- }
- } elseif {$arg_n == "l"} {
- if { [llength $DOCFILES] <= 1 } {
- if {$args_values(l) != "NULL"} {
- set DOCLABEL $args_values(l)
- } else {
- puts "Error in argument l"
- return
- }
- }
- } else {
- puts "\nWrong argument: $arg_n"
- OverviewDoc_PrintHelpMessage
- return
- }
- }
- }
-
- # Specify generation mode
- if {$GEN_HTML == "YES" && $GEN_PDF == "NO"} {
+
+ foreach arg_n $args_names {
+ if {$arg_n == "h"} {
+ OverviewDoc_PrintHelpMessage
+ return
+ } elseif {$arg_n == "html"} {
set GEN_MODE "HTML_ONLY"
- } elseif {$GEN_PDF == "YES"} {
+ } elseif {$arg_n == "pdf"} {
set GEN_MODE "PDF_ONLY"
- }
- # Check if -v is the only option
- if {$GEN_MODE == "DEFAULT"} {
- if { $VERB_MODE == "YES" } {
- puts "\nArgument -v can't be used without -pdf or -html argument"
- OverviewDoc_PrintHelpMessage
+ } elseif {$arg_n == "v"} {
+ set VERB_MODE "YES"
+ } elseif {$arg_n == "m"} {
+ if {$args_values(m) != "NULL"} {
+ set DOCFILES $args_values(m)
+ } else {
+ puts "Error in argument m"
+ return
+ }
+
+ # Check if all chosen docfiles are correct
+ foreach docfile $DOCFILES {
+ if { [lsearch $available_docfiles $docfile] == -1 } {
+ puts "File \"$docfile\" is not presented in the list of available docfiles"
+ puts "Please, specify the correct docfile name"
+ return
+ } else {
+ puts "File $docfile is presented in FILES.TXT"
+ }
+ }
+ } elseif {$arg_n == "l"} {
+ if { [llength $DOCFILES] <= 1 } {
+ if {$args_values(l) != "NULL"} {
+ set DOCLABEL $args_values(l)
+ } else {
+ puts "Error in argument l"
+ return
}
+ }
+ } elseif {$arg_n == "s"} {
+ if {$args_values(s) != "NULL"} {
+ set SEARCH_MODE $args_values(s)
+ } else {
+ puts "Error in argument s"
return
+ }
+ } else {
+ puts "\nWrong argument: $arg_n"
+ OverviewDoc_PrintHelpMessage
+ return
}
+ }
+
+ # Specify verbose mode
+ if { $GEN_MODE != "PDF_ONLY" && [llength $DOCFILES] > 1 } {
+ set DOCLABEL ""
+ }
- # Specify verbose mode
- if { $GEN_PDF != "YES" && [llength $DOCFILES] > 1 } {
- set DOCLABEL ""
- }
-
- # If we don't specify list for docfiles with -m argument,
- # we assume that we have to generate all docfiles
- if { [llength $DOCFILES] == 0 } {
- set DOCFILES $available_docfiles
- }
+ # If we don't specify list for docfiles with -m argument,
+ # we assume that we have to generate all docfiles
+ if { [llength $DOCFILES] == 0 } {
+ set DOCFILES $available_docfiles
+ }
- # Start main activities
- OverviewDoc_Main $DOCFILES $GEN_MODE $DOCLABEL $VERB_MODE
+ # Start main activities
+ OverviewDoc_Main $DOCFILES $GEN_MODE $DOCLABEL $VERB_MODE $SEARCH_MODE
}
+++ /dev/null
-License {#occt_pubic_license}
-=======
-
-## Open CASCADE Technology Public License
-
-*License version: 6.6* @htmlonly<br />@endhtmlonly
-*March, 2013*
-
-Open CASCADE S.A.S. releases and makes publicly available the source code of the software Open CASCADE Technology to the free software development community under the terms and conditions of this license.
-
-It is not the purpose of this license to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this license 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.
-
-
-Please read this license carefully and completely before downloading this software. By downloading, using, modifying, distributing and sublicensing this software, you indicate your acceptance to be bound by the terms and conditions of this license. If you do not want to accept or cannot accept for any reasons the terms and conditions of this license, please do not download or use in any manner this software.
-
-### 1. Definitions
-
-Unless there is something in the subject matter or in the context inconsistent therewith, the capitalized terms used in this License shall have the following meaning.
-
-"Applicable Intellectual Property Rights" means (a) with respect to the Initial Developer, any rights under patents or patents applications or other intellectual property rights that are now or hereafter acquired, owned by or assigned to the Initial Developer and that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce, modify, distribute or sublicense the Original Code without infringement; and (b) with respect to You or any Contributor, any rights under patents or patents applications or other intellectual property rights that are now or hereafter acquired, owned by or assigned to You or to such Contributor and that cover subject matter contained in Your Modifications or in such Contributor's Modifications, taken alone or in combination with Original Code.
-
-"Contributor" means each individual or legal entity that creates or contributes to the creation of any Modification, including the Initial Developer.
-
-"Derivative Program": means a new program combining the Software or portions thereof with other source code not governed by the terms of this License.
-
-"Initial Developer": means Open CASCADE S.A.S., with main offices at 1, place des Frères Montgolfier, 78280 Guyancourt, France.
-
-"Modifications": mean any addition to, deletion from or change to the substance or the structure of the Software. When source code of the Software is released as a series of files, a Modification is: (a) any addition to, deletion from or change to the contents of a file containing the Software or (b) any new file or other representation of computer program statements that contains any part of the Software. By way of example, Modifications include any debug of, or improvement to, the Original Code or any of its components or portions as well as its next versions or releases thereof.
-
-"Original Code": means (a) the source code of the software Open CASCADE Technology originally made available by the Initial Developer under this License, including the source code of any updates or upgrades of the Original Code and (b) the object code compiled from such source code and originally made available by Initial Developer under this License.
-
-"Software": means the Original Code, the Modifications, the combination of Original Code and any Modifications or any respective portions thereof.
-
-"You" or "Your": means an individual or a legal entity exercising rights under this License.
-
-
-### 2. Acceptance of license
-
-By using, reproducing, modifying, distributing or sublicensing the Software or any portion thereof, You expressly indicate Your acceptance of the terms and conditions of this License and undertake to act in accordance with all the provisions of this License applicable to You.
-
-
-### 3. Scope and purpose
-
-This License applies to the Software and You may not use, reproduce, modify, distribute, sublicense or circulate the Software, or any portion thereof, except as expressly provided under this License. Any attempt to otherwise use, reproduce, modify, distribute or sublicense the Software is void and will automatically terminate Your rights under this License.
-
-
-### 4. Contributor license
-
-Subject to the terms and conditions of this License, the Initial Developer and each of the Contributors hereby grant You a world-wide, royalty-free, irrevocable and non-exclusive license under the Applicable Intellectual Property Rights they own or control, to use, reproduce, modify, distribute and sublicense the Software provided that:
-
-You reproduce in all copies of the Software the copyright and other proprietary notices and disclaimers of the Initial Developer as they appear in the Original Code and attached hereto as Schedule "A" and any other notices or disclaimers attached to the Software and keep intact all notices in the Original Code that refer to this License and to the absence of any warranty;
-You include a copy of this License with every copy of the Software You distribute;
-If you distribute or sublicense the Software (as modified by You or on Your behalf as the case may be), You cause such Software to be licensed as a whole, at no charge, to all third parties, under the terms and conditions of the License, making in particular available to all third parties the source code of the Software;
-You document all Your Modifications, indicate the date of each such Modifications, designate the version of the Software You used, prominently include a file carrying such information with respect to the Modifications and duplicate the copyright and other proprietary notices and disclaimers attached hereto as Schedule "B" or any other notices or disclaimers attached to the Software with your Modifications.
-
-For greater certainty, it is expressly understood that You may freely create Derivative Programs (without any obligation to publish such Derivative Program) and distribute same as a single product. In such case, You must ensure that all the requirements of this License are fulfilled for the Software or any portion thereof.
-
-
-### 5. Your license
-
-You hereby grant all Contributors and anyone who becomes a party under this License a world-wide, non-exclusive, royalty-free and irrevocable license under the Applicable Intellectual Property Rights owned or controlled by You, to use, reproduce, modify, distribute and sublicense all Your Modifications under the terms and conditions of this License.
-
-
-### 6. Software subject to license
-
-Your Modifications shall be governed by the terms and conditions of this License. You are not authorized to impose any other terms or conditions than those prevailing under this License when You distribute and/or sublicense the Software, save and except as permitted under Section 7 hereof.
-
-
-### 7. Additional terms
-
-You may choose to offer, on a non-exclusive basis, and to charge a fee for any warranty, support, maintenance, liability obligations or other rights consistent with the scope of this License with respect to the Software (the "Additional Terms") to the recipients of the Software. However, You may do so only on Your own behalf and on Your sole and exclusive responsibility. You must obtain the recipient's agreement that any such Additional Terms are offered by You alone, and You hereby agree to indemnify, defend and hold the Initial Developer and any Contributor harmless for any liability incurred by or claims asserted against the Initial Developer or any Contributors with respect to any such Additional Terms.
-
-
-### 8. Disclaimer of warranty
-
-The Software is provided under this License on an "as is" basis, without warranty of any kind, including without limitation, warranties that the Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Software is with You.
-
-
-### 9. Liability
-
-Under no circumstances shall You, the Initial Developer or any Contributor be liable to any person for any direct or indirect damages of any kind including, without limitation, damages for loss of goodwill, loss of data, work stoppage, computer failure or malfunction or any and all other commercial damages or losses resulting from or relating to this License or indirectly to the use of the Software.
-
-
-### 10. Trademark
-
-This License does not grant any rights to use the trademarks, trade names and domain names "MATRA", "EADS Matra Datavision", "CAS.CADE", "Open CASCADE", "opencascade.com" and "opencascade.org" or any other trademarks, trade names or domain names used or owned by the Initial Developer.
-
-
-### 11. Copyright
-
-The Initial Developer retains all rights, title and interest in and to the Original Code. You may not remove the copyright (c) notice which appears when You download the Software.
-
-
-### 12. Term
-
-This License is granted to You for a term equal to the remaining period of protection covered by the intellectual property rights applicable to the Original Code.
-
-
-### 13. Termination
-
-In case of termination, as provided in Section 3 above, You agree to immediately stop any further use, reproduction, modification, distribution and sublicensing of the Software and to destroy all copies of the Software that are in Your possession or control. All sublicenses of the Software which have been properly granted prior to termination shall survive any termination of this License. In addition, Sections 5, 8 to 11, 13.2 and 15.2 of this License, in reason of their nature, shall survive the termination of this License for a period of fifteen (15) years.
-
-
-### 14. Versions of the license
-
-The Initial Developer may publish new versions of this License from time to time. Once Original Code has been published under a particular version of this License, You may choose to continue to use it under the terms and conditions of that version or use the Original Code under the terms of any subsequent version of this License published by the Initial Developer.
-
-
-### 15. Miscellaneous
-
-#### 15.1 Relationship of Parties
-
-This License will not be construed as creating an agency, partnership, joint venture or any other form of legal association between You and the Initial Developer, and You will not represent to the contrary, whether expressly, by implication or otherwise.
-
-#### 15.2 Independent Development
-
-Nothing in this License will impair the Initial Developer's right to acquire, license, develop, have others develop for it, market or distribute technology or products that perform the same or similar functions as, or otherwise compete with, Modifications, Derivative Programs, technology or products that You may develop, produce, market or distribute.
-
-#### 15.3 Severability
-
-If for any reason a court of competent jurisdiction finds any provision of this License, or portion thereof, to be unenforceable, that provision of the License will be enforced to the maximum extent permissible so as to effect the economic benefits and intent of the parties, and the remainder of this License will continue in full force and extent.
-
-
-@htmlonly<center>@endhtmlonly
-#### END OF THE TERMS AND CONDITIONS OF THIS LICENSE
-
-Open CASCADE S.A.S. is a French société par actions simplifiée having its main offices at 1, place in Frères Montgolfier, 78280 Guyancourt, France. Its web site is located at the following address http://www.opencascade.com
-
-
-#### Open CASCADE Technology Public License
-
-#### Schedule "A"
-
-The content of this file is subject to the Open CASCADE Technology Public License Version 6.5 (the "License").
-You may not use the content of this file except in compliance with the License.
-Please obtain a copy of the License at http://www.opencascade.org and read it completely before using this file. The Initial Developer of the Original Code is Open CASCADE S.A.S., with main offices at 1, place des Frères Montgolfier, 78280 Guyancourt, France. The Original Code is copyright (c) Open CASCADE S.A.S., 2001. All rights reserved.
-
-"The Original Code and all software distributed under the License are distributed on an "AS IS" basis, without warranty of any kind, and the Initial Developer hereby disclaims all such warranties, including without limitation, any warranties of merchantability, fitness for a particular purpose or non-infringement.
-
-Please see the License for the specific terms and conditions governing rights and limitations under the License".
-
-#### End of Schedule "A"
-
-
-#### Open CASCADE Technology Public License
-
-#### Schedule "B"
-
-"The content of this file is subject to the Open CASCADE Technology Public License Version 6.5 (the "License"). You may not use the content of this file except in compliance with the License. Please obtain a copy of the License at http://www.opencascade.org and read it completely before using this file. The Initial Developer of the Original Code is Open CASCADE S.A.S., with main offices at 1, place des Frères Montgolfier, 78280 Guyancourt, France. The Original Code is copyright (c) Open CASCADE S.A.S., 2001. All rights reserved.
-
-Modifications to the Original Code have been made by ________________________. Modifications are copyright (c) [Year to be included]. All rights reserved.
-
-The software Open CASCADE Technology and all software distributed under the License are distributed on an "AS IS" basis, without warranty of any kind, and the Initial Developer hereby disclaims all such warranties, including without limitation, any warranties of merchantability, fitness for a particular purpose or non-infringement. Please see the License for the specific terms and conditions governing rights and limitations under the License".
-
-#### End of Schedule "B"
-
-@htmlonly</center>@endhtmlonly
\ No newline at end of file
Overview {#mainpage}
========
-@section OCCT_OVW_SECTION_1 Welcome
-
-Welcome to Open CASCADE Technology version 6.7.0, a minor release,
-which introduces a number of new features and improved traditional
-functionality along with some changes over the previous release 6.6.0.
-
-This release makes Open CASCADE Technology even a more powerful and stable
-development platform for 3D modeling and numerical simulation applications.
-
-Open CASCADE Technology 6.7.0 is a full-featured package that allows developing
-applications on Windows and Linux platforms.
-
-@htmlonly<center>@endhtmlonly http://www.opencascade.org
+@tableofcontents
-@image html /overview/images/overview_occttransparent.png
-@image latex /overview/images/overview_occttransparent.png
+@section OCCT_OVW_SECTION_1 Welcome
-Copyright (c) 2001-2013 OPEN CASCADE S.A.S.
+Welcome to Open CASCADE Technology (OCCT), a collection
+of C++ libraries providing services for 3D surface and solid modeling, CAD data
+exchange, and visualization. OCCT can be best applied in development of
+software dealing with 3D modeling (CAD), manufacturing / measuring (CAM) or
+numerical simulation (CAE).
+@htmlonly<center>@endhtmlonly
+http://www.opencascade.org
@image html /resources/occt_logo.png
@image latex /resources/occt_logo.png
-
@htmlonly</center>@endhtmlonly
@section OCCT_OVW_SECTION_2 Copyrights
Copyright(c) 2001-2013 by OPEN CASCADE S.A.S. All rights reserved.
+@htmlonly<center>@endhtmlonly
+http://www.opencascade.com
+@image html /resources/occ_logo.png
+@image latex /resources/occ_logo.png
+@htmlonly</center>@endhtmlonly
+
Trademark information
----------------------
CAS.CADE and Open CASCADE are registered trademarks of OPEN CASCADE S.A.S.
- Acknowledgement
+ Acknowledgements
------------------
The following parties are acknowledged for producing tools which are used within
**Qt** is a cross-platform application framework that is widely used for developing application software
with graphical user interface (GUI). Qt is free and open source software distributed under
the terms of the GNU Lesser General Public License. In OCCT Qt is used for programming samples.
-If you need further information on Qt, please, refer to Qt Homepage (qt.digia.com).
+If you need further information on Qt, please, refer to Qt Homepage (http://qt.digia.com).
**Tcl** is a high-level programming language. Tk is a graphical user interface (GUI) toolkit,
with buttons, menus, listboxes, scrollbars, and so on. Taken together Tcl and Tk provide a solution
(autoconf, automake and libtool) in Open CASCADE Technology version 4.0.
These scripts are now maintained by the OPEN CASCADE company.
-**GL2PS** is developed by Christophe Geuzaine and others. It is OpenGL to PostScript printing library.
+**GL2PS** is developed by Christophe Geuzaine and others. It is optionally used by OCCT to
+export content of OpenGL scene to vector graphics formats (PS, PDF, EMF, SVG).
The library is licensed under GL2PS LICENSE http://www.geuz.org/gl2ps/COPYING.GL2PS Version 2, November 2003.
**FreeType 2** is developed by Antoine Leca, David Turner, Werner Lemberg and others.
abstracts platform details and threading mechanisms for scalability and performance.
TBB is available under GPLv2 license with the runtime exception.
-Open CASCADE Technology WOK module on Windows also makes use of LGPL-licensed C routines * regexp and getopt, taken from GNU C library.
+Open CASCADE Technology WOK module on Windows also makes use of LGPL-licensed C routines **regexp**
+and **getopt**, taken from GNU C library.
-**Doxygen** (Copyright (c) 1997-2010 by Dimitri van Heesch) is open source documentation system for
+**Doxygen** developed by Dimitri van Heesch is open source documentation system for
C++, C, Java, Objective-C, Python, IDL, PHP and C#. This product is used in Open CASCADE Technology
for automatic creation of Technical Documentation from C++ header files.
If you need further information on Doxygen, please refer to http://www.stack.nl/~dimitri/doxygen/index.html.
Graph visualization is representiation of structured information as diagrams of abstract graphs and networks.
This product is used together with Doxygen in Open CASCADE Technology for automatic creation of Technical Documentation
(generation of dependency graphs). Current versions of Graphviz are licensed on an open source
-basis only under The Eclipse Public License (EPL) (http://www.graphviz.org/License.php).
+basis under The Eclipse Public License (EPL) (http://www.graphviz.org/License.php).
**Inno Setup** is a free script-driven installation system created in CodeGear Delphi by Jordan Russell.
In OCCT Inno Setup is used to create Installation Wizard on Windows.
It is licensed under Inno Setup License (http://www.jrsoftware.org/files/is/license.txt).
-**FreeImage** is an Open Source library supporting popular graphics image formats, such as PNG, BMP, JPEG, TIFF
+**FreeImage** is an Open Source library supporting popular graphics image formats, such as PNG, BMP, JPEG, TIFF,
and others used by multimedia applications. This library is developed by Hervé Drolon and Floris van den Berg.
FreeImage is easy to use, fast, multithreading safe, compatible with all 32-bit or 64-bit versions of Windows,
-and cross-platform (works both with Linux and Mac OS X). FreeImage is licensed under the
-GNU General Public License, version 2.0 (GPLv2) and
-the FreeImage Public License (FIPL) (http://freeimage.sourceforge.net/freeimage-license.txt).
+and cross-platform (works both with Linux and Mac OS X). FreeImage is optionally used by OCCT to work
+with images, on conditions of the FreeImage Public License (FIPL) (http://freeimage.sourceforge.net/freeimage-license.txt).
-Adobe Systems, Inc. provides **Adobe Acrobat Professional**, which is a software to view, create, manipulate,
-print and manage files in Portable Document Format (PDF).
-This product is used in OCCT for the development and update of User's Guides.
+**MikTEX** is up-to-date implementation of TeX/LaTeX and related programs for Windows. It is used
+for generation of User and Developer Guides in PDF format. See http://miktex.org for information
+on this tool.
-The same developer provides **Robohelp HTML** that allows developing online Help for applications that are run on the Web and on Intranets.
-**Robohelp HTML X5.0.2** is used in OCCT for the development and update of OCCT Overview.
+Adobe Systems, Inc. provides **Adobe Reader**, which can be used to view files in Portable Document Format (PDF).
**Linux** is a registered trademark of Linus Torvalds.
**Mac** and the Mac logo are trademarks of Apple Inc., registered in the U.S. and other countries.
+@section OCCT_OVW_SECTION_3 Documentation
-@section OCCT_OVW_SECTION_3 Introduction
+OCCT documentation is provided in several forms:
+- This overview provides general description of OCCT structure, functionality, modules, and features.
+ It is available in HTML format (generated by Doxygen) and includes User and Developer Guides.
+ The sources of this documentation are contained in **dox** subdirectory of OCCT sources
+ (plain text format is used, with mixed MarkDown / Doxygen syntax mark-up).
-This document is just an introduction to Open CASCADE Technology (OCCT) dealing with
-compatibility and installation issues and providing a general description of OCCT modules
-and other features. All modules and development tools are described in User's Guides, available in
-Adobe Portable Document Format (PDF). To read this format, you need Adobe Acrobat Reader,
-which is a freeware and can be downloaded from the Adobe site.
-All user guides can be accessed directly from this help.
+- User and Developer Guides describing in details OCCT modules and development tools are also available in
+ Adobe Portable Document Format (PDF). To read this format, you need Adobe Acrobat Reader,
+ which is a freeware and can be downloaded from the Adobe site.
-Alongside with PDF User Guides, OCCT suggests its users full reference documentation on all
-implementation classes automatically generated by Doxygen software.
-This Doxygen generated documentation is supplied in the form of a separate package,
-in a usual html file format.
+- Full reference documentation covering all OCCT classes generated automatically by Doxygen
+ software is provided in HTML format, in a separate package.
+ Reference documentation is presented in **Modules --> Toolkits --> Packages --> Classes**
+ logic structure with cross-references to all OCCT classes and complete in-browser search by all classes.
-Reference documentation is presented in **Modules --> Toolkits --> Packages --> Classes**
-logic structure with cross-references to all OCCT classes and complete in-browser search by all classes.
+See @ref dev_guides__documentation "OCCT Documentation Guide" for details on OCCT documentation system.
-**Recommendation for generation of reference documentation**
+**Generation of HTML documentation**
-Reference documentation can be generated by OCCT binary WOK package that
-is available for downloading from www.opencascade.org and dev.opencascade.org sites.
+To generate HTML documentation from sources contained in *dox* subdirectory,
+you need to have Tcl and Doxygen 1.8.4 (or above) installed on your system.
+
+In Tcl prompt, cd to OCCT root folder and run
+
+ tclsh> source dox/start.tcl
+
+On Windows you can also run batch script **gendoc.bat**.
+
+
+**Generation of reference documentation**
+
+Reference documentation can be generated with help of WOK tool that
+is available for download from www.opencascade.org and dev.opencascade.org sites.
Prerequisites:
- * Doxygen version 1.7.4 or higher
+ * Doxygen version 1.8.4 or higher
* Graphviz version 2.28.0 or higher
Run WOK (cd \<WOK_INSTALL_DIR\>/site folder):
In the WOK prompt, step into your workbench:
- >wokcd <your workbench>
+ > wokcd <your workbench>
In your workbench, use **wgendoc** command with –h argument to get information about arguments of **wgendoc** command:
- >wgendoc -h
+ > wgendoc -h
-then run **wgendoc** command with required arguments
+then run **wgendoc** command with required arguments, for instance:
-e.g., wgendoc –output=d:/occt/doc {–m=Draw Visualization} -chm
+ > wgendoc -output=d:/occt/doc {-m=Draw Visualization}
@section OCCT_OVW_SECTION_5 Requirements
<tr> <td> Minimum memory </td> <td> 512 Mb, 1 Gb recommended </td > </tr>
<tr> <td> Free disk space (complete installation) </td> <td> For full installation Open CASCADE Technology requires 600 Mb of disk space. </td > </tr>
<tr> <td>Minimum swap space </td> <td> 500 Mb </td > </tr>
-<tr> <td> Video card </td> <td> **GeForce** The following versions of GeForce drivers are recommended: 64-bit Version: 100.14.19 or later http://www.nvidia.com/object/linux_display_amd64_100.14.19.html 32-bit Version: 100.14.19 or later http://www.nvidia.com/object/linux_display_ia32_100.14.19.html </td > </tr>
-<tr> <td> Graphic library </td> <td> OpenGL 1.1+ (OpenGL 1.5+ is recommended) </td > </tr>
+<tr> <td> Video card </td> <td> **GeForce** The following versions of GeForce drivers are recommended:
+- 64-bit Version: 100.14.19 or later http://www.nvidia.com/object/linux_display_amd64_100.14.19.html
+- 32-bit Version: 100.14.19 or later http://www.nvidia.com/object/linux_display_ia32_100.14.19.html </td > </tr>
+<tr> <td> Graphic library </td> <td> OpenGL 1.1+ (OpenGL 2.1+ is recommended) <br> OpenCL 1.1+ (optional for ray tracing) </td > </tr>
<tr> <td>C++ </td> <td>GNU gcc 4.0. - 4.7.3. </td > </tr>
<tr> <td> TCL (for testing tools) </td> <td> Tcltk 8.5 or 8.6 http://www.tcl.tk/software/tcltk/8.6.html</td > </tr>
<tr> <td> Qt (for demonstration tools) </td> <td> Qt 4.6.2 http://qt.nokia.com/downloads </td > </tr>
<tr> <td>Minimum swap space </td> <td> 500 Mb </td > </tr>
<tr> <td> Video card </td> <td> **GeForce** Version 266.58 WHQL or later is recommended: http://www.nvidia.com/Download/index.aspx
</td > </tr>
-<tr> <td> Graphic library </td> <td> OpenGL 1.1+ (OpenGL 1.5+ is recommended) </td > </tr>
-<tr> <td>C++ </td> <td>Microsoft Visual Studio .NET 2005 SP1 with all security updates
-Microsoft Visual Studio .NET 2008 SP1*
-Microsoft Visual Studio .NET 2010
-Microsoft Visual Studio .NET 2012
-Microsoft Visual Studio .NET 2013
+<tr> <td> Graphic library </td> <td> OpenGL 1.1+ (OpenGL 2.1+ is recommended) <br> OpenCL 1.1+ (optional for ray tracing) </td > </tr>
+<tr> <td>C++ </td> <td>
+- Microsoft Visual Studio 2005 SP1 with all security updates
+- Microsoft Visual Studio 2008 SP1*
+- Microsoft Visual Studio 2010 SP1
+- Microsoft Visual Studio 2012 Update 3
+- Microsoft Visual Studio 2013
+- Intel C++ Composer XE 2013 SP1
</td > </tr>
-<tr> <td> TCL (for testing tools) </td> <td> TActiveTcl 8.5 or 8.6
-http://www.activestate.com/activetcl/downloads </td > </tr>
+<tr> <td> TCL (for testing tools) </td> <td> ActiveTcl 8.5 or 8.6 http://www.activestate.com/activetcl/downloads </td > </tr>
<tr> <td> Qt (for demonstration tools) </td> <td> Qt 4.6.2 http://qt.digia.com/downloads </td > </tr>
<tr> <td> Freetype (OCCT Text rendering) </td> <td> freetype-2.4.11 http://sourceforge.net/projects/freetype/files/ </td > </tr>
<tr> <td> FreeImage (Support of common graphic formats )</td> <td>FreeImage 3.15.4 http://sourceforge.net/projects/freeimage/files/Source%20Distribution/ </td > </tr>
@subsection OCCT_OVW_SECTION_5_3 MAC OS X
<table>
-<tr> <th>Operating System </th> <th> Mac OS X 10.6.8 Snow Leopard / 10.7 Lion </th> </tr>
+<tr> <th>Operating System </th> <th> 64-bit: Mac OS X 10.9 Mavericks / 10.8 Mountain Lion / 10.7 Lion / 10.6.8 Snow Leopard </th> </tr>
<tr> <td> Minimum memory </td> <td> 512 Mb, 1 Gb recommended </td > </tr>
<tr> <td> Free disk space (complete installation) </td> <td> For full installation Open CASCADE Technology requires 600 Mb of disk space. </td > </tr>
<tr> <td>Minimum swap space </td> <td> 500 Mb </td > </tr>
<tr> <td> Video card </td> <td> **GeForce** Version 266.58 WHQL or later is recommended: http://www.nvidia.com/Download/index.aspx
</td > </tr>
-<tr> <td> Graphic library </td> <td> OpenGL 1.1+ (OpenGL 1.5+ is recommended) </td > </tr>
+<tr> <td> Graphic library </td> <td> OpenGL 1.1+ (OpenGL 2.1+ is recommended) <br> OpenCL 1.1+ (optional for ray tracing) </td > </tr>
<tr> <td>C++ </td> <td>XCode 3.2 or newer (4.x is recommended) </td > </tr>
<tr> <td> Qt (for demonstration tools) </td> <td> Qt 4.6.2 http://qt.digia.com/downloads </td > </tr>
<tr> <td> Freetype (OCCT Text rendering) </td> <td> freetype-2.4.11 http://sourceforge.net/projects/freetype/files/ </td > </tr>
@section OCCT_OVW_SECTION_4 Installation
-Open CASCADE Technology can be installed with binaries precompiled by
-Visual C++ 2008 using Installation Procedure under Windows platform only
+In most cases you need to rebuild OCCT on your platform (OS, compiler) before
+using it in your project, to ensure binary compatibility.
+See @ref dev_guides__building for instructions on
+building OCCT from sources on supported platforms.
-The source package and the building tools are available for self-dependent
-preparation binary files on Unix and Windows platforms.
+@subsection OCCT_OVW_SECTION_4_1 Using Windows installer
-@subsection OCCT_OVW_SECTION_4_1 Windows
+On Windows Open CASCADE Technology can be installed with binaries precompiled by
+Visual C++ 2008 with installation procedure.
**Recommendation:**
* Download the OCCT installer from OPEN CASCADE web site using the link. you have been provided
* Launch the installer and follow the instructions.
-### Third-party tools
-
-
The includes and binaries of third-party libraries necessary for building and launching
OCCT are included into binary distribution (built with Visual C++ 2008).
-To recompile OCCT libraries with other Visual C++ versions,
-it is necessary to install headers and libraries of these third-party products.
-
-The recommended way to do this is to download each of the third-party tools from its web site
-and build it using the relevant tools. For additional convenience of the users,
-OPEN CASCADE also provides the documents with recommendations on building
-third-party products from source files.
+When the installation is complete, you will find the directories for 3rd party products
+(some might be absent in case of custom installation) and the main **OCCT** directory:
+@image html /overview/images/overview_3rdparty.png
+@image latex /overview/images/overview_3rdparty.png
-
-When the installation is complete, you will find the following directories
-(some might be absent in case of custom installation):
+The contents of the OCCT-6.7.0 directory (called further "OCCT root", or $CASROOT) are as follows:
@image html /overview/images/overview_installation.png "The directory tree"
@image latex /overview/images/overview_installation.png "The directory tree"
-
-
* **adm** This folder contains administration files, which allow rebuilding OCCT;
* **adm/cmake** This folder contains files of CMake building procedure;
* **adm/msvc** This folder contains Visual Studio projects for Visual C++ 2005, 2008 and 2010, which allow rebuilding OCCT under Windows platform in 32 and 64-bit mode;
- * **data** This folder contains CAD files in different formats, which can be used to test the OCCT functionalities;
- * **doc** This folder contains OCCT Overview documentation;
+ * **data** This folder contains CAD files in different formats, which can be used to test the OCCT functionality;
+ * **doc** This folder contains OCCT documentation in HTML and PDF format;
+ * **dox** This folder contains sources of OCCT documentation in plain text (MarkDown) format;
* **drv** This folder contains source files generated by WOK (private header files and instantiations of generic classes);
* **inc** This folder contains all OCCT header files;
* **samples** This folder contains sample applications.
* **tests** This folder contains scripts for OCCT testing.
* **win32/vc9** This folder contains executable and library files built in optimize mode for Windows platform by Visual C++ 2008;
-3rd party products have been moved to the root of Open CASCADE installation.
-
-@image html /overview/images/overview_3rdparty.png "The third-party products"
-@image latex /overview/images/overview_3rdparty.png "The third-party products"
-
-
-@subsection OCCT_OVW_SECTION_4_2 System Environment Variables
+@section OCCT_OVW_SECTION_4_2 Environment Variables
To run any Open CASCADE Technology application you need to set the environment variables.
### On Windows
-
You can define the environment variables with env.bat script located in the
-OpenCACADE<version_number>/ros folder. This script accepts two arguments to be used:
-the version of Visual Studio (vc8, vc9, or vc10) and the architecture (win32 or win64).
+$CASROOT folder. This script accepts two arguments to be used:
+the version of Visual Studio (vc8 - vc12) and the architecture (win32 or win64).
The additional environment settings necessary for compiling OCCT libraries and samples
by Microsoft Visual Studio can be set using script custom.bat located in the same folder.
If OCCT was built by Automake, you can define the environment variables with env_amk.sh or custom_amk.sh script.
-The scripts are located in the OpenCACADE<version_number>/ros folder of the source package.
+The scripts are located in the OCCT root folder.
### Description of system variables:
* **CASROOT** is used to define the root directory of Open CASCADE Technology;
* **PATH** is required to define the path to OCCT binaries and 3rdparty folder;
* **LD_LIBRARY_PATH** is required to define the path to OCCT libraries (on UNIX platforms only);
- * **MMGT_OPT** if set to 1, the memory manager performs optimizations as described below; if set to 2,
- Intel (R) TBB optimized memory manager is used; if 0 (default), every memory block is allocated
- in C memory heap directly (via malloc() and free() functions).
- In the latter case, all other options except MMGT_CLEAR and MMGT_REENTRANT are ignored;
- * **MMGT_CLEAR** if set to 1 (default), every allocated memory block is cleared by zeros;
- if set to 0, memory block is returned as it is;
- * **MMGT_CELLSIZE** defines the maximal size of blocks allocated in large pools of memory. Default is 200;
- * **MMGT_NBPAGES** defines the size of memory chunks allocated for small blocks in pages
- (operating-system dependent). Default is 10000;
- * **MMGT_THRESHOLD** defines the maximal size of blocks that are recycled internally
- instead of being returned to the heap. Default is 40000;
- * **MMGT_MMAP** when set to 1 (default), large memory blocks are allocated using
- memory mapping functions of the operating system; if set to 0,
- they will be allocated in the C heap by malloc();
- * **MMGT_REENTRANT** when set to 1 (default), all calls to the
- optimized memory manager will be secured against possible simultaneous access from different execution threads.
-
-This variable should be set in any multithreaded application that uses
-an optimized memory manager (MMGT_OPT=1) and has more than one thread
-potentially calling OCCT functions. If set to 0, OCCT memory management and
-exception handling routines will skip the code protecting from possible concurrency
-in multi-threaded environment. This can yield some performance gain in some applications,
-but can lead to unpredictable results if used in a multithreaded application;
-
-**Special note:** for applications that use OCCT memory manager from more than one thread,
-on multiprocessor hardware, it is recommended to use options MMGT_OPT=2 and MMGT_REENTRANT=1.
-
+ * **MMGT_OPT** (optional) if set to 1, the memory manager performs optimizations as described below; if set to 2,
+ Intel (R) TBB optimized memory manager is used; if 0 (default), every memory block is allocated
+ in C memory heap directly (via malloc() and free() functions).
+ In the latter case, all other options except MMGT_CLEAR and MMGT_REENTRANT are ignored;
+ * **MMGT_CLEAR** (optional) if set to 1 (default), every allocated memory block is cleared by zeros;
+ if set to 0, memory block is returned as it is;
+ * **MMGT_CELLSIZE** (optional) defines the maximal size of blocks allocated in large pools of memory. Default is 200;
+ * **MMGT_NBPAGES** (optional) defines the size of memory chunks allocated for small blocks in pages
+ (operating-system dependent). Default is 10000;
+ * **MMGT_THRESHOLD** (optional) defines the maximal size of blocks that are recycled internally
+ instead of being returned to the heap. Default is 40000;
+ * **MMGT_MMAP** (optional) when set to 1 (default), large memory blocks are allocated using
+ memory mapping functions of the operating system; if set to 0,
+ they will be allocated in the C heap by malloc();
* **CSF_LANGUAGE** is required to define the default language of messages;
- * **CSF_EXCEPTION_PROMPT** – if defined and set to 1 then a diagnostic message is displayed in case of an exception;
- * **CSF_MDTVFontDirectory** accesses the fonts that can be used in OCCT;
+ * **CSF_DEBUG** (optional, Windows only): if defined then a diagnostic message is displayed in case of an exception;
+ * **CSF_DEBUG_BOP** (optional): if defined then it should specify directovy where diagnostic data on problems occured in Boolean operations will be saved;
* **CSF_MDTVTexturesDirectory** defines the directory for available textures when using texture mapping;
- * **CSF_UnitsDefinition** and **CSF_UnitsLexicon** are required by programs considering units;
+ * **CSF_UnitsDefinition** and **CSF_UnitsLexicon** should define paths to resource files Lexi_Expr.dat and Units.dat, respectively, required for support of measurement units;
* **CSF_SHMessage** is required in order to define the path to the messages file for *ShapeHealing*;
* **CSF_XSMessage** is required in order to define the path to the messages file for **STEP** and **IGES** translators;
- * **CSF_StandardDefaults** and **CSF_PluginDefaults** are required in order to maintain CASCADE Persistence mechanism to make possible any open/save operations with OCAF documents;
+ * **CSF_StandardDefaults** and **CSF_PluginDefaults** are required in order to maintain CASCADE Persistence mechanism to make possible any open/save operations with OCAF documents;
* **CSF_StandardLiteDefaults** is required in order to maintain *OCCT Persistence mechanism* to make possible any open/save operations with Lite OCAF documents;
* **CSF_XCAFDefaults** any open/save operations for **XDE** documents;
- * **CSF_GraphicShr** is required to define the path to the *TKOpenGl* library;
* **CSF_IGESDefaults** and **CSF_STEPDefaults** are required for **IGES** and **STEP** translators correspondingly in order to define the path to the resource files;
* **CSF_XmlOcafResource** is required in order to set the path to **XSD** resources, which defines XML grammar.
-
-As part of XML persistence support, these definitions can be used by end users
-in XML validators or editors, together with persistent XmlOcaf documents;
-
-* **CSF_MIGRATION_TYPES** is required in order to read documents that contain old data types, such as *TDataStd_Shape*;
-* **TCLLIBPATH**, **TCL_LIBRARY**, **TK_LIBRARY** and **TIX_LIBRARY** are required to allow work with **DRAW** and **WOK**.
-
-@section OCCT_OVW_SECTION_6 Release Notes
-
-
-Open CASCADE Technology latest version
-@htmlonly
-<a href="http://occtrel.nnov.opencascade.com/OpenCASCADE6.7.0/doc/release_notes.pdf">Release Notes</a>
-@endhtmlonly (PDF)
-
+ * **CSF_MIGRATION_TYPES** is required in order to read documents that contain old data types, such as *TDataStd_Shape*;
+ * **TCLLIBPATH**, **TCL_LIBRARY**, **TK_LIBRARY** and **TIX_LIBRARY** are required to allow work with **DRAW** and **WOK**.
@section OCCT_OVW_SECTION_7 Getting Started
-
@subsection OCCT_OVW_SECTION_7_1 Draw Test Harness
Draw is a command interpreter based on TCL and a graphical system used for testing and demonstrating OCCT modeling libraries.
the specified resource file and activates the commands implemented in the plug-in.
The whole process of using the plug-in mechanism as well as the instructions for extending Test Harness is described in the
-@htmlonly
-<a href="http://occtrel.nnov.opencascade.com/OpenCASCADE6.6.0/doc/OCCT_Tests.pdf">User's Guide/</a>
-@endhtmlonly
+@ref user_guides__test_harness.
-Draw Test Harness provides an environment for OCCT automated testing system. Please, consult its
-@htmlonly
-<a href="http://occtrel.nnov.opencascade.com/OpenCASCADE6.6.0/doc/OCCT_Tests.pdf">User's Guide /</a>
-@endhtmlonly
-for details.
+Draw Test Harness provides an environment for OCCT automated testing system.
+Please, consult its @ref dev_guides__tests "Automated Testing System" for details.
Remarks:
* The DRAWEXE executable is delivered with the installation procedure on Windows platform only.
-* To start it, launch DRAWEXE executable from Open CASCADE Technology//Draw Test Harness item of the Start\\Programs menu.
+* To start it, launch DRAWEXE executable from Open CASCADE Technology/Draw Test Harness item of the Start\\Programs menu.
@subsection OCCT_OVW_SECTION_7_2 Experimenting with Draw Test Harness
**Running demonstration files**
-1. Type cd ..//.. to return to the root directory
-2. Type cd src//DrawResources to reach the DrawResources directory
+1. Type cd ../.. to return to the root directory
+2. Type cd src/DrawResources to reach the DrawResources directory
3. Type source "Available Demo File" to run the demonstration provided with Open CASCADE
4. The following demonstration files are available:
* DataExchangeDemo.tcl
Import Export
-------------
- Import Export programming sample contains 3D Viewer and Import // Export functionality.
+ Import Export programming sample contains 3D Viewer and Import / Export functionality.
@image html /overview/images/overview_qt.png
@image latex /overview/images/overview_qt.png
to enhance user's C++ tools with high performance modeling classes, methods and functions.
The combination of these resources allows creating substantial applications.
-**See also:** @subpage overview__tutorial "3D Object Tutorial"
+**See also:** @ref tutorial "OCCT Tutorial"
Voxel
------
It also includes a set of non-regression tests and other commands
for testing this functionality (accessible only through TEST pre-processor definition).
-**See also:**
- @htmlonly
-<a href="http://occtrel.nnov.opencascade.com/OpenCASCADE6.6.0/doc/voxels_wp.pdf">Voxels User's guide (PDF)</a>
-@endhtmlonly
+**See also:** Voxels User's guide (under construction)
**Remarks:**
@subsubsection OCCT_OVW_SECTION_7_3_3 C#
-C# sample containing 3D Viewer and Import // Export functionality.
+C# sample demonstrates integration of OCCT 3D Viewer and Import / Export functionality
+into .NET applications (using Windows Forms and WPF front ends).
@image html /overview/images/overview_c__ie.png
@image latex /overview/images/overview_c__ie.png
* Step
* Stl
* Vrml
-
-**Remarks:**
-
- * C# sample is available only on Windows platform;
- * It is delivered in source code only and must be built with Microsoft Visual C++ 2005.
-
-
-
-
+++ /dev/null
- Tutorial {#overview__tutorial}
-=======
-
-@section sec1 Overview
-
-
-This tutorial will teach you how to use Open CASCADE Technology services to model a 3D object. The purpose of this tutorial is not to describe all Open CASCADE Technology classes but to help you start thinking in terms of Open CASCADE Technology as a tool.
-
-
-@subsection OCCT_TUTORIAL_SUB1_1 Prerequisites
-
-This tutorial assumes that you have experience in using and setting up C++.
-From a programming standpoint, Open CASCADE Technology is designed to enhance your C++ tools with 3D modeling classes, methods and functions. The combination of all these resources will allow you to create substantial applications.
-
-@subsection OCCT_TUTORIAL_SUB1_2 The Model
-
-To illustrate the use of classes provided in the 3D geometric modeling toolkits, you will create a bottle as shown:
-
-@image html /overview/tutorial/images/tutorial_image001.png
-@image latex /overview/tutorial/images/tutorial_image001.png
-
-In the tutorial we will create, step-by-step, a function that will model a bottle as shown above. You will find the complete source code of this tutorial, including the very function *MakeBottle* in the distribution of Open CASCADE Technology. The function body is provided in the file samples/qt/Tutorial/src/MakeBottle.cxx.
-
-@subsection OCCT_TUTORIAL_SUB1_3 Model Specifications
-
-We first define the bottle specifications as follows:
-
-| Object Parameter | Parameter Name | Parameter Value |
-| :--------------: | :------------: | :-------------: |
-| Bottle height | MyHeight | 70mm |
-| Bottle width | MyWidth | 50mm |
-| Bottle thickness | MyThickness | 30mm |
-
-In addition, we decide that the bottle's profile (base) will be centered on the origin of the global Cartesian coordinate system.
-
-@image html /overview/tutorial/images/tutorial_image002.png
-@image latex /overview/tutorial/images/tutorial_image002.png
-
-This modeling requires four steps:
-
- * build the bottle's Profile
- * build the bottle's Body
- * build the Threading on the bottle's neck
- * build the result compound
-
-
-@section sec2 Building the Profile
-
-@subsection OCCT_TUTORIAL_SUB2_1 Defining Support Points
-
-To create the bottle's profile, you first create characteristic points with their coordinates as shown below in the (XOY) plane. These points will be the supports that define the geometry of the profile.
-
-@image html /overview/tutorial/images/tutorial_image003.png
-@image latex /overview/tutorial/images/tutorial_image003.png
-
-There are two classes to describe a 3D Cartesian point from its X, Y and Z coordinates in Open CASCADE Technology:
-
- * the primitive geometric *gp_Pnt* class
- * the transient *Geom_CartesianPoint* class manipulated by handle
-
-A handle is a type of smart pointer that provides automatic memory management.
-To choose the best class for this application, consider the following:
-
- * *gp_Pnt* is manipulated by value. Like all objects of its kind, it will have a limited lifetime.
- * *Geom_CartesianPoint* is manipulated by handle and may have multiple references and a long lifetime.
-
-Since all the points you will define are only used to create the profile's curves, an object with a limited lifetime will do. Choose the *gp_Pnt* class.
-To instantiate a *gp_Pnt* object, just specify the X, Y, and Z coordinates of the points in the global cartesian coordinate system:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- gp_Pnt aPnt1(-myWidth / 2., 0, 0);
- gp_Pnt aPnt2(-myWidth / 2., -myThickness / 4., 0);
- gp_Pnt aPnt3(0, -myThickness / 2., 0);
- gp_Pnt aPnt4(myWidth / 2., -myThickness / 4., 0);
- gp_Pnt aPnt5(myWidth / 2., 0, 0);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Once your objects are instantiated, you can use methods provided by the class to access and modify its data. For example, to get the X coordinate of a point:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-Standard_Real xValue1 = aPnt1.X();
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-@subsection OCCT_TUTORIAL_SUB2_2 Profile: Defining the Geometry
-With the help of the previously defined points, you can compute a part of the bottle's profile geometry. As shown in the figure below, it will consist of two segments and one arc.
-
-@image html /overview/tutorial/images/tutorial_image004.png
-@image latex /overview/tutorial/images/tutorial_image004.png
-
-To create such entities, you need a specific data structure, which implements 3D geometric objects. This can be found in the Geom package of Open CASCADE Technology.
-In Open CASCADE Technology a package is a group of classes providing related functionality. The classes have names that start with the name of a package they belong to. For example, *Geom_Line* and *Geom_Circle* classes belong to the *Geom* package. The *Geom* package implements 3D geometric objects: elementary curves and surfaces are provided as well as more complex ones (such as *Bezier* and *BSpline*).
-However, the *Geom* package provides only the data structure of geometric entities. You can directly instantiate classes belonging to *Geom*, but it is easier to compute elementary curves and surfaces by using the *GC* package.
-This is because the *GC* provides two algorithm classes which are exactly what is required for our profile:
-
- * Class *GC_MakeSegment* to create a segment. One of its constructors allows you to define a segment by two end points P1 and P2
- * Class *GC_MakeArcOfCircle* to create an arc of a circle. A useful constructor creates an arc from two end points P1 and P3 and going through P2.
-
-Both of these classes return a *Geom_TrimmedCurve* manipulated by handle. This entity represents a base curve (line or circle, in our case), limited between two of its parameter values. For example, circle C is parameterized between 0 and 2PI. If you need to create a quarter of a circle, you create a *Geom_TrimmedCurve* on C limited between 0 and M_PI/2.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- Handle(Geom_TrimmedCurve) aArcOfCircle = GC_MakeArcOfCircle(aPnt2,aPnt3,aPnt4);
- Handle(Geom_TrimmedCurve) aSegment1 = GC_MakeSegment(aPnt1, aPnt2);
- Handle(Geom_TrimmedCurve) aSegment2 = GC_MakeSegment(aPnt4, aPnt5);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-All *GC* classes provide a casting method to obtain a result automatically with a function-like call. Note that this method will raise an exception if construction has failed. To handle possible errors more explicitly, you may use the *IsDone* and *Value* methods. For example:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- GC_MakeSegment mkSeg (aPnt1, aPnt2);
- Handle(Geom_TrimmedCurve) aSegment1;
- if(mkSegment.IsDone()){
- aSegment1 = mkSeg.Value();
- }
- else {
- // handle error
- }
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-@subsection OCCT_TUTORIAL_SUB2_3 Profile: Defining the Topology
-
-
-You have created the support geometry of one part of the profile but these curves are independent with no relations between each other.
-To simplify the modeling, it would be right to manipulate these three curves as a single entity.
-This can be done by using the topological data structure of Open CASCADE Technology defined in the *TopoDS* package: it defines relationships between geometric entities which can be linked together to represent complex shapes.
-Each object of the *TopoDS* package, inheriting from the *TopoDS_Shape* class, describes a topological shape as described below:
-
-| Shape | Open CASCADE Technology Class | Description |
-| :-------- | :---------------------------- | :------------------------------------------------------------ |
-| Vertex | TopoDS_Vertex | Zero dimensional shape corresponding to a point in geometry. |
-| Edge | TopoDS_Edge | One-dimensional shape corresponding to a curve and bounded by a vertex at each extremity.|
-| Wire | TopoDS_Wire | Sequence of edges connected by vertices. |
-| Face | TopoDS_Face | Part of a surface bounded by a closed wire(s). |
-| Shell | TopoDS_Shell | Set of faces connected by edges. |
-| Solid | TopoDS_Solid | Part of 3D space bounded by Shells. |
-| CompSolid | TopoDS_CompSolid | Set of solids connected by their faces. |
-| Compound | TopoDS_Compound | Set of any other shapes described above. |
-
-Referring to the previous table, to build the profile, you will create:
-
- * Three edges out of the previously computed curves.
- * One wire with these edges.
-
-@image html /overview/tutorial/images/tutorial_image005.png
-@image latex /overview/tutorial/images/tutorial_image005.png
-
-However, the *TopoDS* package provides only the data structure of the topological entities. Algorithm classes available to compute standard topological objects can be found in the *BRepBuilderAPI* package.
-To create an edge, you use the BRepBuilderAPI_MakeEdge class with the previously computed curves:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- TopoDS_Edge aEdge1 = BRepBuilderAPI_MakeEdge(aSegment1);
- TopoDS_Edge aEdge2 = BRepBuilderAPI_MakeEdge(aArcOfCircle);
- TopoDS_Edge aEdge3 = BRepBuilderAPI_MakeEdge(aSegment2);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-In Open CASCADE Technology, you can create edges in several ways. One possibility is to create an edge directly from two points, in which case the underlying geometry of this edge is a line, bounded by two vertices being automatically computed from the two input points. For example, aEdge1 and aEdge3 could have been computed in a simpler way:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- TopoDS_Edge aEdge1 = BRepBuilderAPI_MakeEdge(aPnt1, aPnt3);
- TopoDS_Edge aEdge2 = BRepBuilderAPI_MakeEdge(aPnt4, aPnt5);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-To connect the edges, you need to create a wire with the *BRepBuilderAPI_MakeWire* class. There are two ways of building a wire with this class:
-
- * directly from one to four edges
- * by adding other wire(s) or edge(s) to an existing wire (this is explained later in this tutorial)
-
-When building a wire from less than four edges, as in the present case, you can use the constructor directly as follows:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(aEdge1, aEdge2, aEdge3);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-@subsection OCCT_TUTORIAL_SUB2_4 Profile: Completing the Profile
-
-
-Once the first part of your wire is created you need to compute the complete profile. A simple way to do this is to:
-
- * compute a new wire by reflecting the existing one.
- * add the reflected wire to the initial one.
-
-@image html /overview/tutorial/images/tutorial_image006.png
-@image latex /overview/tutorial/images/tutorial_image006.png
-
-To apply a transformation on shapes (including wires), you first need to define the properties of a 3D geometric transformation by using the gp_Trsf class. This transformation can be a translation, a rotation, a scale, a reflection, or a combination of these.
-In our case, we need to define a reflection with respect to the X axis of the global coordinate system. An axis, defined with the gp_Ax1 class, is built out of a point and has a direction (3D unitary vector). There are two ways to define this axis.
-The first way is to define it from scratch, using its geometric definition:
-
- * X axis is located at (0, 0, 0) - use the *gp_Pnt* class.
- * X axis direction is (1, 0, 0) - use the *gp_Dir* class. A *gp_Dir* instance is created out of its X, Y and Z coordinates.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- gp_Pnt aOrigin(0, 0, 0);
- gp_Dir xDir(1, 0, 0);
- gp_Ax1 xAxis(aOrigin, xDir);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The second and simplest way is to use the geometric constants defined in the gp package (origin, main directions and axis of the global coordinate system). To get the X axis, just call the *gp::OX* method:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- gp_Ax1 xAxis = gp::OX();
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-As previously explained, the 3D geometric transformation is defined with the *gp_Trsf* class. There are two different ways to use this class:
-
- * by defining a transformation matrix by all its values
- * by using the appropriate methods corresponding to the required transformation (SetTranslation for a translation, SetMirror for a reflection, etc.): the matrix is automatically computed.
-
-Since the simplest approach is always the best one, you should use the SetMirror method with the axis as the center of symmetry.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- gp_Trsf aTrsf;
- aTrsf.SetMirror(xAxis);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You now have all necessary data to apply the transformation with the BRepBuilderAPI_Transform class by specifying:
-
- * the shape on which the transformation must be applied.
- * the geometric transformation
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- BRepBuilderAPI_Transform aBRepTrsf(aWire, aTrsf);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-*BRepBuilderAPI_Transform* does not modify the nature of the shape: the result of the reflected wire remains a wire. But the function-like call or the *BRepBuilderAPI_Transform::Shape* method returns a *TopoDS_Shape* object:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- TopoDS_Shape aMirroredShape = aBRepTrsf.Shape();
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-What you need is a method to consider the resulting reflected shape as a wire. The *TopoDS* global functions provide this kind of service by casting a shape into its real type. To cast the transformed wire, use the *TopoDS::Wire* method.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- TopoDS_Wire aMirroredWire = TopoDS::Wire(aMirroredShape);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The bottle's profile is almost finished. You have created two wires: *aWire* and *aMirroredWire*. You need to concatenate them to compute a single shape. To do this, you use the *BRepBuilderAPI_MakeWire* class as follows:
-
- * create an instance of *BRepBuilderAPI_MakeWire*.
- * add all edges of the two wires by using the *Add* method on this object.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- BRepBuilderAPI_MakeWire mkWire;
- mkWire.Add(aWire);
- mkWire.Add(aMirroredWire);
- TopoDS_Wire myWireProfile = mkWire.Wire();
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-@section sec3 Building the Body
-
-
-@subsection OCCT_TUTORIAL_SUB3_1 Prism the Profile
-
-
-To compute the main body of the bottle, you need to create a solid shape. The simplest way is to use the previously created profile and to sweep it along a direction. The *Prism* functionality of Open CASCADE Technology is the most appropriate for that task. It accepts a shape and a direction as input and generates a new shape according to the following rules:
-
-| Shape | Generates |
-| :----- | :----------------- |
-| Vertex | Edge |
-| Edge | Face |
-| Wire | Shell |
-| Face | Solid |
-| Shell | Compound of Solids |
-
-@image html /overview/tutorial/images/tutorial_image007.png
-@image latex /overview/tutorial/images/tutorial_image007.png
-
-Your current profile is a wire. Referring to the Shape/Generates table, you need to compute a face out of its wire to generate a solid.
-To create a face, use the *BRepBuilderAPI_MakeFace* class. As previously explained, a face is a part of a surface bounded by a closed wire. Generally, *BRepBuilderAPI_MakeFace* computes a face out of a surface and one or more wires.
-When the wire lies on a plane, the surface is automatically computed.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- TopoDS_Face myFaceProfile = BRepBuilderAPI_MakeFace(myWireProfile);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The *BRepPrimAPI* package provides all the classes to create topological primitive constructions: boxes, cones, cylinders, spheres, etc. Among them is the *BRepPrimAPI_MakePrism* class. As specified above, the prism is defined by:
-
- * the basis shape to sweep;
- * a vector for a finite prism or a direction for finite and infinite prisms.
-
-You want the solid to be finite, swept along the Z axis and to be myHeight height. The vector, defined with the *gp_Vec* class on its X, Y and Z coordinates, is:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- gp_Vec aPrismVec(0, 0, myHeight);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-All the necessary data to create the main body of your bottle is now available. Just apply the *BRepPrimAPI_MakePrism* class to compute the solid:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- TopoDS_Shape myBody = BRepPrimAPI_MakePrism(myFaceProfile, aPrismVec);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-@subsection OCCT_TUTORIAL_SUB3_2 Applying Fillets
-
-
-The edges of the bottle's body are very sharp. To replace them by rounded faces, you use the *Fillet* functionality of Open CASCADE Technology.
-For our purposes, we will specify that fillets must be:
-
- * applied on all edges of the shape
- * have a radius of *myThickness* / 12
-
-@image html /overview/tutorial/images/tutorial_image008.png
-@image latex /overview/tutorial/images/tutorial_image008.png
-
-To apply fillets on the edges of a shape, you use the *BRepFilletAPI_MakeFillet* class. This class is normally used as follows:
-
- * Specify the shape to be filleted in the *BRepFilletAPI_MakeFillet* constructor.
- * Add the fillet descriptions (an edge and a radius) using the *Add* method (you can add as many edges as you need).
- * Ask for the resulting filleted shape with the *Shape* method.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-BRepFilletAPI_MakeFillet mkFillet(myBody);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-To add the fillet description, you need to know the edges belonging to your shape. The best solution is to explore your solid to retrieve its edges. This kind of functionality is provided with the *TopExp_Explorer* class, which explores the data structure described in a *TopoDS_Shape* and extracts the sub-shapes you specifically need.
-Generally, this explorer is created by providing the following information:
-
- * the shape to explore
- * the type of sub-shapes to be found. This information is given with the *TopAbs_ShapeEnum* enumeration.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-TopExp_Explorer anEdgeExplorer(myBody, TopAbs_EDGE);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-An explorer is usually applied in a loop by using its three main methods:
-
- * *More()* to know if there are more sub-shapes to explore.
- * *Current()* to know which is the currently explored sub-shape (used only if the *More()* method returns true).
- * *Next()* to move onto the next sub-shape to explore.
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- while(anEdgeExplorer.More()){
- TopoDS_Edge anEdge = TopoDS::Edge(anEdgeExplorer.Current());
- //Add edge to fillet algorithm
- ...
- anEdgeExplorer.Next();
- }
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-In the explorer loop, you have found all the edges of the bottle shape. Each one must then be added in the *BRepFilletAPI_MakeFillet* instance with the *Add()* method. Do not forget to specify the radius of the fillet along with it.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- mkFillet.Add(myThickness / 12., anEdge);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Once this is done, you perform the last step of the procedure by asking for the filleted shape.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- myBody = mkFillet.Shape();
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-@subsection OCCT_TUTORIAL_SUB3_3 Adding the Neck
-
-
-To add a neck to the bottle, you will create a cylinder and fuse it to the body. The cylinder is to be positioned on the top face of the body with a radius of *myThickness* / 4. and a height of *myHeight* / 10.
-
-@image html /overview/tutorial/images/tutorial_image009.png
-@image latex /overview/tutorial/images/tutorial_image009.png
-
-To position the cylinder, you need to define a coordinate system with the *gp_Ax2* class defining a right-handed coordinate system from a point and two directions - the main (Z) axis direction and the X direction (the Y direction is computed from these two).
-To align the neck with the center of the top face, being in the global coordinate system (0, 0, *myHeight*), with its normal on the global Z axis, your local coordinate system can be defined as follows:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- gp_Pnt neckLocation(0, 0, myHeight);
- gp_Dir neckAxis = gp::DZ();
- gp_Ax2 neckAx2(neckLocation, neckAxis);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-To create a cylinder, use another class from the primitives construction package: the *BRepPrimAPI_MakeCylinder* class. The information you must provide is:
-
- * the coordinate system where the cylinder will be located;
- * the radius and height.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- Standard_Real myNeckRadius = myThickness / 4.;
- Standard_Real myNeckHeight = myHeight / 10;
- BRepPrimAPI_MakeCylinder MKCylinder(neckAx2, myNeckRadius, myNeckHeight);
- TopoDS_Shape myNeck = MKCylinder.Shape();
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You now have two separate parts: a main body and a neck that you need to fuse together.
-The *BRepAlgoAPI* package provides services to perform Boolean operations between shapes, and especially: *common* (Boolean intersection), *cut* (Boolean subtraction) and *fuse* (Boolean union).
-Use *BRepAlgoAPI_Fuse* to fuse the two shapes:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- myBody = BRepAlgoAPI_Fuse(myBody, myNeck);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-@subsection OCCT_TUTORIAL_SUB3_4 Creating a Hollowed Solid
-
-
-Since a real bottle is used to contain liquid material, you should now create a hollowed solid from the bottle's top face.
-In Open CASCADE Technology, a hollowed solid is called a *Thick* *Solid* and is internally computed as follows:
-
- * Remove one or more faces from the initial solid to obtain the first wall W1 of the hollowed solid.
- * Create a parallel wall W2 from W1 at a distance D. If D is positive, W2 will be outside the initial solid, otherwise it will be inside.
- * Compute a solid from the two walls W1 and W2.
-
-@image html /overview/tutorial/images/tutorial_image010.png
-@image latex /overview/tutorial/images/tutorial_image010.png
-
-To compute a thick solid, you create an instance of the *BRepOffsetAPI_MakeThickSolid* class by giving the following information:
-
- * The shape, which must be hollowed.
- * The tolerance used for the computation (tolerance criterion for coincidence in generated shapes).
- * The thickness between the two walls W1 and W2 (distance D).
- * The face(s) to be removed from the original solid to compute the first wall W1.
-
-The challenging part in this procedure is to find the face to remove from your shape - the top face of the neck, which:
-
- * has a plane (planar surface) as underlying geometry;
- * is the highest face (in Z coordinates) of the bottle.
-
-To find the face with such characteristics, you will once again use an explorer to iterate on all the bottle's faces to find the appropriate one.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- for(TopExp_Explorer aFaceExplorer(myBody, TopAbs_FACE) ; aFaceExplorer.More() ; aFaceExplorer.Next()){
- TopoDS_Face aFace = TopoDS::Face(aFaceExplorer.Current());
- }
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-For each detected face, you need to access the geometric properties of the shape: use the *BRep_Tool* class for that. The most commonly used methods of this class are:
-
- * *Surface* to access the surface of a face;
- * *Curve* to access the 3D curve of an edge;
- * *Point* to access the 3D point of a vertex.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-Handle(Geom_Surface) aSurface = BRep_Tool::Surface(aFace);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-As you can see, the *BRep_Tool::Surface* method returns an instance of the *Geom_Surface* class manipulated by handle. However, the *Geom_Surface* class does not provide information about the real type of the object *aSurface*, which could be an instance of *Geom_Plane*, *Geom_CylindricalSurface*, etc.
-All objects manipulated by handle, like *Geom_Surface*, inherit from the *Standard_Transient* class which provides two very useful methods concerning types:
-
- * *DynamicType* to know the real type of the object
- * *IsKind* to know if the object inherits from one particular type
-
-DynamicType returns the real type of the object, but you need to compare it with the existing known types to determine whether *aSurface* is a plane, a cylindrical surface or some other type.
-To compare a given type with the type you seek, use the *STANDARD_TYPE* macro, which returns the type of a class:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- if(aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)){
- //
- }
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-If this comparison is true, you know that the *aSurface* real type is *Geom_Plane*. You can then convert it from *Geom_Surface* to *Geom_Plane* by using the *DownCast()* method provided by each class inheriting *Standard_Transient*. As its name implies, this static method is used to downcast objects to a given type with the following syntax:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast(aSurface);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Remember that the goal of all these conversions is to find the highest face of the bottle lying on a plane. Suppose that you have these two global variables:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- TopoDS_Face faceToRemove;
- Standard_Real zMax = -1;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You can easily find the plane whose origin is the biggest in Z knowing that the location of the plane is given with the *Geom_Plane::Location* method. For example:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- gp_Pnt aPnt = aPlane->Location();
- Standard_Real aZ = aPnt.Z();
- if(aZ > zMax){
- zMax = aZ;
- faceToRemove = aFace;
- }
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You have now found the top face of the neck. Your final step before creating the hollowed solid is to put this face in a list. Since more than one face can be removed from the initial solid, the *BRepOffsetAPI_MakeThickSolid* constructor takes a list of faces as arguments.
-Open CASCADE Technology provides many collections for different kinds of objects: see *TColGeom* package for collections of objects from *Geom* package, *TColgp* package for collections of objects from gp package, etc.
-The collection for shapes can be found in the *TopTools* package. As *BRepOffsetAPI_MakeThickSolid* requires a list, use the *TopTools_ListOfShape* class.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- TopTools_ListOfShape facesToRemove;
- facesToRemove.Append(faceToRemove);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-All the necessary data are now available so you can create your hollowed solid by calling the *BRepOffsetAPI_MakeThickSolid* constructor:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- MyBody = BRepOffsetAPI_MakeThickSolid(myBody, facesToRemove, -myThickness / 50, 1.e-3);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-@section sec4 Building the Threading
-
-
-@subsection OCCT_TUTORIAL_SUB4_1 Creating Surfaces
-
-
-Up to now, you have learned how to create edges out of 3D curves.
-You will now learn how to create an edge out of a 2D curve and a surface.
-To learn this aspect of Open CASCADE Technology, you will build helicoidal profiles out of 2D curves on cylindrical surfaces. The theory is more complex than in previous steps, but applying it is very simple.
-As a first step, you compute these cylindrical surfaces. You are already familiar with curves of the *Geom* package. Now you can create a cylindrical surface (*Geom_CylindricalSurface*) using:
-
- * a coordinate system;
- * a radius.
-
-Using the same coordinate system *neckAx2* used to position the neck, you create two cylindrical surfaces *Geom_CylindricalSurface* with the following radii:
-
-@image html /overview/tutorial/images/tutorial_image011.png
-@image latex /overview/tutorial/images/tutorial_image011.png
-
-Notice that one of the cylindrical surfaces is smaller than the neck. There is a good reason for this: after the thread creation, you will fuse it with the neck. So, we must make sure that the two shapes remain in contact.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- Handle(Geom_CylindricalSurface) aCyl1 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 0.99);
-
- Handle(Geom_CylindricalSurface) aCyl2 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 1.05);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-@subsection OCCT_TUTORIAL_SUB4_2 Defining 2D Curves
-
-
-To create the neck of the bottle, you made a solid cylinder based on a cylindrical surface. You will create the profile of threading by creating 2D curves on such a surface.
-All geometries defined in the *Geom* package are parameterized. This means that each curve or surface from Geom is computed with a parametric equation.
-A *Geom_CylindricalSurface* surface is defined with the following parametric equation:
-
-P(U, V) = O + R * (cos(U) * xDir + sin(U) * yDir) + V * zDir, where :
-
- * P is the point defined by parameters (U, V).
- * O, *Dir, yDir and zDir are respectively the origin, the X direction, Y direction and Z direction of the cylindrical surface local coordinate system.
- * R is the radius of the cylindrical surface.
- * U range is [0, 2PI] and V is infinite.
-
-@image html /overview/tutorial/images/tutorial_image012.png
-@image latex /overview/tutorial/images/tutorial_image012.png
-
-The advantage of having such parameterized geometries is that you can compute, for any (U, V) parameters of the surface:
-
- * the 3D point;
- * the derivative vectors of order 1, 2 to N at this point.
-
-There is another advantage of these parametric equations: you can consider a surface as a 2D parametric space defined with a (U, V) coordinate system. For example, consider the parametric ranges of the neck's surface:
-
-@image html /overview/tutorial/images/tutorial_image013.png
-@image latex /overview/tutorial/images/tutorial_image013.png
-
-Suppose that you create a 2D line on this parametric (U, V) space and compute its 3D parametric curve. Depending on the line definition, results are as follows:
-
-| Case | Parametric Equation | Parametric Curve |
-| :------------ | :----------------------------------------------------------- | :---------------------------------------------------------------------------- |
-| U = 0 | P(V) = O + V * zDir | Line parallel to the Z direction |
-| V = 0 | P(U) = O + R * (cos(U) * xDir + sin(U) * yDir) | Circle parallel to the (O, X, Y) plane |
-| U != 0 V != 0 | P(U, V) = O + R * (cos(U) * xDir + sin(U) * yDir) + V * zDir | Helicoidal curve describing the evolution of height and angle on the cylinder |
-
-The helicoidal curve type is exactly what you need. On the neck's surface, the evolution laws of this curve will be:
-
- * In V parameter: between 0 and myHeighNeck for the height description
- * In U parameter: between 0 and 2PI for the angle description. But, since a cylindrical surface is U periodic, you can decide to extend this angle evolution to 4PI as shown in the following drawing:
-
-@image html /overview/tutorial/images/tutorial_image014.png
-@image latex /overview/tutorial/images/tutorial_image014.png
-
-In this (U, V) parametric space, you will create a local (X, Y) coordinate system to position the curves to be created. This coordinate system will be defined with:
-
- * A center located in the middle of the neck's cylinder parametric space at (2*PI, myNeckHeight / 2) in U, V coordinates.
- * A X direction defined with the (2*PI, myNeckHeight/4) vector in U, V coordinates, so that the curves occupy half of the neck's surfaces.
-
-@image html /overview/tutorial/images/tutorial_image015.png
-@image latex /overview/tutorial/images/tutorial_image015.png
-
-To use 2D primitive geometry types of Open CASCADE Technology for defining a point and a coordinate system, you will once again instantiate classes from gp:
-
- * To define a 2D point from its X and Y coordinates, use the *gp_Pnt2d* class.
- * To define a 2D direction (unit vector) from its X and Y coordinates, use the gp_Dir2d class. The coordinates will automatically be normalized.
- * To define a 2D right-handed coordinate system, use the *gp_Ax2d* class, which is computed from a point (origin of the coordinate system) and a direction - the X direction of the coordinate system. The Y direction will be automatically computed.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- gp_Pnt2d aPnt(2. * M_PI, myNeckHeight / 2.);
- gp_Dir2d aDir(2. * M_PI, myNeckHeight / 4.);
- gp_Ax2d anAx2d(aPnt, aDir);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You will now define the curves. As previously mentioned, these thread profiles are computed on two cylindrical surfaces. In the following figure, curves on the left define the base (on *aCyl1* surface) and the curves on the right define the top of the thread's shape (on *aCyl2* surface).
-
-@image html /overview/tutorial/images/tutorial_image016.png
-@image latex /overview/tutorial/images/tutorial_image016.png
-
-You have already used the *Geom* package to define 3D geometric entities. For 2D, you will use the *Geom2d* package. As for *Geom*, all geometries are parameterized. For example, a *Geom2d_Ellipse* ellipse is defined from:
-
- * a coordinate system whose origin is the ellipse center;
- * a major radius on the major axis defined by the X direction of the coordinate system;
- * a minor radius on the minor axis defined by the Y direction of the coordinate system.
-
-Supposing that:
-
- * Both ellipses have the same major radius of 2*PI,
- * Minor radius of the first ellipse is myNeckHeight / 10,
- * And the minor radius value of the second ellipse is a fourth of the first one,
-
-Your ellipses are defined as follows:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- Standard_Real aMajor = 2. * M_PI;
- Standard_Real aMinor = myNeckHeight / 10;
- Handle(Geom2d_Ellipse) anEllipse1 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor);
- Handle(Geom2d_Ellipse) anEllipse2 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor / 4);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-To describe portions of curves for the arcs drawn above, you define *Geom2d_TrimmedCurve* trimmed curves out of the created ellipses and two parameters to limit them.
-As the parametric equation of an ellipse is P(U) = O + (MajorRadius * cos(U) * XDirection) + (MinorRadius * sin(U) * YDirection), the ellipses need to be limited between 0 and M_PI.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- Handle(Geom2d_TrimmedCurve) anArc1 = new Geom2d_TrimmedCurve(anEllipse1, 0, M_PI);
- Handle(Geom2d_TrimmedCurve) anArc2 = new Geom2d_TrimmedCurve(anEllipse2, 0, M_PI);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The last step consists in defining the segment, which is the same for the two profiles: a line limited by the first and the last point of one of the arcs.
-To access the point corresponding to the parameter of a curve or a surface, you use the Value or D0 method (meaning 0th derivative), D1 method is for first derivative, D2 for the second one.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- gp_Pnt2d anEllipsePnt1 = anEllipse1->Value(0);
- gp_Pnt2d anEllipsePnt2;
- anEllipse1->D0(M_PI, anEllipsePnt2);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-When creating the bottle's profile, you used classes from the *GC* package, providing algorithms to create elementary geometries.
-In 2D geometry, this kind of algorithms is found in the *GCE2d* package. Class names and behaviors are similar to those in *GC*. For example, to create a 2D segment out of two points:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- Handle(Geom2d_TrimmedCurve) aSegment = GCE2d_MakeSegment(anEllipsePnt1, anEllipsePnt2);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-@subsection OCCT_TUTORIAL_SUB4_3 Building Edges and Wires
-
-
-As you did when creating the base profile of the bottle, you can now:
-
- * compute the edges of the neck's threading.
- * compute two wires out of these edges.
-
-@image html /overview/tutorial/images/tutorial_image017.png
-@image latex /overview/tutorial/images/tutorial_image017.png
-
-Previously, you have built:
-
- * two cylindrical surfaces of the threading
- * three 2D curves defining the base geometry of the threading
-
-To compute the edges out of these curves, once again use the *BRepBuilderAPI_MakeEdge* class. One of its constructors allows you to build an edge out of a curve described in the 2D parametric space of a surface.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- TopoDS_Edge anEdge1OnSurf1 = BRepBuilderAPI_MakeEdge(anArc1, aCyl1);
- TopoDS_Edge anEdge2OnSurf1 = BRepBuilderAPI_MakeEdge(aSegment, aCyl1);
- TopoDS_Edge anEdge1OnSurf2 = BRepBuilderAPI_MakeEdge(anArc2, aCyl2);
- TopoDS_Edge anEdge2OnSurf2 = BRepBuilderAPI_MakeEdge(aSegment, aCyl2);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Now, you can create the two profiles of the threading, lying on each surface.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- TopoDS_Wire threadingWire1 = BRepBuilderAPI_MakeWire(anEdge1OnSurf1, anEdge2OnSurf1);
- TopoDS_Wire threadingWire2 = BRepBuilderAPI_MakeWire(anEdge1OnSurf2, anEdge2OnSurf2);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Remember that these wires were built out of a surface and 2D curves.
-One important data item is missing as far as these wires are concerned: there is no information on the 3D curves. Fortunately, you do not need to compute this yourself, which can be a difficult task since the mathematics can be quite complex.
-When a shape contains all the necessary information except 3D curves, Open CASCADE Technology provides a tool to build them automatically. In the BRepLib tool package, you can use the *BuildCurves3d* method to compute 3D curves for all the edges of a shape.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- BRepLib::BuildCurves3d(threadingWire1);
- BRepLib::BuildCurves3d(threadingWire2);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-@subsection OCCT_TUTORIAL_SUB4_4 Creating Threading
-
-
-You have computed the wires of the threading. The threading will be a solid shape, so you must now compute the faces of the wires, the faces allowing you to join the wires, the shell out of these faces and then the solid itself. This can be a lengthy operation.
-There are always faster ways to build a solid when the base topology is defined. You would like to create a solid out of two wires. Open CASCADE Technology provides a quick way to do this by building a loft: a shell or a solid passing through a set of wires in a given sequence.
-The loft function is implemented in the *BRepOffsetAPI_ThruSections* class, which you use as follows:
-
-@image html /overview/tutorial/images/tutorial_image018.png
-@image latex /overview/tutorial/images/tutorial_image018.png
-
- * Initialize the algorithm by creating an instance of the class. The first parameter of this constructor must be specified if you want to create a solid. By default, *BRepOffsetAPI_ThruSections* builds a shell.
- * Add the successive wires using the AddWire method.
- * Use the *CheckCompatibility* method to activate (or deactivate) the option that checks whether the wires have the same number of edges. In this case, wires have two edges each, so you can deactivate this option.
- * Ask for the resulting loft shape with the Shape method.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- BRepOffsetAPI_ThruSections aTool(Standard_True);
- aTool.AddWire(threadingWire1); aTool.AddWire(threadingWire2);
- aTool.CheckCompatibility(Standard_False);
- TopoDS_Shape myThreading = aTool.Shape();
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-@section sec5 Building the Resulting Compound
-
-
-You are almost done building the bottle. Use the *TopoDS_Compound* and *BRep_Builder* classes to build single shape from *myBody* and *myThreading*:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- TopoDS_Compound aRes;
- BRep_Builder aBuilder;
- aBuilder.MakeCompound (aRes);
- aBuilder.Add (aRes, myBody);
- aBuilder.Add (aRes, myThreading);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Congratulations! Your bottle is complete. Here is the result snapshot of the Tutorial application:
-
-@image html /overview/tutorial/images/tutorial_image019.png
-@image latex /overview/tutorial/images/tutorial_image019.png
-
-We hope that this tutorial has provided you with a feel for the industrial strength power of Open CASCADE Technology.
-If you want to know more and develop major projects using Open CASCADE Technology, we invite you to study our training, support, and consulting services on our site at http://www.opencascade.org/support. Our professional services can maximize the power of your Open CASCADE Technology applications.
-
-
-@section sec6 Appendix
-
-
-Complete definition of MakeBottle function (defined in the file src/MakeBottle.cxx of the Tutorial):
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- TopoDS_Shape MakeBottle(const Standard_Real myWidth, const Standard_Real myHeight,
- const Standard_Real myThickness)
- {
- // Profile : Define Support Points
- gp_Pnt aPnt1(-myWidth / 2., 0, 0);
- gp_Pnt aPnt2(-myWidth / 2., -myThickness / 4., 0);
- gp_Pnt aPnt3(0, -myThickness / 2., 0);
- gp_Pnt aPnt4(myWidth / 2., -myThickness / 4., 0);
- gp_Pnt aPnt5(myWidth / 2., 0, 0);
-
- // Profile : Define the Geometry
- Handle(Geom_TrimmedCurve) anArcOfCircle = GC_MakeArcOfCircle(aPnt2,aPnt3,aPnt4);
- Handle(Geom_TrimmedCurve) aSegment1 = GC_MakeSegment(aPnt1, aPnt2);
- Handle(Geom_TrimmedCurve) aSegment2 = GC_MakeSegment(aPnt4, aPnt5);
-
- // Profile : Define the Topology
- TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge(aSegment1);
- TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(anArcOfCircle);
- TopoDS_Edge anEdge3 = BRepBuilderAPI_MakeEdge(aSegment2);
- TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(anEdge1, anEdge2, anEdge3);
-
- // Complete Profile
- gp_Ax1 xAxis = gp::OX();
- gp_Trsf aTrsf;
-
- aTrsf.SetMirror(xAxis);
- BRepBuilderAPI_Transform aBRepTrsf(aWire, aTrsf);
- TopoDS_Shape aMirroredShape = aBRepTrsf.Shape();
- TopoDS_Wire aMirroredWire = TopoDS::Wire(aMirroredShape);
-
- BRepBuilderAPI_MakeWire mkWire;
- mkWire.Add(aWire);
- mkWire.Add(aMirroredWire);
- TopoDS_Wire myWireProfile = mkWire.Wire();
-
- // Body : Prism the Profile
- TopoDS_Face myFaceProfile = BRepBuilderAPI_MakeFace(myWireProfile);
- gp_Vec aPrismVec(0, 0, myHeight);
- TopoDS_Shape myBody = BRepPrimAPI_MakePrism(myFaceProfile, aPrismVec);
-
- // Body : Apply Fillets
- BRepFilletAPI_MakeFillet mkFillet(myBody);
- TopExp_Explorer anEdgeExplorer(myBody, TopAbs_EDGE);
- while(anEdgeExplorer.More()){
- TopoDS_Edge anEdge = TopoDS::Edge(anEdgeExplorer.Current());
- //Add edge to fillet algorithm
- mkFillet.Add(myThickness / 12., anEdge);
- anEdgeExplorer.Next();
- }
-
- myBody = mkFillet.Shape();
-
- // Body : Add the Neck
- gp_Pnt neckLocation(0, 0, myHeight);
- gp_Dir neckAxis = gp::DZ();
- gp_Ax2 neckAx2(neckLocation, neckAxis);
-
- Standard_Real myNeckRadius = myThickness / 4.;
- Standard_Real myNeckHeight = myHeight / 10.;
-
- BRepPrimAPI_MakeCylinder MKCylinder(neckAx2, myNeckRadius, myNeckHeight);
- TopoDS_Shape myNeck = MKCylinder.Shape();
-
- myBody = BRepAlgoAPI_Fuse(myBody, myNeck);
-
- // Body : Create a Hollowed Solid
- TopoDS_Face faceToRemove;
- Standard_Real zMax = -1;
-
- for(TopExp_Explorer aFaceExplorer(myBody, TopAbs_FACE); aFaceExplorer.More(); aFaceExplorer.Next()){
- TopoDS_Face aFace = TopoDS::Face(aFaceExplorer.Current());
- // Check if <aFace> is the top face of the bottle's neck
- Handle(Geom_Surface) aSurface = BRep_Tool::Surface(aFace);
- if(aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)){
- Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast(aSurface);
- gp_Pnt aPnt = aPlane->Location();
- Standard_Real aZ = aPnt.Z();
- if(aZ > zMax){
- zMax = aZ;
- faceToRemove = aFace;
- }
- }
- }
-
- TopTools_ListOfShape facesToRemove;
- facesToRemove.Append(faceToRemove);
- myBody = BRepOffsetAPI_MakeThickSolid(myBody, facesToRemove, -myThickness / 50, 1.e-3);
- // Threading : Create Surfaces
- Handle(Geom_CylindricalSurface) aCyl1 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 0.99);
- Handle(Geom_CylindricalSurface) aCyl2 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 1.05);
-
- // Threading : Define 2D Curves
- gp_Pnt2d aPnt(2. * M_PI, myNeckHeight / 2.);
- gp_Dir2d aDir(2. * M_PI, myNeckHeight / 4.);
- gp_Ax2d anAx2d(aPnt, aDir);
-
- Standard_Real aMajor = 2. * M_PI;
- Standard_Real aMinor = myNeckHeight / 10;
-
- Handle(Geom2d_Ellipse) anEllipse1 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor);
- Handle(Geom2d_Ellipse) anEllipse2 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor / 4);
- Handle(Geom2d_TrimmedCurve) anArc1 = new Geom2d_TrimmedCurve(anEllipse1, 0, M_PI);
- Handle(Geom2d_TrimmedCurve) anArc2 = new Geom2d_TrimmedCurve(anEllipse2, 0, M_PI);
- gp_Pnt2d anEllipsePnt1 = anEllipse1->Value(0);
- gp_Pnt2d anEllipsePnt2 = anEllipse1->Value(M_PI);
-
- Handle(Geom2d_TrimmedCurve) aSegment = GCE2d_MakeSegment(anEllipsePnt1, anEllipsePnt2);
- // Threading : Build Edges and Wires
- TopoDS_Edge anEdge1OnSurf1 = BRepBuilderAPI_MakeEdge(anArc1, aCyl1);
- TopoDS_Edge anEdge2OnSurf1 = BRepBuilderAPI_MakeEdge(aSegment, aCyl1);
- TopoDS_Edge anEdge1OnSurf2 = BRepBuilderAPI_MakeEdge(anArc2, aCyl2);
- TopoDS_Edge anEdge2OnSurf2 = BRepBuilderAPI_MakeEdge(aSegment, aCyl2);
- TopoDS_Wire threadingWire1 = BRepBuilderAPI_MakeWire(anEdge1OnSurf1, anEdge2OnSurf1);
- TopoDS_Wire threadingWire2 = BRepBuilderAPI_MakeWire(anEdge1OnSurf2, anEdge2OnSurf2);
- BRepLib::BuildCurves3d(threadingWire1);
- BRepLib::BuildCurves3d(threadingWire2);
-
- // Create Threading
- BRepOffsetAPI_ThruSections aTool(Standard_True);
- aTool.AddWire(threadingWire1);
- aTool.AddWire(threadingWire2);
- aTool.CheckCompatibility(Standard_False);
-
- TopoDS_Shape myThreading = aTool.Shape();
-
- // Building the Resulting Compound
- TopoDS_Compound aRes;
- BRep_Builder aBuilder;
- aBuilder.MakeCompound (aRes);
- aBuilder.Add (aRes, myBody);
- aBuilder.Add (aRes, myThreading);
-
- return aRes;
- }
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#!/usr/bin/tclsh
+
# Command-line starter for occdoc command, use it as follows:
# tclsh> source dox/start.tcl [arguments]
source [file join [file dirname [info script]] occdoc.tcl]
-occdoc {*}$argv
\ No newline at end of file
+occdoc {*}$::argv
Technical Overview {#technical_overview}
========================================
+@tableofcontents
+
@section OCCT_TOVW_SECTION_1 Product Overview
-Open CASCADE Technology is an object-oriented C++ class librarLzlz ljky designed for rapid production of sophisticated domain-specific design applications. A typical application developed using OCCT deals with two or three-dimensional (2D or 3D) geometric modeling
+Open CASCADE Technology is an object-oriented C++ class library designed for rapid production of sophisticated domain-specific design applications. A typical application developed using OCCT deals with two or three-dimensional (2D or 3D) geometric modeling
in general-purpose or specialized Computer Aided Design (CAD) systems, manufacturing
or analysis applications, simulation applications, or illustration tools. OCCT Object
Libraries help you to develop your applications significantly faster.
Here is an example which shows how to define a class <i> SamplePoint </i> manipulated by handle.
-~~~~
-
Sample_Point.hxx:
---------------
+~~~~
+
#ifndef _Sample_Point_HeaderFile
#define _Sample_Point_HeaderFile
#ifndef _Standard_Macro_HeaderFile
};
#endif
+~~~~
+
Sample_Point.cxx:
----------------
+~~~~
+
#include <Sample_Point.hxx>
// Implementation of Handle and type mgt
~~~~
The filter is used to forbid copying a specified type of attribute.
-You can also have a look at <i> TDF_Closure*</i>,
+You can also have a look at *TDF_Closure**,
which can be useful to determine the dependencies of the part you want to cut from the document.
@subsection OCCT_TOVW_SECTION_8_7 Platform-related problems
Open CASCADE Technology uses a dynamic library loading mode. Sometimes, the error message such as the following appears:
~~~~
- "cannot map <i>libname.so</i> .. under any of the filenames .."
+ "cannot map libname.so .. under any of the filenames .."
~~~~
-When this happens, check your <i> PATH </i>under Windows, <i> LD_LIBRARY_PATH</i> under UNIX ,
-<i> SHLIB_PATH </i> under HP-UX or <i> LIBPATH</i> under IBM AIX .
+When this happens, check your *PATH* under Windows, *LD_LIBRARY_PATH* under UNIX ,
+*SHLIB_PATH* under HP-UX or *LIBPATH* under IBM AIX .
It should contain the path where the required dynamic library is located.
### Running Draw under Windows
Make sure that the OCCT directory name does not contain any blank spaces.
It causes some problems when reading the OCCT description TCL Commands files.
-If you have set <i> DRAWHOME</i> and <i> DRAWDEFAULT</i>, replace \ by / in the variable.
+If you have set <i> DRAWHOME</i> and <i> DRAWDEFAULT</i>, replace \\ by / in the variable.
### Error on application start on Windows
another problem, make sure to have the latest version of the graphics card driver
installed. If this is not possible or does not help, try to decrease
hardware acceleration level (usually found in Troubleshooting section of the graphics card properties).
-
-### Fatal error during graphic initialization
-
-
-If you get the <b>Fatal error during graphic initialization</b> message when running
-an Open CASCADE Technology based application, or if the application crashes
-without displaying error messages, you must set the environment variable <i> CSF_GRAPHICSHR </i> as follows:
-
- * On Windows, if we suppose that OCCT is installed in <i> D:\OpenCASCADE6.3.0 </i>
-
-~~~~
- Set CSF_GraphicShr= D:\OpenCASCADE6.3.1\ros\win32\bin\TkOpenGl.dll
-~~~~
-
- * On Linux or Unix, if we suppose that OCCT is installed in <i> .../mydisk/ OpenCASCADE6.3.0 </i>
-
-~~~~
- Setenv CSF_GraphicsShr /mydisk/ OpenCASCADE6.3.0ros/lin/lib/libTKOpenGl.so
-~~~~
\ No newline at end of file
--- /dev/null
+ Tutorial {#tutorial}
+=======
+
+@tableofcontents
+
+@section sec1 Overview
+
+
+This tutorial will teach you how to use Open CASCADE Technology services to model a 3D object. The purpose of this tutorial is not to describe all Open CASCADE Technology classes but to help you start thinking in terms of Open CASCADE Technology as a tool.
+
+
+@subsection OCCT_TUTORIAL_SUB1_1 Prerequisites
+
+This tutorial assumes that you have experience in using and setting up C++.
+From a programming standpoint, Open CASCADE Technology is designed to enhance your C++ tools with 3D modeling classes, methods and functions. The combination of all these resources will allow you to create substantial applications.
+
+@subsection OCCT_TUTORIAL_SUB1_2 The Model
+
+To illustrate the use of classes provided in the 3D geometric modeling toolkits, you will create a bottle as shown:
+
+@image html /tutorial/images/tutorial_image001.png
+@image latex /tutorial/images/tutorial_image001.png
+
+In the tutorial we will create, step-by-step, a function that will model a bottle as shown above. You will find the complete source code of this tutorial, including the very function *MakeBottle* in the distribution of Open CASCADE Technology. The function body is provided in the file samples/qt/Tutorial/src/MakeBottle.cxx.
+
+@subsection OCCT_TUTORIAL_SUB1_3 Model Specifications
+
+We first define the bottle specifications as follows:
+
+| Object Parameter | Parameter Name | Parameter Value |
+| :--------------: | :------------: | :-------------: |
+| Bottle height | MyHeight | 70mm |
+| Bottle width | MyWidth | 50mm |
+| Bottle thickness | MyThickness | 30mm |
+
+In addition, we decide that the bottle's profile (base) will be centered on the origin of the global Cartesian coordinate system.
+
+@image html /tutorial/images/tutorial_image002.png
+@image latex /tutorial/images/tutorial_image002.png
+
+This modeling requires four steps:
+
+ * build the bottle's Profile
+ * build the bottle's Body
+ * build the Threading on the bottle's neck
+ * build the result compound
+
+
+@section sec2 Building the Profile
+
+@subsection OCCT_TUTORIAL_SUB2_1 Defining Support Points
+
+To create the bottle's profile, you first create characteristic points with their coordinates as shown below in the (XOY) plane. These points will be the supports that define the geometry of the profile.
+
+@image html /tutorial/images/tutorial_image003.png
+@image latex /tutorial/images/tutorial_image003.png
+
+There are two classes to describe a 3D Cartesian point from its X, Y and Z coordinates in Open CASCADE Technology:
+
+ * the primitive geometric *gp_Pnt* class
+ * the transient *Geom_CartesianPoint* class manipulated by handle
+
+A handle is a type of smart pointer that provides automatic memory management.
+To choose the best class for this application, consider the following:
+
+ * *gp_Pnt* is manipulated by value. Like all objects of its kind, it will have a limited lifetime.
+ * *Geom_CartesianPoint* is manipulated by handle and may have multiple references and a long lifetime.
+
+Since all the points you will define are only used to create the profile's curves, an object with a limited lifetime will do. Choose the *gp_Pnt* class.
+To instantiate a *gp_Pnt* object, just specify the X, Y, and Z coordinates of the points in the global cartesian coordinate system:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ gp_Pnt aPnt1(-myWidth / 2., 0, 0);
+ gp_Pnt aPnt2(-myWidth / 2., -myThickness / 4., 0);
+ gp_Pnt aPnt3(0, -myThickness / 2., 0);
+ gp_Pnt aPnt4(myWidth / 2., -myThickness / 4., 0);
+ gp_Pnt aPnt5(myWidth / 2., 0, 0);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Once your objects are instantiated, you can use methods provided by the class to access and modify its data. For example, to get the X coordinate of a point:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+Standard_Real xValue1 = aPnt1.X();
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@subsection OCCT_TUTORIAL_SUB2_2 Profile: Defining the Geometry
+With the help of the previously defined points, you can compute a part of the bottle's profile geometry. As shown in the figure below, it will consist of two segments and one arc.
+
+@image html /tutorial/images/tutorial_image004.png
+@image latex /tutorial/images/tutorial_image004.png
+
+To create such entities, you need a specific data structure, which implements 3D geometric objects. This can be found in the Geom package of Open CASCADE Technology.
+In Open CASCADE Technology a package is a group of classes providing related functionality. The classes have names that start with the name of a package they belong to. For example, *Geom_Line* and *Geom_Circle* classes belong to the *Geom* package. The *Geom* package implements 3D geometric objects: elementary curves and surfaces are provided as well as more complex ones (such as *Bezier* and *BSpline*).
+However, the *Geom* package provides only the data structure of geometric entities. You can directly instantiate classes belonging to *Geom*, but it is easier to compute elementary curves and surfaces by using the *GC* package.
+This is because the *GC* provides two algorithm classes which are exactly what is required for our profile:
+
+ * Class *GC_MakeSegment* to create a segment. One of its constructors allows you to define a segment by two end points P1 and P2
+ * Class *GC_MakeArcOfCircle* to create an arc of a circle. A useful constructor creates an arc from two end points P1 and P3 and going through P2.
+
+Both of these classes return a *Geom_TrimmedCurve* manipulated by handle. This entity represents a base curve (line or circle, in our case), limited between two of its parameter values. For example, circle C is parameterized between 0 and 2PI. If you need to create a quarter of a circle, you create a *Geom_TrimmedCurve* on C limited between 0 and M_PI/2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ Handle(Geom_TrimmedCurve) aArcOfCircle = GC_MakeArcOfCircle(aPnt2,aPnt3,aPnt4);
+ Handle(Geom_TrimmedCurve) aSegment1 = GC_MakeSegment(aPnt1, aPnt2);
+ Handle(Geom_TrimmedCurve) aSegment2 = GC_MakeSegment(aPnt4, aPnt5);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+All *GC* classes provide a casting method to obtain a result automatically with a function-like call. Note that this method will raise an exception if construction has failed. To handle possible errors more explicitly, you may use the *IsDone* and *Value* methods. For example:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ GC_MakeSegment mkSeg (aPnt1, aPnt2);
+ Handle(Geom_TrimmedCurve) aSegment1;
+ if(mkSegment.IsDone()){
+ aSegment1 = mkSeg.Value();
+ }
+ else {
+ // handle error
+ }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@subsection OCCT_TUTORIAL_SUB2_3 Profile: Defining the Topology
+
+
+You have created the support geometry of one part of the profile but these curves are independent with no relations between each other.
+To simplify the modeling, it would be right to manipulate these three curves as a single entity.
+This can be done by using the topological data structure of Open CASCADE Technology defined in the *TopoDS* package: it defines relationships between geometric entities which can be linked together to represent complex shapes.
+Each object of the *TopoDS* package, inheriting from the *TopoDS_Shape* class, describes a topological shape as described below:
+
+| Shape | Open CASCADE Technology Class | Description |
+| :-------- | :---------------------------- | :------------------------------------------------------------ |
+| Vertex | TopoDS_Vertex | Zero dimensional shape corresponding to a point in geometry. |
+| Edge | TopoDS_Edge | One-dimensional shape corresponding to a curve and bounded by a vertex at each extremity.|
+| Wire | TopoDS_Wire | Sequence of edges connected by vertices. |
+| Face | TopoDS_Face | Part of a surface bounded by a closed wire(s). |
+| Shell | TopoDS_Shell | Set of faces connected by edges. |
+| Solid | TopoDS_Solid | Part of 3D space bounded by Shells. |
+| CompSolid | TopoDS_CompSolid | Set of solids connected by their faces. |
+| Compound | TopoDS_Compound | Set of any other shapes described above. |
+
+Referring to the previous table, to build the profile, you will create:
+
+ * Three edges out of the previously computed curves.
+ * One wire with these edges.
+
+@image html /tutorial/images/tutorial_image005.png
+@image latex /tutorial/images/tutorial_image005.png
+
+However, the *TopoDS* package provides only the data structure of the topological entities. Algorithm classes available to compute standard topological objects can be found in the *BRepBuilderAPI* package.
+To create an edge, you use the BRepBuilderAPI_MakeEdge class with the previously computed curves:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ TopoDS_Edge aEdge1 = BRepBuilderAPI_MakeEdge(aSegment1);
+ TopoDS_Edge aEdge2 = BRepBuilderAPI_MakeEdge(aArcOfCircle);
+ TopoDS_Edge aEdge3 = BRepBuilderAPI_MakeEdge(aSegment2);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In Open CASCADE Technology, you can create edges in several ways. One possibility is to create an edge directly from two points, in which case the underlying geometry of this edge is a line, bounded by two vertices being automatically computed from the two input points. For example, aEdge1 and aEdge3 could have been computed in a simpler way:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ TopoDS_Edge aEdge1 = BRepBuilderAPI_MakeEdge(aPnt1, aPnt3);
+ TopoDS_Edge aEdge2 = BRepBuilderAPI_MakeEdge(aPnt4, aPnt5);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To connect the edges, you need to create a wire with the *BRepBuilderAPI_MakeWire* class. There are two ways of building a wire with this class:
+
+ * directly from one to four edges
+ * by adding other wire(s) or edge(s) to an existing wire (this is explained later in this tutorial)
+
+When building a wire from less than four edges, as in the present case, you can use the constructor directly as follows:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(aEdge1, aEdge2, aEdge3);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@subsection OCCT_TUTORIAL_SUB2_4 Profile: Completing the Profile
+
+
+Once the first part of your wire is created you need to compute the complete profile. A simple way to do this is to:
+
+ * compute a new wire by reflecting the existing one.
+ * add the reflected wire to the initial one.
+
+@image html /tutorial/images/tutorial_image006.png
+@image latex /tutorial/images/tutorial_image006.png
+
+To apply a transformation on shapes (including wires), you first need to define the properties of a 3D geometric transformation by using the gp_Trsf class. This transformation can be a translation, a rotation, a scale, a reflection, or a combination of these.
+In our case, we need to define a reflection with respect to the X axis of the global coordinate system. An axis, defined with the gp_Ax1 class, is built out of a point and has a direction (3D unitary vector). There are two ways to define this axis.
+The first way is to define it from scratch, using its geometric definition:
+
+ * X axis is located at (0, 0, 0) - use the *gp_Pnt* class.
+ * X axis direction is (1, 0, 0) - use the *gp_Dir* class. A *gp_Dir* instance is created out of its X, Y and Z coordinates.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ gp_Pnt aOrigin(0, 0, 0);
+ gp_Dir xDir(1, 0, 0);
+ gp_Ax1 xAxis(aOrigin, xDir);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The second and simplest way is to use the geometric constants defined in the gp package (origin, main directions and axis of the global coordinate system). To get the X axis, just call the *gp::OX* method:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ gp_Ax1 xAxis = gp::OX();
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+As previously explained, the 3D geometric transformation is defined with the *gp_Trsf* class. There are two different ways to use this class:
+
+ * by defining a transformation matrix by all its values
+ * by using the appropriate methods corresponding to the required transformation (SetTranslation for a translation, SetMirror for a reflection, etc.): the matrix is automatically computed.
+
+Since the simplest approach is always the best one, you should use the SetMirror method with the axis as the center of symmetry.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ gp_Trsf aTrsf;
+ aTrsf.SetMirror(xAxis);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You now have all necessary data to apply the transformation with the BRepBuilderAPI_Transform class by specifying:
+
+ * the shape on which the transformation must be applied.
+ * the geometric transformation
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ BRepBuilderAPI_Transform aBRepTrsf(aWire, aTrsf);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+*BRepBuilderAPI_Transform* does not modify the nature of the shape: the result of the reflected wire remains a wire. But the function-like call or the *BRepBuilderAPI_Transform::Shape* method returns a *TopoDS_Shape* object:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ TopoDS_Shape aMirroredShape = aBRepTrsf.Shape();
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+What you need is a method to consider the resulting reflected shape as a wire. The *TopoDS* global functions provide this kind of service by casting a shape into its real type. To cast the transformed wire, use the *TopoDS::Wire* method.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ TopoDS_Wire aMirroredWire = TopoDS::Wire(aMirroredShape);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The bottle's profile is almost finished. You have created two wires: *aWire* and *aMirroredWire*. You need to concatenate them to compute a single shape. To do this, you use the *BRepBuilderAPI_MakeWire* class as follows:
+
+ * create an instance of *BRepBuilderAPI_MakeWire*.
+ * add all edges of the two wires by using the *Add* method on this object.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ BRepBuilderAPI_MakeWire mkWire;
+ mkWire.Add(aWire);
+ mkWire.Add(aMirroredWire);
+ TopoDS_Wire myWireProfile = mkWire.Wire();
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@section sec3 Building the Body
+
+
+@subsection OCCT_TUTORIAL_SUB3_1 Prism the Profile
+
+
+To compute the main body of the bottle, you need to create a solid shape. The simplest way is to use the previously created profile and to sweep it along a direction. The *Prism* functionality of Open CASCADE Technology is the most appropriate for that task. It accepts a shape and a direction as input and generates a new shape according to the following rules:
+
+| Shape | Generates |
+| :----- | :----------------- |
+| Vertex | Edge |
+| Edge | Face |
+| Wire | Shell |
+| Face | Solid |
+| Shell | Compound of Solids |
+
+@image html /tutorial/images/tutorial_image007.png
+@image latex /tutorial/images/tutorial_image007.png
+
+Your current profile is a wire. Referring to the Shape/Generates table, you need to compute a face out of its wire to generate a solid.
+To create a face, use the *BRepBuilderAPI_MakeFace* class. As previously explained, a face is a part of a surface bounded by a closed wire. Generally, *BRepBuilderAPI_MakeFace* computes a face out of a surface and one or more wires.
+When the wire lies on a plane, the surface is automatically computed.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ TopoDS_Face myFaceProfile = BRepBuilderAPI_MakeFace(myWireProfile);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The *BRepPrimAPI* package provides all the classes to create topological primitive constructions: boxes, cones, cylinders, spheres, etc. Among them is the *BRepPrimAPI_MakePrism* class. As specified above, the prism is defined by:
+
+ * the basis shape to sweep;
+ * a vector for a finite prism or a direction for finite and infinite prisms.
+
+You want the solid to be finite, swept along the Z axis and to be myHeight height. The vector, defined with the *gp_Vec* class on its X, Y and Z coordinates, is:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ gp_Vec aPrismVec(0, 0, myHeight);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+All the necessary data to create the main body of your bottle is now available. Just apply the *BRepPrimAPI_MakePrism* class to compute the solid:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ TopoDS_Shape myBody = BRepPrimAPI_MakePrism(myFaceProfile, aPrismVec);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@subsection OCCT_TUTORIAL_SUB3_2 Applying Fillets
+
+
+The edges of the bottle's body are very sharp. To replace them by rounded faces, you use the *Fillet* functionality of Open CASCADE Technology.
+For our purposes, we will specify that fillets must be:
+
+ * applied on all edges of the shape
+ * have a radius of *myThickness* / 12
+
+@image html /tutorial/images/tutorial_image008.png
+@image latex /tutorial/images/tutorial_image008.png
+
+To apply fillets on the edges of a shape, you use the *BRepFilletAPI_MakeFillet* class. This class is normally used as follows:
+
+ * Specify the shape to be filleted in the *BRepFilletAPI_MakeFillet* constructor.
+ * Add the fillet descriptions (an edge and a radius) using the *Add* method (you can add as many edges as you need).
+ * Ask for the resulting filleted shape with the *Shape* method.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+BRepFilletAPI_MakeFillet mkFillet(myBody);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To add the fillet description, you need to know the edges belonging to your shape. The best solution is to explore your solid to retrieve its edges. This kind of functionality is provided with the *TopExp_Explorer* class, which explores the data structure described in a *TopoDS_Shape* and extracts the sub-shapes you specifically need.
+Generally, this explorer is created by providing the following information:
+
+ * the shape to explore
+ * the type of sub-shapes to be found. This information is given with the *TopAbs_ShapeEnum* enumeration.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+TopExp_Explorer anEdgeExplorer(myBody, TopAbs_EDGE);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+An explorer is usually applied in a loop by using its three main methods:
+
+ * *More()* to know if there are more sub-shapes to explore.
+ * *Current()* to know which is the currently explored sub-shape (used only if the *More()* method returns true).
+ * *Next()* to move onto the next sub-shape to explore.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ while(anEdgeExplorer.More()){
+ TopoDS_Edge anEdge = TopoDS::Edge(anEdgeExplorer.Current());
+ //Add edge to fillet algorithm
+ ...
+ anEdgeExplorer.Next();
+ }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In the explorer loop, you have found all the edges of the bottle shape. Each one must then be added in the *BRepFilletAPI_MakeFillet* instance with the *Add()* method. Do not forget to specify the radius of the fillet along with it.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ mkFillet.Add(myThickness / 12., anEdge);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Once this is done, you perform the last step of the procedure by asking for the filleted shape.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ myBody = mkFillet.Shape();
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@subsection OCCT_TUTORIAL_SUB3_3 Adding the Neck
+
+
+To add a neck to the bottle, you will create a cylinder and fuse it to the body. The cylinder is to be positioned on the top face of the body with a radius of *myThickness* / 4. and a height of *myHeight* / 10.
+
+@image html /tutorial/images/tutorial_image009.png
+@image latex /tutorial/images/tutorial_image009.png
+
+To position the cylinder, you need to define a coordinate system with the *gp_Ax2* class defining a right-handed coordinate system from a point and two directions - the main (Z) axis direction and the X direction (the Y direction is computed from these two).
+To align the neck with the center of the top face, being in the global coordinate system (0, 0, *myHeight*), with its normal on the global Z axis, your local coordinate system can be defined as follows:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ gp_Pnt neckLocation(0, 0, myHeight);
+ gp_Dir neckAxis = gp::DZ();
+ gp_Ax2 neckAx2(neckLocation, neckAxis);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To create a cylinder, use another class from the primitives construction package: the *BRepPrimAPI_MakeCylinder* class. The information you must provide is:
+
+ * the coordinate system where the cylinder will be located;
+ * the radius and height.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ Standard_Real myNeckRadius = myThickness / 4.;
+ Standard_Real myNeckHeight = myHeight / 10;
+ BRepPrimAPI_MakeCylinder MKCylinder(neckAx2, myNeckRadius, myNeckHeight);
+ TopoDS_Shape myNeck = MKCylinder.Shape();
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You now have two separate parts: a main body and a neck that you need to fuse together.
+The *BRepAlgoAPI* package provides services to perform Boolean operations between shapes, and especially: *common* (Boolean intersection), *cut* (Boolean subtraction) and *fuse* (Boolean union).
+Use *BRepAlgoAPI_Fuse* to fuse the two shapes:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ myBody = BRepAlgoAPI_Fuse(myBody, myNeck);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@subsection OCCT_TUTORIAL_SUB3_4 Creating a Hollowed Solid
+
+
+Since a real bottle is used to contain liquid material, you should now create a hollowed solid from the bottle's top face.
+In Open CASCADE Technology, a hollowed solid is called a *Thick* *Solid* and is internally computed as follows:
+
+ * Remove one or more faces from the initial solid to obtain the first wall W1 of the hollowed solid.
+ * Create a parallel wall W2 from W1 at a distance D. If D is positive, W2 will be outside the initial solid, otherwise it will be inside.
+ * Compute a solid from the two walls W1 and W2.
+
+@image html /tutorial/images/tutorial_image010.png
+@image latex /tutorial/images/tutorial_image010.png
+
+To compute a thick solid, you create an instance of the *BRepOffsetAPI_MakeThickSolid* class by giving the following information:
+
+ * The shape, which must be hollowed.
+ * The tolerance used for the computation (tolerance criterion for coincidence in generated shapes).
+ * The thickness between the two walls W1 and W2 (distance D).
+ * The face(s) to be removed from the original solid to compute the first wall W1.
+
+The challenging part in this procedure is to find the face to remove from your shape - the top face of the neck, which:
+
+ * has a plane (planar surface) as underlying geometry;
+ * is the highest face (in Z coordinates) of the bottle.
+
+To find the face with such characteristics, you will once again use an explorer to iterate on all the bottle's faces to find the appropriate one.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ for(TopExp_Explorer aFaceExplorer(myBody, TopAbs_FACE) ; aFaceExplorer.More() ; aFaceExplorer.Next()){
+ TopoDS_Face aFace = TopoDS::Face(aFaceExplorer.Current());
+ }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+For each detected face, you need to access the geometric properties of the shape: use the *BRep_Tool* class for that. The most commonly used methods of this class are:
+
+ * *Surface* to access the surface of a face;
+ * *Curve* to access the 3D curve of an edge;
+ * *Point* to access the 3D point of a vertex.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+Handle(Geom_Surface) aSurface = BRep_Tool::Surface(aFace);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+As you can see, the *BRep_Tool::Surface* method returns an instance of the *Geom_Surface* class manipulated by handle. However, the *Geom_Surface* class does not provide information about the real type of the object *aSurface*, which could be an instance of *Geom_Plane*, *Geom_CylindricalSurface*, etc.
+All objects manipulated by handle, like *Geom_Surface*, inherit from the *Standard_Transient* class which provides two very useful methods concerning types:
+
+ * *DynamicType* to know the real type of the object
+ * *IsKind* to know if the object inherits from one particular type
+
+DynamicType returns the real type of the object, but you need to compare it with the existing known types to determine whether *aSurface* is a plane, a cylindrical surface or some other type.
+To compare a given type with the type you seek, use the *STANDARD_TYPE* macro, which returns the type of a class:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ if(aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)){
+ //
+ }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If this comparison is true, you know that the *aSurface* real type is *Geom_Plane*. You can then convert it from *Geom_Surface* to *Geom_Plane* by using the *DownCast()* method provided by each class inheriting *Standard_Transient*. As its name implies, this static method is used to downcast objects to a given type with the following syntax:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast(aSurface);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Remember that the goal of all these conversions is to find the highest face of the bottle lying on a plane. Suppose that you have these two global variables:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ TopoDS_Face faceToRemove;
+ Standard_Real zMax = -1;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can easily find the plane whose origin is the biggest in Z knowing that the location of the plane is given with the *Geom_Plane::Location* method. For example:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ gp_Pnt aPnt = aPlane->Location();
+ Standard_Real aZ = aPnt.Z();
+ if(aZ > zMax){
+ zMax = aZ;
+ faceToRemove = aFace;
+ }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You have now found the top face of the neck. Your final step before creating the hollowed solid is to put this face in a list. Since more than one face can be removed from the initial solid, the *BRepOffsetAPI_MakeThickSolid* constructor takes a list of faces as arguments.
+Open CASCADE Technology provides many collections for different kinds of objects: see *TColGeom* package for collections of objects from *Geom* package, *TColgp* package for collections of objects from gp package, etc.
+The collection for shapes can be found in the *TopTools* package. As *BRepOffsetAPI_MakeThickSolid* requires a list, use the *TopTools_ListOfShape* class.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ TopTools_ListOfShape facesToRemove;
+ facesToRemove.Append(faceToRemove);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+All the necessary data are now available so you can create your hollowed solid by calling the *BRepOffsetAPI_MakeThickSolid* constructor:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ MyBody = BRepOffsetAPI_MakeThickSolid(myBody, facesToRemove, -myThickness / 50, 1.e-3);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@section sec4 Building the Threading
+
+
+@subsection OCCT_TUTORIAL_SUB4_1 Creating Surfaces
+
+
+Up to now, you have learned how to create edges out of 3D curves.
+You will now learn how to create an edge out of a 2D curve and a surface.
+To learn this aspect of Open CASCADE Technology, you will build helicoidal profiles out of 2D curves on cylindrical surfaces. The theory is more complex than in previous steps, but applying it is very simple.
+As a first step, you compute these cylindrical surfaces. You are already familiar with curves of the *Geom* package. Now you can create a cylindrical surface (*Geom_CylindricalSurface*) using:
+
+ * a coordinate system;
+ * a radius.
+
+Using the same coordinate system *neckAx2* used to position the neck, you create two cylindrical surfaces *Geom_CylindricalSurface* with the following radii:
+
+@image html /tutorial/images/tutorial_image011.png
+@image latex /tutorial/images/tutorial_image011.png
+
+Notice that one of the cylindrical surfaces is smaller than the neck. There is a good reason for this: after the thread creation, you will fuse it with the neck. So, we must make sure that the two shapes remain in contact.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ Handle(Geom_CylindricalSurface) aCyl1 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 0.99);
+
+ Handle(Geom_CylindricalSurface) aCyl2 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 1.05);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@subsection OCCT_TUTORIAL_SUB4_2 Defining 2D Curves
+
+
+To create the neck of the bottle, you made a solid cylinder based on a cylindrical surface. You will create the profile of threading by creating 2D curves on such a surface.
+All geometries defined in the *Geom* package are parameterized. This means that each curve or surface from Geom is computed with a parametric equation.
+A *Geom_CylindricalSurface* surface is defined with the following parametric equation:
+
+P(U, V) = O + R * (cos(U) * xDir + sin(U) * yDir) + V * zDir, where :
+
+ * P is the point defined by parameters (U, V).
+ * O, *Dir, yDir and zDir are respectively the origin, the X direction, Y direction and Z direction of the cylindrical surface local coordinate system.
+ * R is the radius of the cylindrical surface.
+ * U range is [0, 2PI] and V is infinite.
+
+@image html /tutorial/images/tutorial_image012.png
+@image latex /tutorial/images/tutorial_image012.png
+
+The advantage of having such parameterized geometries is that you can compute, for any (U, V) parameters of the surface:
+
+ * the 3D point;
+ * the derivative vectors of order 1, 2 to N at this point.
+
+There is another advantage of these parametric equations: you can consider a surface as a 2D parametric space defined with a (U, V) coordinate system. For example, consider the parametric ranges of the neck's surface:
+
+@image html /tutorial/images/tutorial_image013.png
+@image latex /tutorial/images/tutorial_image013.png
+
+Suppose that you create a 2D line on this parametric (U, V) space and compute its 3D parametric curve. Depending on the line definition, results are as follows:
+
+| Case | Parametric Equation | Parametric Curve |
+| :------------ | :----------------------------------------------------------- | :---------------------------------------------------------------------------- |
+| U = 0 | P(V) = O + V * zDir | Line parallel to the Z direction |
+| V = 0 | P(U) = O + R * (cos(U) * xDir + sin(U) * yDir) | Circle parallel to the (O, X, Y) plane |
+| U != 0 V != 0 | P(U, V) = O + R * (cos(U) * xDir + sin(U) * yDir) + V * zDir | Helicoidal curve describing the evolution of height and angle on the cylinder |
+
+The helicoidal curve type is exactly what you need. On the neck's surface, the evolution laws of this curve will be:
+
+ * In V parameter: between 0 and myHeighNeck for the height description
+ * In U parameter: between 0 and 2PI for the angle description. But, since a cylindrical surface is U periodic, you can decide to extend this angle evolution to 4PI as shown in the following drawing:
+
+@image html /tutorial/images/tutorial_image014.png
+@image latex /tutorial/images/tutorial_image014.png
+
+In this (U, V) parametric space, you will create a local (X, Y) coordinate system to position the curves to be created. This coordinate system will be defined with:
+
+ * A center located in the middle of the neck's cylinder parametric space at (2*PI, myNeckHeight / 2) in U, V coordinates.
+ * A X direction defined with the (2*PI, myNeckHeight/4) vector in U, V coordinates, so that the curves occupy half of the neck's surfaces.
+
+@image html /tutorial/images/tutorial_image015.png
+@image latex /tutorial/images/tutorial_image015.png
+
+To use 2D primitive geometry types of Open CASCADE Technology for defining a point and a coordinate system, you will once again instantiate classes from gp:
+
+ * To define a 2D point from its X and Y coordinates, use the *gp_Pnt2d* class.
+ * To define a 2D direction (unit vector) from its X and Y coordinates, use the gp_Dir2d class. The coordinates will automatically be normalized.
+ * To define a 2D right-handed coordinate system, use the *gp_Ax2d* class, which is computed from a point (origin of the coordinate system) and a direction - the X direction of the coordinate system. The Y direction will be automatically computed.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ gp_Pnt2d aPnt(2. * M_PI, myNeckHeight / 2.);
+ gp_Dir2d aDir(2. * M_PI, myNeckHeight / 4.);
+ gp_Ax2d anAx2d(aPnt, aDir);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You will now define the curves. As previously mentioned, these thread profiles are computed on two cylindrical surfaces. In the following figure, curves on the left define the base (on *aCyl1* surface) and the curves on the right define the top of the thread's shape (on *aCyl2* surface).
+
+@image html /tutorial/images/tutorial_image016.png
+@image latex /tutorial/images/tutorial_image016.png
+
+You have already used the *Geom* package to define 3D geometric entities. For 2D, you will use the *Geom2d* package. As for *Geom*, all geometries are parameterized. For example, a *Geom2d_Ellipse* ellipse is defined from:
+
+ * a coordinate system whose origin is the ellipse center;
+ * a major radius on the major axis defined by the X direction of the coordinate system;
+ * a minor radius on the minor axis defined by the Y direction of the coordinate system.
+
+Supposing that:
+
+ * Both ellipses have the same major radius of 2*PI,
+ * Minor radius of the first ellipse is myNeckHeight / 10,
+ * And the minor radius value of the second ellipse is a fourth of the first one,
+
+Your ellipses are defined as follows:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ Standard_Real aMajor = 2. * M_PI;
+ Standard_Real aMinor = myNeckHeight / 10;
+ Handle(Geom2d_Ellipse) anEllipse1 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor);
+ Handle(Geom2d_Ellipse) anEllipse2 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor / 4);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To describe portions of curves for the arcs drawn above, you define *Geom2d_TrimmedCurve* trimmed curves out of the created ellipses and two parameters to limit them.
+As the parametric equation of an ellipse is P(U) = O + (MajorRadius * cos(U) * XDirection) + (MinorRadius * sin(U) * YDirection), the ellipses need to be limited between 0 and M_PI.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ Handle(Geom2d_TrimmedCurve) anArc1 = new Geom2d_TrimmedCurve(anEllipse1, 0, M_PI);
+ Handle(Geom2d_TrimmedCurve) anArc2 = new Geom2d_TrimmedCurve(anEllipse2, 0, M_PI);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The last step consists in defining the segment, which is the same for the two profiles: a line limited by the first and the last point of one of the arcs.
+To access the point corresponding to the parameter of a curve or a surface, you use the Value or D0 method (meaning 0th derivative), D1 method is for first derivative, D2 for the second one.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ gp_Pnt2d anEllipsePnt1 = anEllipse1->Value(0);
+ gp_Pnt2d anEllipsePnt2;
+ anEllipse1->D0(M_PI, anEllipsePnt2);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+When creating the bottle's profile, you used classes from the *GC* package, providing algorithms to create elementary geometries.
+In 2D geometry, this kind of algorithms is found in the *GCE2d* package. Class names and behaviors are similar to those in *GC*. For example, to create a 2D segment out of two points:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ Handle(Geom2d_TrimmedCurve) aSegment = GCE2d_MakeSegment(anEllipsePnt1, anEllipsePnt2);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@subsection OCCT_TUTORIAL_SUB4_3 Building Edges and Wires
+
+
+As you did when creating the base profile of the bottle, you can now:
+
+ * compute the edges of the neck's threading.
+ * compute two wires out of these edges.
+
+@image html /tutorial/images/tutorial_image017.png
+@image latex /tutorial/images/tutorial_image017.png
+
+Previously, you have built:
+
+ * two cylindrical surfaces of the threading
+ * three 2D curves defining the base geometry of the threading
+
+To compute the edges out of these curves, once again use the *BRepBuilderAPI_MakeEdge* class. One of its constructors allows you to build an edge out of a curve described in the 2D parametric space of a surface.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ TopoDS_Edge anEdge1OnSurf1 = BRepBuilderAPI_MakeEdge(anArc1, aCyl1);
+ TopoDS_Edge anEdge2OnSurf1 = BRepBuilderAPI_MakeEdge(aSegment, aCyl1);
+ TopoDS_Edge anEdge1OnSurf2 = BRepBuilderAPI_MakeEdge(anArc2, aCyl2);
+ TopoDS_Edge anEdge2OnSurf2 = BRepBuilderAPI_MakeEdge(aSegment, aCyl2);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Now, you can create the two profiles of the threading, lying on each surface.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ TopoDS_Wire threadingWire1 = BRepBuilderAPI_MakeWire(anEdge1OnSurf1, anEdge2OnSurf1);
+ TopoDS_Wire threadingWire2 = BRepBuilderAPI_MakeWire(anEdge1OnSurf2, anEdge2OnSurf2);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Remember that these wires were built out of a surface and 2D curves.
+One important data item is missing as far as these wires are concerned: there is no information on the 3D curves. Fortunately, you do not need to compute this yourself, which can be a difficult task since the mathematics can be quite complex.
+When a shape contains all the necessary information except 3D curves, Open CASCADE Technology provides a tool to build them automatically. In the BRepLib tool package, you can use the *BuildCurves3d* method to compute 3D curves for all the edges of a shape.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ BRepLib::BuildCurves3d(threadingWire1);
+ BRepLib::BuildCurves3d(threadingWire2);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@subsection OCCT_TUTORIAL_SUB4_4 Creating Threading
+
+
+You have computed the wires of the threading. The threading will be a solid shape, so you must now compute the faces of the wires, the faces allowing you to join the wires, the shell out of these faces and then the solid itself. This can be a lengthy operation.
+There are always faster ways to build a solid when the base topology is defined. You would like to create a solid out of two wires. Open CASCADE Technology provides a quick way to do this by building a loft: a shell or a solid passing through a set of wires in a given sequence.
+The loft function is implemented in the *BRepOffsetAPI_ThruSections* class, which you use as follows:
+
+@image html /tutorial/images/tutorial_image018.png
+@image latex /tutorial/images/tutorial_image018.png
+
+ * Initialize the algorithm by creating an instance of the class. The first parameter of this constructor must be specified if you want to create a solid. By default, *BRepOffsetAPI_ThruSections* builds a shell.
+ * Add the successive wires using the AddWire method.
+ * Use the *CheckCompatibility* method to activate (or deactivate) the option that checks whether the wires have the same number of edges. In this case, wires have two edges each, so you can deactivate this option.
+ * Ask for the resulting loft shape with the Shape method.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ BRepOffsetAPI_ThruSections aTool(Standard_True);
+ aTool.AddWire(threadingWire1); aTool.AddWire(threadingWire2);
+ aTool.CheckCompatibility(Standard_False);
+ TopoDS_Shape myThreading = aTool.Shape();
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@section sec5 Building the Resulting Compound
+
+
+You are almost done building the bottle. Use the *TopoDS_Compound* and *BRep_Builder* classes to build single shape from *myBody* and *myThreading*:
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ TopoDS_Compound aRes;
+ BRep_Builder aBuilder;
+ aBuilder.MakeCompound (aRes);
+ aBuilder.Add (aRes, myBody);
+ aBuilder.Add (aRes, myThreading);
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Congratulations! Your bottle is complete. Here is the result snapshot of the Tutorial application:
+
+@image html /tutorial/images/tutorial_image019.png
+@image latex /tutorial/images/tutorial_image019.png
+
+We hope that this tutorial has provided you with a feel for the industrial strength power of Open CASCADE Technology.
+If you want to know more and develop major projects using Open CASCADE Technology, we invite you to study our training, support, and consulting services on our site at http://www.opencascade.org/support. Our professional services can maximize the power of your Open CASCADE Technology applications.
+
+
+@section sec6 Appendix
+
+
+Complete definition of MakeBottle function (defined in the file src/MakeBottle.cxx of the Tutorial):
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ TopoDS_Shape MakeBottle(const Standard_Real myWidth, const Standard_Real myHeight,
+ const Standard_Real myThickness)
+ {
+ // Profile : Define Support Points
+ gp_Pnt aPnt1(-myWidth / 2., 0, 0);
+ gp_Pnt aPnt2(-myWidth / 2., -myThickness / 4., 0);
+ gp_Pnt aPnt3(0, -myThickness / 2., 0);
+ gp_Pnt aPnt4(myWidth / 2., -myThickness / 4., 0);
+ gp_Pnt aPnt5(myWidth / 2., 0, 0);
+
+ // Profile : Define the Geometry
+ Handle(Geom_TrimmedCurve) anArcOfCircle = GC_MakeArcOfCircle(aPnt2,aPnt3,aPnt4);
+ Handle(Geom_TrimmedCurve) aSegment1 = GC_MakeSegment(aPnt1, aPnt2);
+ Handle(Geom_TrimmedCurve) aSegment2 = GC_MakeSegment(aPnt4, aPnt5);
+
+ // Profile : Define the Topology
+ TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge(aSegment1);
+ TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(anArcOfCircle);
+ TopoDS_Edge anEdge3 = BRepBuilderAPI_MakeEdge(aSegment2);
+ TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(anEdge1, anEdge2, anEdge3);
+
+ // Complete Profile
+ gp_Ax1 xAxis = gp::OX();
+ gp_Trsf aTrsf;
+
+ aTrsf.SetMirror(xAxis);
+ BRepBuilderAPI_Transform aBRepTrsf(aWire, aTrsf);
+ TopoDS_Shape aMirroredShape = aBRepTrsf.Shape();
+ TopoDS_Wire aMirroredWire = TopoDS::Wire(aMirroredShape);
+
+ BRepBuilderAPI_MakeWire mkWire;
+ mkWire.Add(aWire);
+ mkWire.Add(aMirroredWire);
+ TopoDS_Wire myWireProfile = mkWire.Wire();
+
+ // Body : Prism the Profile
+ TopoDS_Face myFaceProfile = BRepBuilderAPI_MakeFace(myWireProfile);
+ gp_Vec aPrismVec(0, 0, myHeight);
+ TopoDS_Shape myBody = BRepPrimAPI_MakePrism(myFaceProfile, aPrismVec);
+
+ // Body : Apply Fillets
+ BRepFilletAPI_MakeFillet mkFillet(myBody);
+ TopExp_Explorer anEdgeExplorer(myBody, TopAbs_EDGE);
+ while(anEdgeExplorer.More()){
+ TopoDS_Edge anEdge = TopoDS::Edge(anEdgeExplorer.Current());
+ //Add edge to fillet algorithm
+ mkFillet.Add(myThickness / 12., anEdge);
+ anEdgeExplorer.Next();
+ }
+
+ myBody = mkFillet.Shape();
+
+ // Body : Add the Neck
+ gp_Pnt neckLocation(0, 0, myHeight);
+ gp_Dir neckAxis = gp::DZ();
+ gp_Ax2 neckAx2(neckLocation, neckAxis);
+
+ Standard_Real myNeckRadius = myThickness / 4.;
+ Standard_Real myNeckHeight = myHeight / 10.;
+
+ BRepPrimAPI_MakeCylinder MKCylinder(neckAx2, myNeckRadius, myNeckHeight);
+ TopoDS_Shape myNeck = MKCylinder.Shape();
+
+ myBody = BRepAlgoAPI_Fuse(myBody, myNeck);
+
+ // Body : Create a Hollowed Solid
+ TopoDS_Face faceToRemove;
+ Standard_Real zMax = -1;
+
+ for(TopExp_Explorer aFaceExplorer(myBody, TopAbs_FACE); aFaceExplorer.More(); aFaceExplorer.Next()){
+ TopoDS_Face aFace = TopoDS::Face(aFaceExplorer.Current());
+ // Check if <aFace> is the top face of the bottle's neck
+ Handle(Geom_Surface) aSurface = BRep_Tool::Surface(aFace);
+ if(aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)){
+ Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast(aSurface);
+ gp_Pnt aPnt = aPlane->Location();
+ Standard_Real aZ = aPnt.Z();
+ if(aZ > zMax){
+ zMax = aZ;
+ faceToRemove = aFace;
+ }
+ }
+ }
+
+ TopTools_ListOfShape facesToRemove;
+ facesToRemove.Append(faceToRemove);
+ myBody = BRepOffsetAPI_MakeThickSolid(myBody, facesToRemove, -myThickness / 50, 1.e-3);
+ // Threading : Create Surfaces
+ Handle(Geom_CylindricalSurface) aCyl1 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 0.99);
+ Handle(Geom_CylindricalSurface) aCyl2 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 1.05);
+
+ // Threading : Define 2D Curves
+ gp_Pnt2d aPnt(2. * M_PI, myNeckHeight / 2.);
+ gp_Dir2d aDir(2. * M_PI, myNeckHeight / 4.);
+ gp_Ax2d anAx2d(aPnt, aDir);
+
+ Standard_Real aMajor = 2. * M_PI;
+ Standard_Real aMinor = myNeckHeight / 10;
+
+ Handle(Geom2d_Ellipse) anEllipse1 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor);
+ Handle(Geom2d_Ellipse) anEllipse2 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor / 4);
+ Handle(Geom2d_TrimmedCurve) anArc1 = new Geom2d_TrimmedCurve(anEllipse1, 0, M_PI);
+ Handle(Geom2d_TrimmedCurve) anArc2 = new Geom2d_TrimmedCurve(anEllipse2, 0, M_PI);
+ gp_Pnt2d anEllipsePnt1 = anEllipse1->Value(0);
+ gp_Pnt2d anEllipsePnt2 = anEllipse1->Value(M_PI);
+
+ Handle(Geom2d_TrimmedCurve) aSegment = GCE2d_MakeSegment(anEllipsePnt1, anEllipsePnt2);
+ // Threading : Build Edges and Wires
+ TopoDS_Edge anEdge1OnSurf1 = BRepBuilderAPI_MakeEdge(anArc1, aCyl1);
+ TopoDS_Edge anEdge2OnSurf1 = BRepBuilderAPI_MakeEdge(aSegment, aCyl1);
+ TopoDS_Edge anEdge1OnSurf2 = BRepBuilderAPI_MakeEdge(anArc2, aCyl2);
+ TopoDS_Edge anEdge2OnSurf2 = BRepBuilderAPI_MakeEdge(aSegment, aCyl2);
+ TopoDS_Wire threadingWire1 = BRepBuilderAPI_MakeWire(anEdge1OnSurf1, anEdge2OnSurf1);
+ TopoDS_Wire threadingWire2 = BRepBuilderAPI_MakeWire(anEdge1OnSurf2, anEdge2OnSurf2);
+ BRepLib::BuildCurves3d(threadingWire1);
+ BRepLib::BuildCurves3d(threadingWire2);
+
+ // Create Threading
+ BRepOffsetAPI_ThruSections aTool(Standard_True);
+ aTool.AddWire(threadingWire1);
+ aTool.AddWire(threadingWire2);
+ aTool.CheckCompatibility(Standard_False);
+
+ TopoDS_Shape myThreading = aTool.Shape();
+
+ // Building the Resulting Compound
+ TopoDS_Compound aRes;
+ BRep_Builder aBuilder;
+ aBuilder.MakeCompound (aRes);
+ aBuilder.Add (aRes, myBody);
+ aBuilder.Add (aRes, myThreading);
+
+ return aRes;
+ }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- /dev/null
+Draw Test Harness {#user_guides__test_harness}
+===============================
+
+@tableofcontents
+
+@section occt_draw_1 Introduction
+
+This manual explains how to use Draw, the test harness for Open CASCADE Technology (**OCCT**). It provides basic documentation on using Draw. For advanced information on Draw and its applications, see our offerings on our web site at <a href="http://www.opencascade.org/support/training">http://www.opencascade.org/support/training</a>
+
+Draw is a command interpreter based on TCL and a graphical system used to test and demonstrate Open CASCADE Technology modeling libraries.
+
+
+@subsection occt_draw_1_1 Overview
+
+Draw is a test harness for Open CASCADE Technology. It provides a flexible and easy to use means of testing and demonstrating the OCCT modeling libraries.
+
+Draw can be used interactively to create, display and modify objects such as curves, surfaces and topological shapes.
+
+Scripts may be written to customize Draw and perform tests. New types of objects and new commands may be added using the C++ programing language.
+
+Draw consists of:
+
+ * A command interpreter based on the TCL command language.
+ * A 3d graphic viewer based on the X system.
+ * A basic set of commands covering scripts, variables and graphics.
+ * A set of geometric commands allowing the user to create and modify curves and surfaces and to use OCCT geometry algorithms. This set of commands is optional.
+ * A set of topological commands allowing the user to create and modify BRep shapes and to use the OCCT topology algorithms.
+
+
+There is also a set of commands for each delivery unit in the modeling libraries:
+
+ * GEOMETRY,
+ * TOPOLOGY,
+ * ADVALGOS,
+ * GRAPHIC,
+ * PRESENTATION.
+
+
+@subsection occt_draw_1_2 Contents of this documentation
+
+This documentation describes:
+
+ * The command language.
+ * The basic set of commands.
+ * The graphical commands.
+ * The Geometry set of commands.
+ * The Topology set of commands.
+
+This document does not describe other sets of commands and does not explain how to extend Draw using C++.
+
+This document is a reference manual. It contains a full description of each command. All descriptions have the format illustrated below for the exit command.
+
+~~~~~
+exit
+~~~~~
+
+Terminates the Draw, TCL session. If the commands are read from a file using the source command, this will terminate the file.
+
+**Example:**
+
+~~~~~
+# this is a very short example
+exit
+~~~~~
+
+
+@subsection occt_draw_1_3 Getting started
+
+Install Draw and launch Emacs. Get a command line in Emacs using *Esc x *and key in *woksh*.
+
+All DRAW Test Harness can be activated in the common executable called **DRAWEXE**. They are grouped in toolkits and can be loaded at run-time thereby implementing dynamically loaded plug-ins. Thus, it is possible to work only with the required commands adding them dynamically without leaving the Test Harness session.
+
+Declaration of available plug-ins is done through the special resource file(s). The *pload* command loads the plug-in in accordance with the specified resource file and activates the commands implemented in the plug-in.
+
+@subsubsection occt_draw_1_3_1 Launching DRAW Test Harness
+
+Test Harness executable *DRAWEXE* is located in the <i>$CASROOT/<platform>/bin</i> directory (where <platform> is Win for Windows and Linux for Linux operating systems). Prior to launching it is important to make sure that the environment is correctly set-up (usually this is done automatically after the installation process on Windows or after launching specific scripts on Linux).
+
+
+@subsubsection occt_draw_1_3_2 Plug-in resource file
+
+Open CASCADE Technology is shipped with the DrawPlugin resource file located in the <i>$CASROOT/src/DrawResources</i> directory.
+
+The format of the file is compliant with standard Open CASCADE Technology resource files (see the *Resource_Manager.cdl* file for details).
+
+Each key defines a sequence of either further (nested) keys or a name of the dynamic library. Keys can be nested down to an arbitrary level. However, cyclic dependencies between the keys are not checked.
+
+**Example:** (excerpt from DrawPlugin):
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+OCAF : VISUALIZATION, OCAFKERNEL
+VISUALIZATION : AISV
+OCAFKERNEL : DCAF
+
+DCAF : TKDCAF
+AISV : TKViewerTest
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@subsubsection occt_draw_1_3_3 Activation of commands implemented in the plug-in
+
+To load a plug-in declared in the resource file and to activate the commands the following command must be used in Test Harness:
+
+~~~~~
+pload [-PluginFileName] [[Key1] [Key2]...]
+~~~~~
+
+, where:
+
+* *-PluginFileName* - defines the name of a plug-in resource file (prefix "-" is mandatory) described above.
+If this parameter is omitted then the default name DrawPlugin is used.
+* *Key…* - defines the key(s) enumerating plug-ins to be loaded. If no keys are specified then the key named *DEFAULT* is used (if there is no such key in the file then no plug-ins are loaded).
+
+According to the OCCT resource file management rules, to access the resource file the environment variable *CSF_PluginFileNameDefaults* (and optionally *CSF_PluginFileNameUserDefaults*) must be set and point to the directory storing the resource file. If it is omitted then the plug-in resource file will be searched in the <i>$CASROOT/src/DrawResources</i> directory.
+
+~~~~~
+Draw[] pload -DrawPlugin OCAF
+~~~~~
+This command will search the resource file *DrawPlugin* using variable *CSF_DrawPluginDefaults* (and *CSF_DrawPluginUserDefaults*) and will start with the OCAF key. Since the *DrawPlugin* is the file shipped with Open CASCADE Technology it will be found in the <i>$CASROOT/src/DrawResources</i> directory (unless this location is redefined by user's variables). The OCAF key will be recursively extracted into two toolkits/plug-ins: *TKDCAF* and *TKViewerTest* (e.g. on Windows they correspond to *TKDCAF.dll* and *TKViewerTest.dll*). Thus, commands implemented for Visualization and OCAF will be loaded and activated in Test Harness.
+
+~~~~~
+Draw[] pload (equivalent to pload -DrawPlugin DEFAULT).
+~~~~~
+This command will find the default DrawPlugin file and the DEFAULT key. The latter finally maps to the TKTopTest toolkit which implements basic modeling commands.
+
+
+@section occt_draw_2 The Command Language
+
+@subsection occt_draw_2_1 Overview
+
+The command language used in Draw is Tcl. Tcl documentation such as "TCL and the TK Toolkit" by John K. Ousterhout (Addison-Wesley) will prove useful if you intend to use Draw extensively.
+
+This chapter is designed to give you a short outline of both the TCL language and some extensions included in Draw. The following topics are covered:
+
+ * Syntax of the TCL language.
+ * Accessing variables in TCL and Draw.
+ * Control structures.
+ * Procedures.
+
+@subsection occt_draw_2_2 Syntax of TCL
+
+TCL is an interpreted command language, not a structured language like C, Pascal, LISP or Basic. It uses a shell similar to that of csh. TCL is, however, easier to use than csh because control structures and procedures are easier to define. As well, because TCL does not assign a process to each command, it is faster than csh.
+
+The basic program for TCL is a script. A script consists of one or more commands. Commands are separated by new lines or semicolons.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+set a 24
+set b 15
+set a 25; set b 15
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Each command consists of one or more *words*; the first word is the name of a command and additional words are arguments to that command.
+
+Words are separated by spaces or tabs. In the preceding example each of the four commands has three words. A command may contain any number of words and each word is a string of arbitrary length.
+
+The evaluation of a command by TCL is done in two steps. In the first step, the command is parsed and broken into words. Some substitutions are also performed. In the second step, the command procedure corresponding to the first word is called and the other words are interpreted as arguments. In the first step, there is only string manipulation, The words only acquire *meaning* in the second step by the command procedure.
+
+The following substitutions are performed by TCL:
+
+Variable substitution is triggered by the $ character (as with csh), the content of the variable is substitued; { } may be used as in csh to enclose the name of the variable.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# set a variable value
+set file documentation
+puts $file #to display file contents on the screen
+
+# a simple substitution, set psfile to documentation.ps
+set psfile $file.ps
+puts $psfile
+
+# another substitution, set pfile to documentationPS
+set pfile ${file}PS
+
+# a last one,
+# delete files NEWdocumentation and OLDdocumentation
+foreach prefix {NEW OLD} {rm $prefix$file}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Command substitution is triggered by the [ ] characters. The brackets must enclose a valid script. The script is evaluated and the result is substituted.
+
+Compare command construction in csh.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+set degree 30
+set pi 3.14159265
+# expr is a command evaluating a numeric expression
+set radian [expr $pi*$degree/180]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Backslash substitution is triggered by the backslash character. It is used to insert special characters like $, [ , ] , etc. It is also useful to insert a new line, a backslash terminated line is continued on the following line.
+
+TCL uses two forms of *quoting* to prevent substitution and word breaking.
+
+Double quote *quoting* enables the definition of a string with space and tabs as a single word. Substitutions are still performed inside the inverted commas " ".
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# set msg to ;the price is 12.00;
+set price 12.00
+set msg ;the price is $price;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Braces *quoting* prevents all substitutions. Braces are also nested. The main use of braces is to defer evaluation when defining procedures and control structures. Braces are used for a clearer presentation of TCL scripts on several lines.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+set x 0
+# this will loop for ever
+# because while argument is ;0 3;
+while ;$x 3; {set x [expr $x+1]}
+# this will terminate as expected because
+# while argument is {$x 3}
+while {$x 3} {set x [expr $x+1]}
+# this can be written also
+while {$x 3} {
+set x [expr $x+1]
+}
+# the following cannot be written
+# because while requires two arguments
+while {$x 3}
+{
+set x [expr $x+1]
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Comments start with a \# character as the first non-blank character in a command. To add a comment at the end of the line, the comment must be preceded by a semi-colon to end the preceding command.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# This is a comment
+set a 1 # this is not a comment
+set b 1; # this is a comment
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The number of words is never changed by substitution when parsing in TCL. For example, the result of a substitution is always a single word. This is different from csh but convenient as the behavior of the parser is more predictable. It may sometimes be necessary to force a second round of parsing. **eval** accomplishes this: it accepts several arguments, concatenates them and executes the resulting script.
+
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# I want to delete two files
+
+set files ;foo bar;
+
+# this will fail because rm will receive only one argument
+# and complain that ;foo bar; does not exit
+
+exec rm $files
+
+# a second evaluation will do it
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@subsection occt_draw_2_3 Accessing variables in TCL and Draw
+
+TCL variables have only string values. Note that even numeric values are stored as string literals, and computations using the **expr** command start by parsing the strings. Draw, however, requires variables with other kinds of values such as curves, surfaces or topological shapes.
+
+TCL provides a mechanism to link user data to variables. Using this functionality, Draw defines its variables as TCL variables with associated data.
+
+The string value of a Draw variable is meaningless. It is usually set to the name of the variable itself. Consequently, preceding a Draw variable with a *$* does not change the result of a command. The content of a Draw variable is accessed using appropriate commands.
+
+There are many kinds of Draw variables, and new ones may be added with C++. Geometric and topological variables are described below.
+
+Draw numeric variables can be used within an expression anywhere a Draw command requires a numeric value. The **expr** command is useless in this case as the variables are stored not as strings but as floating point values.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# dset is used for numeric variables
+# pi is a predefined Draw variable
+dset angle pi/3 radius 10
+point p radius*cos(angle) radius*sin(angle) 0
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+It is recommended that you use TCL variables only for strings and Draw for numerals. That way, you will avoid the **expr** command. As a rule, Geometry and Topology require numbers but no strings.
+
+@subsubsection occt_draw_2_3_1 set, unset
+
+Syntax:
+
+~~~~~
+set varname [value]
+unset varname [varname varname ...]
+~~~~~
+
+**set** assigns a string value to a variable. If the variable does not already exist, it is created.
+
+Without a value, **set** returns the content of the variable.
+
+**unset** deletes variables. It is is also used to delete Draw variables.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+set a "Hello world"
+set b "Goodbye"
+set a
+== "Hello world"
+unset a b
+set a
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+**Note**, that the *set* command can set only one variable, unlike the *dset* command.
+
+
+@subsubsection occt_draw_2_3_2 dset, dval
+
+Syntax
+
+~~~~~
+dset var1 value1 vr2 value2 ...
+dval name
+~~~~~
+
+*dset* assigns values to Draw numeric variables. The argument can be any numeric expression including Draw numeric variables. Since all Draw commands expect a numeric expression, there is no need to use $ or *expr*. The *dset* command can assign several variables. If there is an odd number of arguments, the last variable will be assigned a value of 0. If the variable does not exist, it will be created.
+
+*dval* evaluates an expression containing Draw numeric variables and returns the result as a string, even in the case of a single variable. This is not used in Draw commands as these usually interpret the expression. It is used for basic TCL commands expecting strings.
+
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# z is set to 0
+dset x 10 y 15 z
+== 0
+
+# no $ required for Draw commands
+point p x y z
+
+# *puts* prints a string
+puts ;x = [dval x], cos(x/pi) = [dval cos(x/pi)];
+== x = 10, cos(x/pi) = -0.99913874099467914
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+**Note,** that in TCL, parentheses are not considered to be special characters. Do not forget to quote an expression if it contains spaces in order to avoid parsing different words. <i>(a + b)</i> is parsed as three words: <i>"(a + b)"</i> or <i>(a+b)</i> are correct.*
+
+
+@subsection occt_draw_2_4 lists
+
+TCL uses lists. A list is a string containing elements separated by spaces or tabs. If the string contains braces, the braced part accounts as one element.
+
+This allows you to insert lists within lists.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# a list of 3 strings
+;a b c;
+
+# a list of two strings the first is a list of 2
+;{a b} c;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Many TCL commands return lists and **foreach** is a useful way to create loops on list elements.
+
+@subsubsection occt_draw_2_5 Control Structures
+
+TCL allows looping using control structures. The control structures are implemented by commands and their syntax is very similar to that of their C counterparts (**if**, **while**, **switch**, etc.). In this case, there are two main differences between TCL and C:
+
+* You use braces instead of parentheses to enclose conditions.
+* You do not start the script on the next line of your command.
+
+
+@subsubsection occt_draw_2_5_1 if
+
+Syntax
+
+~~~~~
+if condition script [elseif script .... else script]
+~~~~~
+
+**If** evaluates the condition and the script to see whether the condition is true.
+
+
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+if {$x 0} {
+puts ;positive;
+} elseif {$x == 0} {
+puts ;null;
+} else {
+puts ;negative;
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@subsubsection occt_draw_2_5_2 while, for, foreach
+
+Syntax:
+
+
+~~~~~~
+while condition script
+for init condition reinit script
+foreach varname list script
+~~~~~
+
+The three loop structures are similar to their C or csh equivalent. It is important to use braces to delay evaluation. **foreach** will assign the elements of the list to the variable before evaluating the script. \
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# while example
+dset x 1.1
+while {[dval x] 100} {
+ circle c 0 0 x
+ dset x x*x
+}
+# for example
+# incr var d, increments a variable of d (default 1)
+for {set i 0} {$i 10} {incr i} {
+ dset angle $i*pi/10
+ point p$i cos(angle0 sin(angle) 0
+}
+# foreach example
+foreach object {crapo tomson lucas} {display $object}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@subsubsection occt_draw_2_5_3 break, continue
+
+Syntax:
+
+~~~~~
+break
+continue
+~~~~~
+
+Within loops, the **break** and **continue** commands have the same effect as in C.
+
+**break** interrupts the innermost loop and **continue** jumps to the next iteration.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# search the index for which t$i has value ;secret;
+for {set i 1} {$i = 100} {incr i} {
+ if {[set t$i] == ;secret;} break;
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@subsection occt_draw_2_6 Procedures
+
+TCL can be extended by defining procedures using the **proc** command, which sets up a context of local variables, binds arguments and executes a TCL script.
+
+The only problematic aspect of procedures is that variables are strictly local, and as they are implicitly created when used, it may be difficult to detect errors.
+
+There are two means of accessing a variable outside the scope of the current procedures: **global** declares a global variable (a variable outside all procedures); **upvar** accesses a variable in the scope of the caller. Since arguments in TCL are always string values, the only way to pass Draw variables is by reference, i.e. passing the name of the variable and using the **upvar** command as in the following examples.
+
+As TCL is not a strongly typed language it is very difficult to detect programming errors and debugging can be tedious. TCL procedures are, of course, not designed for large scale software development but for testing and simple command or interactive writing.
+
+
+@subsubsection occt_draw_2_6_1 proc
+
+Syntax:
+
+~~~~~
+proc argumentlist script
+~~~~~
+
+**proc** defines a procedure. An argument may have a default value. It is then a list of the form {argument value}. The script is the body of the procedure.
+
+**return** gives a return value to the procedure.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# simple procedure
+proc hello {} {
+ puts ;hello world;
+}
+# procedure with arguments and default values
+proc distance {x1 y1 {x2 0} {y2 0}} {
+ set d [expr (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)]
+ return [expr sqrt(d)]
+}
+proc fact n {
+ if {$n == 0} {return 1} else {
+ return [expr n*[fact [expr n -1]]]
+ }
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@subsubsection occt_draw_2_6_2 global, upvar
+
+Syntax:
+
+~~~~~
+global varname [varname ...]
+upvar varname localname [varname localname ...]
+~~~~~
+
+
+**global** accesses high level variables. Unlike C, global variables are not visible in procedures.
+
+**upvar** gives a local name to a variable in the caller scope. This is useful when an argument is the name of a variable instead of a value. This is a call by reference and is the only way to use Draw variables as arguments.
+
+**Note** that in the following examples the \$ character is always necessarily used to access the arguments.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# convert degree to radian
+# pi is a global variable
+proc deg2rad (degree} {
+ return [dval pi*$degree/2.]
+}
+# create line with a point and an angle
+proc linang {linename x y angle} {
+ upvar linename l
+ line l $x $y cos($angle) sin($angle)
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@section occt_draw_3 Basic Commands
+
+This chapter describes all the commands defined in the basic Draw package. Some are TCL commands, but most of them have been formulated in Draw. These commands are found in all Draw applications. The commands are grouped into four sections:
+
+ * General commands, which are used for Draw and TCL management.
+ * Variable commands, which are used to manage Draw variables such as storing and dumping.
+ * Graphic commands, which are used to manage the graphic system, and so pertain to views.
+ * Variable display commands, which are used to manage the display of objects within given views.
+
+Note that Draw also features a GUI task bar providing an alternative way to give certain general, graphic and display commands
+
+
+@subsection occt_draw_3_1 General commands
+
+This section describes several useful commands:
+
+ * **help** to get information,
+ * **source** to eval a script from a file,
+ * **spy** to capture the commands in a file,
+ * **cpulimit** to limit the process cpu time,
+ * **wait** to waste some time,
+ * **chrono** to time commands.
+
+@subsubsection occt_draw_3_1_1 help
+
+Syntax:
+
+~~~~~
+help [command [helpstring group]]
+~~~~~
+
+Provides help or modifies the help information.
+
+**help** without arguments lists all groups and the commands in each group.
+
+Specifying the command returns its syntax and in some cases, information on the command, The joker \* is automatically added at the end so that all completing commands are returned as well.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# Gives help on all commands starting with *a*
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@subsubsection occt_draw_3_1_2 source
+
+Syntax:
+
+~~~~~
+source filename
+~~~~~
+Executes a file.
+
+The **exit** command will terminate the file.
+
+@subsubsection occt_draw_3_1_3 spy
+
+Syntax:
+
+~~~~~
+spy [filename]
+~~~~~
+
+Saves interactive commands in the file. If spying has already been performed, the current file is closed. **spy** without an argument closes the current file and stops spying. If a file already exists, the file is overwritten. Commands are not appended.
+
+If a command returns an error it is saved with a comment mark.
+
+The file created by **spy** can be executed with the **source** command.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# all commands will be saved in the file ;session;
+spy session
+# the file ;session; is closed and commands are not saved
+spy
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+
+@subsubsection occt_draw_3_1_4 cpulimit
+
+Syntax:
+
+~~~~~
+cpulimit [nbseconds]
+~~~~~
+
+**cpulimit**limits a process after the number of seconds specified in nbseconds. It is used in tests to avoid infinite loops. **cpulimit** without arguments removes all existing limits.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+#limit cpu to one hour
+cpulimit 3600
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@subsubsection occt_draw_3_1_5 wait
+
+Syntax:
+~~~~~
+wait [nbseconds]
+~~~~~
+Suspends execution for the number of seconds specified in *nbseconds*. The default value is ten (10) seconds. This is a useful command for a slide show.
+
+~~~~~
+# You have ten seconds ...
+wait
+~~~~~
+
+@subsubsection occt_draw_3_1_6 chrono
+
+Syntax:
+
+~~~~~
+chrono [ name start/stop/reset/show]
+~~~~~
+
+Without arguments, **chrono** activates Draw chronometers. The elapsed time ,cpu system and cpu user times for each command will be printed.
+
+With arguments, **chrono** is used to manage activated chronometers. You can perform the following actions with a chronometer.
+ * run the chronometer (start).
+ * stop the chronometer (stop).
+ * reset the chronometer to 0 (reset).
+ * display the current time (show).
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+chrono
+==Chronometers activated.
+ptorus t 20 5
+==Elapsed time: 0 Hours 0 Minutes 0.0318 Seconds
+==CPU user time: 0.01 seconds
+==CPU system time: 0 seconds
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@subsection occt_draw_3_2 Variable management commands
+
+@subsubsection occt_draw_3_2_1 isdraw, directory
+
+Syntax:
+~~~~~
+isdraw varname
+directory [pattern]
+~~~~~
+
+**isdraw** tests to see if a variable is a Draw variable. **isdraw** will return 1 if there is a Draw value attached to the variable.
+
+Use **directory** to return a list of all Draw global variables matching a pattern.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+set a 1
+isdraw a
+=== 0
+
+dset a 1
+isdraw a
+=== 1
+
+circle c 0 0 1 0 5
+isdraw c
+=== 1
+
+# to destroy all Draw objects with name containing curve
+foreach var [directory *curve*] {unset $var}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@subsubsection occt_draw_3_2_2 whatis, dump
+
+Syntax:
+
+~~~~~
+whatis varname [varname ...]
+dump varname [varname ...]
+~~~~~
+
+**whatis** returns short information about a Draw variable. This is usually the type name.
+
+**dump** returns a brief type description, the coordinates, and if need be, the parameters of a Draw variable.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+circle c 0 0 1 0 5
+whatis c
+c is a 2d curve
+
+dump c
+
+***** Dump of c *****
+Circle
+Center :0, 0
+XAxis :1, 0
+YAxis :-0, 1
+Radius :5
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+**Note** The behavior of *whatis* on other variables (not Draw) is not excellent.
+
+
+@subsubsection occt_draw_3_2_3 rename, copy
+
+Syntax:
+~~~~~
+rename varname tovarname [varname tovarname ...]
+copy varname tovarname [varname tovarname ...]
+~~~~~
+
+ * **rename** changes the name of a Draw variable. The original variable will no longer exist. Note that the content is not modified. Only the name is changed.
+ * **copy** creates a new variable with a copy of the content of an existing variable. The exact behavior of **copy** is type dependent; in the case of certain topological variables, the content may still be shared.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+circle c1 0 0 1 0 5
+rename c1 c2
+
+# curves are copied, c2 will not be modified
+copy c2 c3
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@subsubsection occt_draw_3_2_4 datadir, save, restore
+
+Syntax:
+~~~~~
+datadir [directory]
+save variable [filename]
+restore filename [variablename]
+~~~~~
+
+ * **datadir** without arguments prints the path of the current data directory.
+ * **datadir** with an argument sets the data directory path. \
+
+If the path starts with a dot (.) only the last directory name will be changed in the path.
+
+ * **save** writes a file in the data directory with the content of a variable. By default the name of the file is the name of the variable. To give a different name use a second argument.
+ * **restore** reads the content of a file in the data directory in a local variable. By default, the name of the variable is the name of the file. To give a different name, use a second argument.
+
+The exact content of the file is type-dependent. They are usually ASCII files and so, architecture independent.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# note how TCL accesses shell environment variables
+# using $env()
+datadir
+==.
+
+datadir $env(WBCONTAINER)/data/default
+==/adv_20/BAG/data/default
+
+box b 10 20 30
+save b theBox
+==/adv_20/BAG/data/default/theBox
+
+# when TCL does not find a command it tries a shell command
+ls [datadir]
+== theBox
+
+restore theBox
+== theBox
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@subsection occt_draw_3_3 User defined commands
+
+*DrawTrSurf* provides commands to create and display a Draw **geometric** variable from a Geom_Geometry object and also get a Geom_Geometry object from a Draw geometric variable name.
+
+*DBRep* provides commands to create and display a Draw **topological** variable from a TopoDS_Shape object and also get a TopoDS_Shape object from a Draw topological variable name.
+
+@subsubsection occt_draw_3_3_1 set
+
+#### In *DrawTrSurf* package:
+
+~~~~~
+void Set(Standard_CString& Name,const gp_Pnt& G) ;
+void Set(Standard_CString& Name,const gp_Pnt2d& G) ;
+void Set(Standard_CString& Name,
+const Handle(Geom_Geometry)& G) ;
+void Set(Standard_CString& Name,
+const Handle(Geom2d_Curve)& C) ;
+void Set(Standard_CString& Name,
+const Handle(Poly_Triangulation)& T) ;
+void Set(Standard_CString& Name,
+const Handle(Poly_Polygon3D)& P) ;
+void Set(Standard_CString& Name,
+const Handle(Poly_Polygon2D)& P) ;
+~~~~~
+
+#### In *DBRep* package:
+
+~~~~~
+void Set(const Standard_CString Name,
+const TopoDS_Shape& S) ;
+~~~~~
+
+Example of *DrawTrSurf*
+
+~~~~~
+Handle(Geom2d_Circle) C1 = new Geom2d_Circle
+(gce_MakeCirc2d (gp_Pnt2d(50,0,) 25));
+DrawTrSurf::Set(char*, C1);
+~~~~~
+
+Example of *DBRep*
+
+~~~~~
+TopoDS_Solid B;
+B = BRepPrimAPI_MakeBox (10,10,10);
+DBRep::Set(char*,B);
+~~~~~
+
+@subsubsection occt_draw_3_3_2 get
+
+#### In *DrawTrSurf* package:
+
+~~~~~
+Handle_Geom_Geometry Get(Standard_CString& Name) ;
+~~~~~
+
+#### In *DBRep* package:
+
+~~~~~
+TopoDS_Shape Get(Standard_CString& Name,
+const TopAbs_ShapeEnum Typ = TopAbs_SHAPE,
+const Standard_Boolean Complain
+= Standard_True) ;
+~~~~~
+
+Example of *DrawTrSurf*
+
+~~~~~
+Standard_Integer MyCommand
+(Draw_Interpretor& theCommands,
+Standard_Integer argc, char** argv)
+{......
+// Creation of a Geom_Geometry from a Draw geometric
+// name
+Handle (Geom_Geometry) aGeom= DrawTrSurf::Get(argv[1]);
+}
+~~~~~
+
+Example of *DBRep*
+
+~~~~~
+Standard_Integer MyCommand
+(Draw_Interpretor& theCommands,
+Standard_Integer argc, char** argv)
+{......
+// Creation of a TopoDS_Shape from a Draw topological
+// name
+TopoDS_Solid B = DBRep::Get(argv[1]);
+}
+~~~~~
+
+@section occt_draw_4 Graphic Commands
+
+Graphic commands are used to manage the Draw graphic system. Draw provides a 2d and a 3d viewer with up to 30 views. Views are numbered and the index of the view is displayed in the window’s title. Objects are displayed in all 2d views or in all 3d views, depending on their type. 2d objects can only be viewed in 2d views while 3d objects – only in 3d views correspondingly.
+
+@subsection occt_draw_4_1 Axonometric viewer
+
+@subsubsection occt_draw_4_1_1 view, delete
+
+Syntax:
+~~~~~
+view index type [X Y W H]
+delete [index]
+~~~~~
+
+**view** is the basic view creation command: it creates a new view with the given index. If a view with this index already exits, it is deleted. The view is created with default parameters and X Y W H are the position and dimensions of the window on the screen. Default values are 0, 0, 500, 500.
+
+As a rule it is far simpler either to use the procedures **axo**, **top**, **left** or to click on the desired view type in the menu under *Views* in the task bar..
+
+**delete** deletes a view. If no index is given, all the views are deleted.
+
+Type selects from the following range:
+
+ * *AXON* : Axonometric view
+ * *PERS* : Perspective view
+ * *+X+Y* : View on both axes (i.e. a top view), other codes are *-X+Y, +Y-Z*, etc.
+ * *-2D-* : 2d view
+
+The index, the type, the current zoom are displayed in the window title .
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# this is the content of the mu4 procedure
+proc mu4 {} {
+delete
+view 1 +X+Z 320 20 400 400
+view 2 +X+Y 320 450 400 400
+view 3 +Y+Z 728 20 400 400
+view 4 AXON 728 450 400 400
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+See also: **axo, pers, top, bottom, left, right, front, back, mu4, v2d, av2d, smallview**
+
+@subsubsection occt_draw_4_1_2 axo, pers, top, ...
+
+Syntax:
+
+~~~~~
+axo
+pers
+...
+smallview type
+~~~~~
+
+All these commands are procedures used to define standard screen layout. They delete all existing views and create new ones. The layout usually complies with the European convention, i.e. a top view is under a front view.
+
+ * **axo** creates a large window axonometric view;
+ * **pers** creates a large window perspective view;
+ * **top**, **bottom**, **left**, **right**, **front**, **back** create a large window axis view;
+ * **mu4** creates four small window views: front, left, top and axo.
+ * **v2d** creates a large window 2d view.
+ * **av2d** creates two small window views, one 2d and one axo
+ * **smallview** creates a view at the bottom right of the screen of the given type.
+
+See also: **view**, **delete**
+
+@subsubsection occt_draw_4_1_3 mu, md, 2dmu, 2dmd, zoom, 2dzoom
+
+Syntax:
+
+~~~~~
+ mu [index] value
+ 2dmu [index] value
+ zoom [index] value
+ wzoom
+~~~~~
+
+* **mu** (magnify up) increases the zoom in one or several views by a factor of 10%.
+* **md** (magnify down) decreases the zoom by the inverse factor. **2dmu** and **2dmd**
+perform the same on one or all 2d views.
+* **zoom** and **2dzoom** set the zoom factor to a value specified by you. The current zoom factor is always displayed in the window’s title bar. Zoom 20 represents a full screen view in a large window; zoom 10, a full screen view in a small one.
+* **wzoom** (window zoom) allows you to select the area you want to zoom in on with the mouse. You will be prompted to give two of the corners of the area that you want to magnify and the rectangle so defined will occupy the window of the view.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+ # set a zoom of 2.5
+ zoom 2.5
+
+ # magnify by 10%
+ mu 1
+
+ # magnify by 20%
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+See also: **fit**, **2dfit**
+
+
+@subsubsection occt_draw_4_14 pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr
+
+Syntax: pu [index]
+pd [index]
+
+The **p_ **commands are used to pan. **pu **and **pd **pan up and down respectively;**pl **and **pr **pan left and right respectively. Each time the view is displaced by 40 pixels.When no index is given, all views will pan in the direction specified.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# you have selected one anonometric view
+pu
+# or
+pu 1
+
+# you have selected an mu4 view; the object in the third
+# view will pan up
+pu 3
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+See also: **fit**, **2dfit**
+
+
+@subsubsection occt_draw_4_1_5 fit, 2dfit
+
+Syntax:
+
+~~~~~
+fit [index]
+2dfit [index]
+~~~~~
+
+**fit** computes the best zoom and pans on the content of the view. The content of the view will be centered and fit the whole window.
+
+When fitting all views a unique zoom is computed for all the views. All views are on the same scale.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# fit only view 1
+fit 1
+# fit all 2d views
+2dfit
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+See also: **zoom**, **mu**, **pu**
+
+
+@subsubsection occt_draw_4_1_6 u, d, l, r
+
+Syntax:
+
+~~~~~
+u [index]
+d [index]
+l [index]
+r [index]
+~~~~~
+
+**u**, **d**, **l**, **r** Rotate the object in view around its axis by five degrees up, down, left or right respectively. This command is restricted to axonometric and perspective views.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# rotate the view up
+u
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@subsubsection occt_draw_4_1_7 focal, fu, fd
+
+Syntax:
+~~~~~
+focal [f]
+fu [index]
+fd [index]
+~~~~~
+
+* **focal** changes the vantage point in perspective views. A low f value increases the perspective effect; a high one give a perspective similar to that of an axonometric view. The default value is 500.
+* **fu** and **fd** increase or decrease the focal value by 10%. **fd** makes the eye closer to the object.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+pers
+repeat 10 fd
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+**Note**: Do not use a negative or null focal value.
+
+See also: **pers**
+
+@subsubsection occt_draw_4_1_8 color
+
+Syntax:
+
+~~~~~
+color index name
+~~~~~
+
+**color** sets the color to a value. The index of the *color* is a value between 0 and 15. The name is an X window color name. The list of these can be found in the file *rgb.txt* in the X library directory.
+
+The default values are: 0 White, 1 Red, 2 Green, 3 Blue, 4 Cyan, 5 Gold, 6 Magenta, 7 Marron, 8 Orange, 9 Pink, 10 Salmon, 11 Violet, 12 Yellow, 13 Khaki, 14 Coral.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# change the value of blue
+color 3 "navy blue"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+**Note** that the color change will be visible on the next redraw of the views, for example, after *fit* or *mu*, etc.
+
+@subsubsection occt_draw_4_1_9 dtext
+
+Syntax:
+~~~~~
+dtext [x y [z]] string
+~~~~~
+
+**dtext** displays a string in all 3d or 2d views. If no coordinates are given, a graphic selection is required. If two coordinates are given, the text is created in a 2d view at the position specified. With 3 coordinates, the text is created in a 3d view.
+
+The coordinates are real space coordinates.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# mark the origins
+dtext 0 0 bebop
+dtext 0 0 0 bebop
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@subsubsection occt_draw_4_1_10 hardcopy, hcolor, xwd
+
+Syntax:
+~~~~~
+hardcopy [index]
+hcolor index width gray
+xwd [index] filename
+~~~~~
+
+* **hardcopy** creates a postcript file called a4.ps in the current directory. This file contains the postscript description of the view index, and will allow you to print the view.
+* **hcolor** lets you change the aspect of lines in the postscript file. It allows to specify a width and a gray level for one of the 16 colors. **width** is measured in points with default value as 1, **gray** is the gray level from 0 = black to 1 = white with default value as 0. All colors are bound to the default values at the beginning.
+* **xwd** creates an X window xwd file from an active view. By default, the index is set to1. To visualize an xwd file, use the unix command **xwud**.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# all blue lines (color 3)
+# will be half-width and gray
+hcolor 3 0.5
+
+# make a postscript file and print it
+hardcopy
+lpr a4.ps
+
+# make an xwd file and display it
+xwd theview
+xwud -in theview
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+**Note:** When more than one view is present, specify the index of the view.
+
+Only use a postscript printer to print postscript files.
+
+See also: **color**
+
+
+@subsubsection occt_draw_4_1_11 wclick, pick
+
+Syntax:
+~~~~~
+wclick
+pick index X Y Z b [nowait]
+~~~~~
+
+**wclick** defers an event until the mouse button is clicked. The message <code>just click</code> is displayed.
+
+Use the **pick** command to get graphic input. The arguments must be names for variables where the results are stored.
+ * index: index of the view where the input was made.
+ * X,Y,Z: 3d coordinates in real world.
+ * b: b is the mouse button 1,2 or 3.
+
+When there is an extra argument, its value is not used and the command does not wait for a click; the value of b may then be 0 if there has not been a click.
+
+This option is useful for tracking the pointer.
+
+**Note** that the results are stored in Draw numeric variables.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# make a circle at mouse location
+pick index x y z b
+circle c x y z 0 0 1 1 0 0 0 30
+
+# make a dynamic circle at mouse location
+# stop when a button is clicked
+# (see the repaint command)
+
+dset b 0
+while {[dval b] == 0} {
+pick index x y z b nowait
+circle c x y z 0 0 1 1 0 0 0 30
+repaint
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+See also: **repaint**
+
+
+Draw provides commands to manage the display of objects.
+* **display**, **donly** are used to display,
+* **erase**, **clear**, **2dclear** to erase.
+* **autodisplay** command is used to check whether variables are displayed when created.
+
+The variable name "." (dot) has a special status in Draw. Any Draw command expecting a Draw object as argument can be passed a dot. The meaning of the dot is the following.
+ * If the dot is an input argument, a graphic selection will be made. Instead of getting the object from a variable, Draw will ask you to select an object in a view.
+ * If the dot is an output argument, an unnamed object will be created. Of course this makes sense only for graphic objects: if you create an unnamed number you will not be able to access it. This feature is used when you want to create objects for display only.
+ * If you do not see what you expected while executing loops or sourcing files, use the **repaint** and **dflush** commands.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# OK use dot to dump an object on the screen
+dump .
+
+point . x y z
+
+#Not OK. display points on a curve c
+# with dot no variables are created
+for {set i 0} {$i = 10} {incr i} {
+cvalue c $i/10 x y z
+point . x y z
+}
+
+# point p x y z
+# would have displayed only one point
+# because the precedent variable content is erased
+
+# point p$i x y z
+# is an other solution, creating variables
+# p0, p1, p2, ....
+
+# give a name to a graphic object
+rename . x
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@subsubsection occt_draw_4_1_12 autodisplay
+
+Syntax:
+
+~~~~~
+autodisplay [0/1]
+~~~~~
+
+By default, Draw automatically displays any graphic object as soon as it is created. This behavior known as autodisplay can be removed with the command **autodisplay**. Without arguments, **autodisplay** toggles the autodisplay mode. The command always returns the current mode.
+
+When **autodisplay** is off, using the dot return argument is ineffective.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# c is displayed
+circle c 0 0 1 0 5
+
+# toggle the mode
+autodisplay
+== 0
+circle c 0 0 1 0 5
+
+# c is erased, but not displayed
+display c
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@subsubsection occt_draw_4_1_13 display, donly
+
+Syntax:
+~~~~~
+display varname [varname ...]
+donly varname [varname ...]
+~~~~~
+
+* **display** makes objects visible.
+* **donly** *display only* makes objects visible and erases all other objects. It is very useful to extract one object from a messy screen.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+\# to see all objects
+foreach var [directory] {display $var}
+
+\# to select two objects and erase the other ones
+donly . .
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@subsubsection occt_draw_4_1_14 erase, clear, 2dclear
+
+Syntax:
+
+~~~~~
+erase [varname varname ...]
+clear
+2dclear
+~~~~~
+
+**erase** removes objects from all views. **erase** without arguments erases everything in 2d and 3d.
+
+**clear** erases only 3d objects and **2dclear** only 2d objects. **erase** without arguments is similar to **clear; 2dclear**.
+
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# erase eveerything with a name starting with c_
+foreach var [directory c_*] {erase $var}
+
+# clear 2d views
+2d clear
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@subsubsection occt_draw_4_1_15 repaint, dflush
+
+
+Syntax:
+
+~~~~~
+repaint
+dflush
+~~~~~
+
+* **repaint** forces repainting of views.
+* **dflush** flushes the graphic buffers.
+
+These commands are useful within loops or in scripts.
+
+When an object is modified or erased, the whole view must be repainted. To avoid doing this too many times, Draw sets up a flag and delays the repaint to the end of the command in which the new prompt is issued. In a script, you may want to display the result of a change immediately. If the flag is raised, **repaint** will repaint the views and clear the flag.
+
+Graphic operations are buffered by Draw (and also by the X system). Usually the buffer is flushed at the end of a command and before graphic selection. If you want to flush the buffer from inside a script, use the **dflush** command.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+# See the example with the pick command
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+See also: **pick**
+
+@subsection occt_draw_4_2 AIS viewer – view commands
+
+
+@subsubsection occt_draw_4_2_1 vinit
+
+Syntax:
+~~~~~
+vinit
+~~~~~
+Creates the 3D viewer window
+
+@subsubsection occt_draw_4_2_2 vhelp
+
+Syntax:
+~~~~~
+vhelp
+~~~~~
+Displays help in the 3D viewer window. The help consists in a list of hotkeys and their functionalities.
+
+@subsubsection occt_draw_4_2_3 vtop
+
+Syntax:
+~~~~~
+vtop
+~~~~~
+
+Displays top view in the 3D viewer window.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+vinit
+box b 10 10 10
+vdisplay b
+vfit
+vtop
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@subsubsection occt_draw_4_2_4 vaxo
+
+Syntax:
+~~~~~
+vaxo
+~~~~~
+
+Displays axonometric view in the 3D viewer window.
+
+**Example:**
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
+vinit
+box b 10 10 10
+vdisplay b
+vfit
+vaxo
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@subsubsection occt_draw_4_2_5 vsetbg
+
+Syntax:
+~~~~~
+vsetbg imagefile [filltype]
+~~~~~
+
+Loads image file as background. *filltype* must be NONE, CENTERED, TILED or STRETCH.
+
+**Example:**
+~~~~~
+vinit
+vsetbg myimage.brep CENTERED
+~~~~~
+
+@subsubsection occt_draw_4_2_6 vclear
+
+Syntax:
+~~~~~
+vclear
+~~~~~
+Removes all objects from the viewer.
+
+@subsubsection occt_draw_4_2_7 vrepaint
+
+Syntax:
+~~~~~
+vrepaint
+~~~~~
+Forcedly redisplays the shape in the 3D viewer window.
+
+@subsubsection occt_draw_4_2_8 vfit
+
+Syntax:
+~~~~~
+vfit
+~~~~~
+Automatic zoom/panning. Objects in the view are visualized to occupy the maximum surface.
+
+@subsubsection occt_draw_4_2_9 vzfit
+
+Syntax:
+~~~~~
+vzfit
+~~~~~
+
+Automatic depth panning. Objects in the view are visualized to occupy the maximum 3d space.
+
+@subsubsection occt_draw_4_2_10 vreadpixel
+
+Syntax:
+~~~~~
+vreadpixel xPixel yPixel [{rgb|rgba|depth|hls|rgbf|rgbaf}=rgba] [name]
+~~~~~
+Read pixel value for active view.
+
+
+@subsubsection occt_draw_4_2_11 vselect
+
+Syntax:
+~~~~~
+vselect x1 y1 [x2 y2 [x3 y3 ... xn yn]] [shift_selection = 0|1]
+~~~~~
+
+Emulates different types of selection:
+
+ * single mouse click selection
+ * selection with a rectangle having the upper left and bottom right corners in *(x1,y1)* and *(x2,y2)* respectively
+ * selection with a polygon having the corners in pixel positions *(x1,y1), (x2,y2),…, (xn,yn)*
+ * any of these selections if shift_selection is set to 1.
+
+@subsubsection occt_draw_4_2_12 vmoveto
+
+Syntax:
+
+~~~~~
+vmoveto x y
+~~~~~
+Emulates cursor movement to pixel position (x,y).
+
+@subsubsection occt_draw_4_2_13 vviewparams
+
+Syntax:
+~~~~~
+vviewparams [scale center_X center_Y proj_X proj_Y proj_Z up_X up_Y up_Z at_X at_Y at_Z]
+~~~~~
+Gets or sets the current view characteristics.
+
+@subsubsection occt_draw_4_2_14 vchangeselected
+
+Syntax:
+~~~~~
+vchangeselected shape
+~~~~~
+Adds a shape to selection or removes one from it.
+
+@subsubsection occt_draw_4_2_15 vzclipping
+
+Syntax:
+~~~~~
+vzclipping [mode] [depth width]
+~~~~~
+Gets or sets ZClipping mode, width and depth, where
+ - *mode = OFF|BACK|FRONT|SLICE*
+ - *depth* is a real value from segment [0,1]
+ - *width* is a real value from segment [0,1]
+
+@subsubsection occt_draw_4_2_16 vnbselected
+
+Syntax:
+~~~~~
+vnbselected
+~~~~~
+Returns the number of selected objects in the interactive context.
+
+@subsubsection occt_draw_4_2_17 vantialiasing
+
+Syntax:
+~~~~~
+valntialiasing 1|0
+~~~~~
+Sets antialiasing if the command is called with 1 or unsets otherwise.
+
+@subsubsection occt_draw_4_2_18 vpurgedisplay
+
+Syntax:
+~~~~~
+vpurgedisplay [CollectorToo = 0|1]
+~~~~~
+Removes structures which do not belong to objects displayed in neutral point.
+
+@subsubsection occt_draw_4_2_19 vhlr
+
+Syntax:
+~~~~~
+vhlr is_enabled={on|off}
+~~~~~
+Switches hidden line removal (computed) mode on/off.
+
+@subsubsection occt_draw_4_2_20 vhlrtype
+
+Syntax:
+~~~~~
+vhlrtype algo_type={algo|polyalgo} [shape_1 ... shape_n]
+~~~~~
+
+Changes the type of HLR algorithm used for shapes.
+If the algo_type is algo, the exact HLR algorithm is used, otherwise the polygonal algorithm is used for defined shapes.
+
+If no shape is specified through the command arguments, the given HLR algorithm_type is applied to all *AIS_Shape* isntances in the current context, and the command also changes the default HLR algorithm type.
+
+**Note** that this command works with instances of *AIS_Shape* or derived classes only, other interactive object types are ignored.
+
+
+@subsection occt_draw_4_3 AIS viewer – display commands
+
+@subsubsection occt_draw_4_3_1 vdisplay
+
+Syntax:
+vdisplay name1 [name2] … [name n]
+
+Displays named objects.
+**Example:**
+
+vinit
+box b 40 40 40 10 10 10
+psphere s 20
+vdisplay s b
+vfit
+
+
+@subsubsection occt_draw_4_32 vdonly
+
+Syntax: vdonly [name1] … [name n]
+
+Displays only selected or named objects. If there are no selected or named objects, nothing is done.
+**Example:**
+
+vinit
+box b 40 40 40 10 10 10
+psphere s 20
+vdonly b
+vfit
+@subsubsection occt_draw_4_33 vdisplayall
+
+Syntax: vdisplayall
+
+Displays all created objects.
+**Example:**
+
+vinit
+box b 40 40 40 10 10 10
+psphere s 20
+vdisplayall
+vfit
+@subsubsection occt_draw_4_34 verase
+
+Syntax: verase [name1] [name2] … [name n]
+
+Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased.
+**Example:**
+
+vinit
+box b1 40 40 40 10 10 10
+box b2 -40 -40 -40 10 10 10
+psphere s 20
+vdisplayall
+vfit
+# erase only first box
+verase b1
+# erase second box and sphere
+verase
+@subsubsection occt_draw_4_35 veraseall
+
+Syntax: veraseall
+
+Erases all objects displayed in the viewer.
+**Example:**
+vinit
+box b1 40 40 40 10 10 10
+box b2 -40 -40 -40 10 10 10
+psphere s 20
+vdisplayall
+vfit
+# erase only first box
+verase b1
+# erase second box and sphere
+verseall
+
+@subsubsection occt_draw_4_36 vsetdispmode
+
+Syntax: vsetdispmode [name] mode(0,1,2,3)
+
+Sets display mode for all, selected or named objects.
+**mode** is **0** (**WireFrame**), **1** (**Shading**), **2** (**Quick HideLineremoval**), **3** (**Exact HideLineremoval**).
+**Example:**
+
+vinit
+box b 10 10 10
+vdisplay b
+vsetdispmode 1
+vfit
+@subsubsection occt_draw_4_37 vdisplaytype
+
+Syntax: vdisplaytype type
+
+Displays all objects of a given type.
+Possible **type**s are **;Point;, ;Axis;, ;Trihedron;, ;PlaneTrihedron;, ;Line;, ;Circle;, ;Plane;, ;Shape;, ;ConnectedShape;, ;MultiConn.Shape;, ;ConnectedInter.;, ;MultiConn.;, ;Constraint; **and** ;Dimension; **(see **vtypes**).
+
+@subsubsection occt_draw_4_38 verasetype
+
+Syntax: verasetype type
+
+Erases all objects of a given type.
+Possible** type**s are **;Point;, ;Axis;, ;Trihedron;, ;PlaneTrihedron;, ;Line;, ;Circle;, ;Plane;, ;Shape;, ;ConnectedShape;, ;MultiConn.Shape;, ;ConnectedInter.;, ;MultiConn.;, ;Constraint; **and **;Dimension; **(see **vtypes**).
+
+@subsubsection occt_draw_4_39 vtypes
+
+Syntax: vtypes
+
+Makes a list of known types and signatures in AIS.
+
+@subsubsection occt_draw_4_310 vsetcolor
+
+Syntax: vsetcolor [shapename] colorname
+
+Sets color for all, selected or named shapes.
+Possible **colorname**s are: ;BLACK;, ;MATRAGRAY;, ;MATRABLUE;, ;ALICEBLUE;, ;ANTIQUEWHITE;, ;ANTIQUEWHITE1;, ;ANTIQUEWHITE2;, ;ANTIQUEWHITE3;, ;ANTIQUEWHITE4;, ;AQUAMARINE1;, ;AQUAMARINE2;, ;AQUAMARINE4;, ;AZURE;, ;AZURE2;, ;AZURE3;, ;AZURE4;, ;BEIGE;, ;BISQUE;, ;BISQUE2;, ;BISQUE3;, ;BISQUE4;, ;BLANCHEDALMOND;, ;BLUE1;, ;BLUE2;, ;BLUE3;, ;BLUE4;, ;BLUEVIOLET;, ;BROWN;, ;BROWN1;, ;BROWN2;, ;BROWN3;, ;BROWN4;, ;BURLYWOOD;, ;BURLYWOOD1;, ;BURLYWOOD2;, ;BURLYWOOD3;, ;BURLYWOOD4;, ;CADETBLUE;, ;CADETBLUE1;, ;CADETBLUE2;, ;CADETBLUE3;, ;CADETBLUE4;, ;CHARTREUSE;, ;CHARTREUSE1;, ;CHARTREUSE2;, ;CHARTREUSE3;, ;CHARTREUSE4;, ;CHOCOLATE;, ;CHOCOLATE1;, ;CHOCOLATE2;, ;CHOCOLATE3;, ;CHOCOLATE4;, ;CORAL;, ;CORAL1;, ;CORAL2;, ;CORAL3;, ;CORAL4;, ;CORNFLOWERBLUE;, ;CORNSILK1;, ;CORNSILK2;, ;CORNSILK3;, ;CORNSILK4;, ;CYAN1;, ;CYAN2;, ;CYAN3;, ;CYAN4;, ;DARKGOLDENROD;, ;DARKGOLDENROD1;, ;DARKGOLDENROD2;, ;DARKGOLDENROD3;, ;DARKGOLDENROD4;, ;DARKGREEN;, ;DARKKHAKI;, ;DARKOLIVEGREEN;, ;DARKOLIVEGREEN1;, ;DARKOLIVEGREEN2;, ;DARKOLIVEGREEN3;, ;DARKOLIVEGREEN4;, ;DARKORANGE;, ;DARKORANGE1;, ;DARKORANGE2;, ;DARKORANGE3;, ;DARKORANGE4;, ;DARKORCHID;, ;DARKORCHID1;, ;DARKORCHID2;, ;DARKORCHID3;, ;DARKORCHID4;, ;DARKSALMON;, ;DARKSEAGREEN;, ;DARKSEAGREEN1;, ;DARKSEAGREEN2;, ;DARKSEAGREEN3;, ;DARKSEAGREEN4;, ;DARKSLATEBLUE;, ;DARKSLATEGRAY1;, ;DARKSLATEGRAY2;, ;DARKSLATEGRAY3;, ;DARKSLATEGRAY4;, ;DARKSLATEGRAY;, ;DARKTURQUOISE;, ;DARKVIOLET;, ;DEEPPINK;, ;DEEPPINK2;, ;DEEPPINK3;, ;DEEPPINK4;, ;DEEPSKYBLUE1;, ;DEEPSKYBLUE2;, ;DEEPSKYBLUE3;, ;DEEPSKYBLUE4;, ;DODGERBLUE1;, ;DODGERBLUE2;, ;DODGERBLUE3;, ;DODGERBLUE4;, ;FIREBRICK;, ;FIREBRICK1;, ;FIREBRICK2;, ;FIREBRICK3;, ;FIREBRICK4;, ;FLORALWHITE;, ;FORESTGREEN;, ;GAINSBORO;, ;GHOSTWHITE;, ;GOLD;, ;GOLD1;, ;GOLD2;, ;GOLD3;, ;GOLD4;, ;GOLDENROD;, ;GOLDENROD1;, ;GOLDENROD2;, ;GOLDENROD3;, ;GOLDENROD4;, ;GRAY;, ;GRAY0;, ;GRAY1;, ;GRAY10;, ;GRAY11;, ;GRAY12;, ;GRAY13;, ;GRAY14;, ;GRAY15;, ;GRAY16;, ;GRAY17;, ;GRAY18;, ;GRAY19;, ;GRAY2;, ;GRAY20;, ;GRAY21;, ;GRAY22;, ;GRAY23;, ;GRAY24;, ;GRAY25;, ;GRAY26;, ;GRAY27;, ;GRAY28;, ;GRAY29;, ;GRAY3;, ;GRAY30;, ;GRAY31;, ;GRAY32;, ;GRAY33;, ;GRAY34;, ;GRAY35;, ;GRAY36;, ;GRAY37;, ;GRAY38;, ;GRAY39;, ;GRAY4;, ;GRAY40;, ;GRAY41;, ;GRAY42;, ;GRAY43;, ;GRAY44;, ;GRAY45;, ;GRAY46;, ;GRAY47;, ;GRAY48;, ;GRAY49;, ;GRAY5;, ;GRAY50;, ;GRAY51;, ;GRAY52;, ;GRAY53;, ;GRAY54;, ;GRAY55;, ;GRAY56;, ;GRAY57;, ;GRAY58;, ;GRAY59;, ;GRAY6;, ;GRAY60;, ;GRAY61;, ;GRAY62;, ;GRAY63;, ;GRAY64;, ;GRAY65;, ;GRAY66;, ;GRAY67;, ;GRAY68;, ;GRAY69;, ;GRAY7;, ;GRAY70;, ;GRAY71;, ;GRAY72;, ;GRAY73;, ;GRAY74;, ;GRAY75;, ;GRAY76;, ;GRAY77;, ;GRAY78;, ;GRAY79;, ;GRAY8;, ;GRAY80;, ;GRAY81;, ;GRAY82;, ;GRAY83;, ;GRAY85;, ;GRAY86;, ;GRAY87;, ;GRAY88;, ;GRAY89;, ;GRAY9;, ;GRAY90;, ;GRAY91;, ;GRAY92;, ;GRAY93;, ;GRAY94;, ;GRAY95;, ;GREEN;, ;GREEN1;, ;GREEN2;, ;GREEN3;, ;GREEN4;, ;GREENYELLOW;, ;GRAY97;, ;GRAY98;, ;GRAY99;, ;HONEYDEW;, ;HONEYDEW2;, ;HONEYDEW3;, ;HONEYDEW4;, ;HOTPINK;, ;HOTPINK1;, ;HOTPINK2;, ;HOTPINK3;, ;HOTPINK4;, ;INDIANRED;, ;INDIANRED1;, ;INDIANRED2;, ;INDIANRED3;, ;INDIANRED4;, ;IVORY;, ;IVORY2;, ;IVORY3;, ;IVORY4;, ;KHAKI;, ;KHAKI1;, ;KHAKI2;, ;KHAKI3;, ;KHAKI4;, ;LAVENDER;, ;LAVENDERBLUSH1;, ;LAVENDERBLUSH2;, ;LAVENDERBLUSH3;, ;LAVENDERBLUSH4;, ;LAWNGREEN;, ;LEMONCHIFFON1;, ;LEMONCHIFFON2;, ;LEMONCHIFFON3;, ;LEMONCHIFFON4;, ;LIGHTBLUE;, ;LIGHTBLUE1;, ;LIGHTBLUE2;, ;LIGHTBLUE3;, ;LIGHTBLUE4;, ;LIGHTCORAL;, ;LIGHTCYAN1;, ;LIGHTCYAN2;, ;LIGHTCYAN3;, ;LIGHTCYAN4;, ;LIGHTGOLDENROD;, ;LIGHTGOLDENROD1;, ;LIGHTGOLDENROD2;, ;LIGHTGOLDENROD3;, ;LIGHTGOLDENROD4;, ;LIGHTGOLDENRODYELLOW;, ;LIGHTGRAY;, ;LIGHTPINK;, ;LIGHTPINK1;, ;LIGHTPINK2;, ;LIGHTPINK3;, ;LIGHTPINK4;, ;LIGHTSALMON1;, ;LIGHTSALMON2;, ;LIGHTSALMON3;, ;LIGHTSALMON4;, ;LIGHTSEAGREEN;, ;LIGHTSKYBLUE;, ;LIGHTSKYBLUE1;, ;LIGHTSKYBLUE2;, ;LIGHTSKYBLUE3;, ;LIGHTSKYBLUE4;, ;LIGHTSLATEBLUE;, ;LIGHTSLATEGRAY;, ;LIGHTSTEELBLUE;, ;LIGHTSTEELBLUE1;, ;LIGHTSTEELBLUE2;, ;LIGHTSTEELBLUE3;, ;LIGHTSTEELBLUE4;, ;LIGHTYELLOW;, ;LIGHTYELLOW2;, ;LIGHTYELLOW3;, ;LIGHTYELLOW4;, ;LIMEGREEN;, ;LINEN;, ;MAGENTA1;, ;MAGENTA2;, ;MAGENTA3;, ;MAGENTA4;, ;MAROON;, ;MAROON1;, ;MAROON2;, ;MAROON3;, ;MAROON4;, ;MEDIUMAQUAMARINE;, ;MEDIUMORCHID;, ;MEDIUMORCHID1;, ;MEDIUMORCHID2;, ;MEDIUMORCHID3;, ;MEDIUMORCHID4;, ;MEDIUMPURPLE;, ;MEDIUMPURPLE1;, ;MEDIUMPURPLE2;, ;MEDIUMPURPLE3;, ;MEDIUMPURPLE4;, ;MEDIUMSEAGREEN;, ;MEDIUMSLATEBLUE;, ;MEDIUMSPRINGGREEN;, ;MEDIUMTURQUOISE;, ;MEDIUMVIOLETRED;, ;MIDNIGHTBLUE;, ;MINTCREAM;, ;MISTYROSE;, ;MISTYROSE2;, ;MISTYROSE3;, ;MISTYROSE4;, ;MOCCASIN;, ;NAVAJOWHITE1;, ;NAVAJOWHITE2;, ;NAVAJOWHITE3;, ;NAVAJOWHITE4;, ;NAVYBLUE;, ;OLDLACE;, ;OLIVEDRAB;, ;OLIVEDRAB1;, ;OLIVEDRAB2;, ;OLIVEDRAB3;, ;OLIVEDRAB4;, ;ORANGE;, ;ORANGE1;, ;ORANGE2;, ;ORANGE3;, ;ORANGE4;, ;ORANGERED;, ;ORANGERED1;, ;ORANGERED2;, ;ORANGERED3;, ;ORANGERED4;, ;ORCHID;, ;ORCHID1;, ;ORCHID2;, ;ORCHID3;, ;ORCHID4;, ;PALEGOLDENROD;, ;PALEGREEN;, ;PALEGREEN1;, ;PALEGREEN2;, ;PALEGREEN3;, ;PALEGREEN4;, ;PALETURQUOISE;, ;PALETURQUOISE1;, ;PALETURQUOISE2;, ;PALETURQUOISE3;, ;PALETURQUOISE4;, ;PALEVIOLETRED;, ;PALEVIOLETRED1;, ;PALEVIOLETRED2;, ;PALEVIOLETRED3;, ;PALEVIOLETRED4;, ;PAPAYAWHIP;, ;PEACHPUFF;, ;PEACHPUFF2;, ;PEACHPUFF3;, ;PEACHPUFF4;, ;PERU;, ;PINK;, ;PINK1;, ;PINK2;, ;PINK3;, ;PINK4;, ;PLUM;, ;PLUM1;, ;PLUM2;, ;PLUM3;, ;PLUM4;, ;POWDERBLUE;, ;PURPLE;, ;PURPLE1;, ;PURPLE2;, ;PURPLE3;, ;PURPLE4;, ;RED;, ;RED1;, ;RED2;, ;RED3;, ;RED4;, ;ROSYBROWN;, ;ROSYBROWN1;, ;ROSYBROWN2;, ;ROSYBROWN3;, ;ROSYBROWN4;, ;ROYALBLUE;, ;ROYALBLUE1;, ;ROYALBLUE2;, ;ROYALBLUE3;, ;ROYALBLUE4;, ;SADDLEBROWN;, ;SALMON;, ;SALMON1;, ;SALMON2;, ;SALMON3;, ;SALMON4;, ;SANDYBROWN;, ;SEAGREEN;, ;SEAGREEN1;, ;SEAGREEN2;, ;SEAGREEN3;, ;SEAGREEN4;, ;SEASHELL;, ;SEASHELL2;, ;SEASHELL3;, ;SEASHELL4;, ;BEET;, ;TEAL;, ;SIENNA;, ;SIENNA1;, ;SIENNA2;, ;SIENNA3;, ;SIENNA4;, ;SKYBLUE;, ;SKYBLUE1;, ;SKYBLUE2;, ;SKYBLUE3;, ;SKYBLUE4;, ;SLATEBLUE;, ;SLATEBLUE1;, ;SLATEBLUE2;, ;SLATEBLUE3;, ;SLATEBLUE4;, ;SLATEGRAY1;, ;SLATEGRAY2;, ;SLATEGRAY3;, ;SLATEGRAY4;, ;SLATEGRAY;, ;SNOW;, ;SNOW2;, ;SNOW3;, ;SNOW4;, ;SPRINGGREEN;, ;SPRINGGREEN2;, ;SPRINGGREEN3;, ;SPRINGGREEN4;, ;STEELBLUE;, ;STEELBLUE1;, ;STEELBLUE2;, ;STEELBLUE3;, ;STEELBLUE4;, ;TAN;, ;TAN1;, ;TAN2;, ;TAN3;, ;TAN4;, ;THISTLE;, ;THISTLE1;, ;THISTLE2;, ;THISTLE3;, ;THISTLE4;, ;TOMATO;, ;TOMATO1;, ;TOMATO2;, ;TOMATO3;, ;TOMATO4;, ;TURQUOISE;, ;TURQUOISE1;, ;TURQUOISE2;, ;TURQUOISE3;, ;TURQUOISE4;, ;VIOLET;, ;VIOLETRED;, ;VIOLETRED1;, ;VIOLETRED2;, ;VIOLETRED3;, ;VIOLETRED4;, ;WHEAT;, ;WHEAT1;, ;WHEAT2;, ;WHEAT3;, ;WHEAT4;, ;WHITE;, ;WHITESMOKE;, ;YELLOW;, ;YELLOW1;, ;YELLOW2;, ;YELLOW3;, ;YELLOW4; and ;YELLOWGREEN;**.
+
+
+
+@subsubsection occt_draw_4_311 vunsetcolor
+
+Syntax: vunsetcolor [shapename]
+
+Sets default color for all, selected or named shapes.
+
+@subsubsection occt_draw_4_312 vsettransparency
+
+Syntax: vsettransparency [shapename] coeficient
+
+Sets transparency for all selected or named shapes. The **Coefficient** may be between 0.0 (opaque) and 1.0 (fully transparent). Warning: at 1.0 the shape becomes invisible.
+**Example:**
+
+vinit
+box b 10 10 10
+psphere s 20
+vdisplay b s
+vfit
+vsetdispmode 1
+vsettransparency b 0.5
+
+@subsubsection occt_draw_4_313 vunsettransparency
+
+Syntax: vunsettransparency [shapename]
+
+Sets default transparency (0.0) for all selected or named shapes.
+
+@subsubsection occt_draw_4_314 vsetmaterial
+
+Syntax: vsetmaterial [shapename] materialname
+
+Sets material for all selected or named shapes.
+**materialname** is ***BRASS*, *BRONZE*, *COPPER*, *GOLD*, *PEWTER*, *PLASTER*, *PLASTIC*, *SILVER*, *STEEL*, *STONE*, *SHINY_PLASTIC*, *SATIN*, *METALIZED*, *NEON_GNC*, *CHROME*, *ALUMINIUM*, *OBSIDIAN*, *NEON_PHC*, *JADE*.**
+**Example:**
+
+vinit
+psphere s 20
+vdisplay s
+vfit
+vsetdispmode 1
+vsetmaterial s JADE
+
+@subsubsection occt_draw_4_315 vunsetmaterial
+
+Syntax: vunsetmaterial [shapename]
+
+Sets default material for all selected or named shapes.
+
+@subsubsection occt_draw_4_316 vsetwidth
+
+Syntax: vsetwidth [shapename] coeficient
+
+Sets width of the edges for all selected or named shapes.
+The **Coefficient** may be between 0.0 and 10.0.
+**Example:**
+
+vinit
+box b 10 10 10
+vdisplay b
+vfit
+vsetwidth b 5
+
+@subsubsection occt_draw_4_317 vunsetwidth
+
+Syntax: vunsetwidth [shapename]
+
+Sets default width of edges (0.0) for all selected or named shapes.
+
+@subsubsection occt_draw_4_318 vsetshading
+
+Syntax: vsetshading shapename [coefficient]
+
+Sets deflection coefficient that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008.
+**Example:**
+
+vinit
+psphere s 20
+vdisplay s
+vfit
+vsetdispmode 1
+vsetshading s 0.005
+@subsubsection occt_draw_4_319 vunsetshading
+
+Syntax: vunsetshading [shapename]
+
+Sets default deflection coefficient (0.0008) that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008.
+
+@subsubsection occt_draw_4_320 vsetam
+
+Syntax: vsetam [shapename] mode
+
+Activates selection mode for all selected or named shapes.
+**mode** is **0** for **shape** itself, **1** for **vertices**, **2** for **edges**, **3** for **wires**, **4** for **faces**, **5** for **shells**, **6** for **solids**, **7** for **compounds**.
+**Example:**
+
+vinit
+box b 10 10 10
+vdisplay b
+vfit
+vsetam b 2
+@subsubsection occt_draw_4_321 vunsetam
+
+Syntax: vunsetam
+
+Deactivates all selection modes for all shapes.
+
+@subsubsection occt_draw_4_322 vdump
+
+Syntax: vdump filename.{png|xwd|bmp}
+
+Extracts the contents of the viewer window to a png, XWD or BMP file.
+
+@subsubsection occt_draw_4_323 vdir
+
+Syntax: vdir
+
+Displays the list of displayed objects.
+
+@subsubsection occt_draw_4_324 vsub
+
+Syntax: vsub 0/1(on/off)[shapename]
+
+Hilights/unhilights named or selected objects which are displayed at neutral state with subintensity color.
+**Example:**
+
+vinit
+box b 10 10 10
+psphere s 20
+vdisplay b s
+vfit
+vsetdispmode 1
+vsub b 1
+
+@subsubsection occt_draw_4_325 vardis
+
+Syntax: vardis
+
+Displays active areas (for each activated sensitive entity, one or several 2D bounding boxes are displayed, depending on the implementation of a particular entity).
+
+@subsubsection occt_draw_4_326 varera
+
+Syntax: varera
+
+Erases active areas.
+
+@subsubsection occt_draw_4_327 vsensdis
+
+Syntax: vsensdis
+
+Displays active entities (sensitive entities of one of the standard types corresponding to active selection modes).
+
+Standard entity types are those defined in Select3D package:
+ * sensitive box
+ * sensitive face
+ * sensitive curve
+ * sensitive segment
+ * sensitive circle
+ * sensitive point
+ * sensitive triangulation
+ * sensitive triangle
+Custom (application-defined) sensitive entity types are not processed by this command.
+
+@subsubsection occt_draw_4_328 vsensera
+
+Syntax: vsensera
+
+Erases active entities.
+
+@subsubsection occt_draw_4_329 vperf
+
+Syntax: vperf shapename 1/0 (Transformation/Loacation) 1/0 (Primitives sensibles ON/OFF)
+
+Tests the animation of an object along a predefined trajectory.
+**Example:**
+
+vinit
+box b 10 10 10
+psphere s 20
+vdisplay b s
+vfit
+vsetdispmode 0
+vperf b 1 1
+@subsubsection occt_draw_4_330 vr
+
+Syntax: vr filename
+
+Reads shape from BREP-format file and displays it in the viewer.
+**Example:**
+
+vinit
+vr myshape.brep
+@subsubsection occt_draw_4_330331 vstate
+
+Syntax: vstate [name1] … [name n]
+
+Makes a list of the status (**Displayed** or **Not Displayed**) of some selected or named objects.
+
+
+
+@subsection occt_draw_4_3304 AIS viewer – object commands
+
+@subsubsection occt_draw_4_33041 vtrihedron
+
+Syntax: vtrihedron name [X0] [Y0] [Z0] [Zu] [Zv] [Zw] [Xu] [Xv] [Xw]
+
+Creates a new AIS_Trihedron object. If no argument is set, the default trihedron (0XYZ) is created.
+**Example:**
+
+vinit
+vtrihedron tr
+
+@subsubsection occt_draw_4_33042 vplanetri
+
+Syntax: vplanetri name
+
+Creates a plane from a trihedron selection.
+
+
+@subsubsection occt_draw_4_33043 vsize
+
+Syntax: vsize [name] [size]
+
+Changes the size of a named or selected trihedron. If the name is not defined: it affects the selected trihedrons otherwise nothing is done. If the value is not defined, it is set to 100 by default.
+**Example:**
+
+vinit
+vtrihedron tr1
+vtrihedron tr2 0 0 0 1 0 0 1 0 0
+vsize tr2 400
+
+@subsubsection occt_draw_4_33044 vaxis
+
+Syntax: vaxis name [Xa Ya Za Xb Yb Zb]
+
+Creates an axis. If the values are not defined, an axis is created by interactive selection of two vertices or one edge
+**Example:**
+
+vinit
+vtrihedron tr
+vaxis axe1 0 0 0 1 0 0
+
+@subsubsection occt_draw_4_33045 vaxispara
+
+Syntax: vaxispara nom
+
+Creates an axis by interactive selection of an edge and a vertex.
+
+@subsubsection occt_draw_4_33046 vaxisortho
+
+Syntax: vaxisotrho name
+
+Creates an axis by interactive selection of an edge and a vertex. The axis will be orthogonal to the selected edge.
+
+@subsubsection occt_draw_4_33047 vpoint
+
+Syntax: vpoint name [Xa Ya Za]
+
+Creates a point from coordinates. If the values are not defined, a point is created by interactive selection of a vertice or an edge (in the center of the edge).
+**Example:**
+
+vinit
+vpoint p 0 0 0
+
+@subsubsection occt_draw_4_33048 vplane
+
+Syntax: vplane name [AxisName] [PointName]
+ vplane name [PointName] [PointName] [PointName]
+ vplane name [PlaneName] [PointName]
+
+Creates a plane from named or interactively selected entities.
+**Example:**
+
+vinit
+vpoint p1 0 50 0
+vaxis axe1 0 0 0 0 0 1
+vtrihedron tr
+vplane plane1 axe1 p1
+
+@subsubsection occt_draw_4_33049 vplanepara
+
+Syntax: vplanepara name
+
+Creates a plane from interactively selected vertex and face.
+
+@subsubsection occt_draw_4_330410 vplaneortho
+
+Syntax: vplaneortho name
+
+Creates a plane from interactive selected face and coplanar edge.
+
+@subsubsection occt_draw_4_330411 vline
+
+Syntax: vline name [PointName] [PointName]
+ vline name [Xa Ya Za Xb Yb Zb]
+
+Creates a line from coordinates, named or interactively selected vertices.
+**Example:**
+
+vinit
+vtrihedron tr
+vpoint p1 0 50 0
+vpoint p2 50 0 0
+vline line1 p1 p2
+vline line2 0 0 0 50 0 1
+
+@subsubsection occt_draw_4_330412 vcircle
+
+Syntax: vcircle name [PointName PointName PointName IsFilled]
+vcircle name [PlaneName PointName Radius IsFilled]
+
+Creates a circle from named or interactively selected entities. Parameter IsFilled is defined as 0 or 1.
+**Example:**
+
+vinit
+vtrihedron tr
+vpoint p1 0 50 0
+vpoint p2 50 0 0
+vpoint p3 0 0 0
+vcircle circle1 p1 p2 p3 1
+
+
+@subsubsection occt_draw_4_330413 vtri2d
+
+Syntax: vtri2d name
+
+Creates a plane with a 2D trihedron from an interactively selected face.
+
+@subsubsection occt_draw_4_330414 vselmode
+
+Syntax: vselmode [object] mode On/Off
+
+Sets the selection mode for an object. If the object value is not defined, the selection mode is set for all displayed objects.
+Value On is defined as 1 and Off – as 0.
+**Example:**
+
+vinit
+vpoint p1 0 0 0
+vpoint p2 50 0 0
+vpoint p3 25 40 0
+vtriangle triangle1 p1 p2 p3
+@subsubsection occt_draw_4_330415 vconnect, vconnectsh
+
+Syntax: vconnect name object Xo Yo Zo Xu Xv Xw Zu Zv Zw
+ vconnectsh name shape Xo Yo Zo Xu Xv Xw Zu Zv Zw
+
+Creates and displays an object with input location connected to a named entity.
+The difference between these two commands is that the object created by vconnect does not support the selection modes differrent from 0.
+**Example:**
+
+Vinitvinit
+vpoint p1 0 0 0
+vpoint p2 50 0 0
+vsegment segment p1 p2
+restore CrankArm.brep obj
+vdisplay obj
+vconnectsh new obj 100100100 1 0 0 0 0 1
+
+
+
+@subsubsection occt_draw_4_330416 vtriangle
+
+Syntax: vtriangle name PointName PointName PointName
+
+Creates and displays a filled triangle from named points.
+**Example:**
+
+vinit
+vpoint p1 0 0 0
+vpoint p2 50 0 0
+vpoint p3 25 40 0
+vtriangle triangle1 p1 p2 p3
+
+@subsubsection occt_draw_4_330417 vsegment
+
+Syntax: vsegment name PointName PointName
+
+Creates and displays a segment from named points.
+**Example:**
+
+Vinit
+vpoint p1 0 0 0
+vpoint p2 50 0 0
+vsegment segment p1 p2
+
+
+**MeshVS **(Mesh Visualization Service) component provides flexible means of displaying meshes with associated pre- and post- processor data.
+
+
+
+@subsection occt_draw_4_3305 AIS viewer – Mesh Visualization Service
+
+@subsubsection occt_draw_4_33051 meshfromstl
+
+Syntax: meshfromstl meshname file
+
+Creates a MeshVS_Mesh object based on STL file data. The object will be displayed immediately.
+**Example:**
+
+meshfromstl mesh myfile.stl
+
+@subsubsection occt_draw_4_33052 meshdispmode
+
+Syntax: meshdispmode meshname displaymode
+
+Changes the display mode of object **meshname**. The **displaymode** is integer, which can be **1** (for wireframe), **2** (for shading mode) or **3** (for shrink mode).
+**Example:**
+
+vinit
+meshfromstl mesh myfile.stl
+meshdispmode mesh 2
+
+@subsubsection occt_draw_4_33053 meshselmode
+
+Syntax: meshselmode meshname selectionmode
+
+Changes the selection mode of object **meshname**. The **selectionmode** is integer OR-combination of mode flags. The basic flags are the following:
+**1** – node selection,
+**2** – 0D elements (not suppored in STL)
+**4** – links (not supported in STL)
+**8** – faces
+**Example:**
+
+vinit
+meshfromstl mesh myfile.stl
+meshselmode mesh 1
+
+@subsubsection occt_draw_4_33054 meshshadcolor
+
+Syntax: meshshadcolor meshname red green blue
+
+Changes the face interior color of object **meshname**. The **red**, **green** and **blue** are real values between **0** and **1**.
+**Example:**
+
+vinit
+meshfromstl mesh myfile.stl
+meshshadcolormode mesh 0.5 0.5 0.5
+
+@subsubsection occt_draw_4_33055 meshlinkcolor
+
+Syntax: meshlinkcolor meshname red green blue
+
+Changes the color of face borders for object **meshname**. The **red**, **green** and **blue** are real values between **0** and **1**.
+**Example:**
+
+vinit
+meshfromstl mesh myfile.stl
+meshlinkcolormode mesh 0.5 0.5 0.5
+
+@subsubsection occt_draw_4_33056 meshmat
+
+Syntax: meshmat meshname material
+
+Changes the material of object **meshname**. **material** is represented with an integer value as follows (equivalent to enumeration Graphic3d_NameOfMaterial):
+**0 – BRASS,**
+**1 – BRONZE,**
+**2 - COPPER,**
+**3 - GOLD,**
+**4 - PEWTER,**
+**5 - PLASTER,**
+**6 - PLASTIC,**
+**7 - SILVER,**
+**8 - STEEL,**
+**9 - STONE,**
+**10 - SHINY_PLASTIC,**
+**11 - SATIN,**
+**12 - METALIZED,**
+**13 - NEON_GNC,**
+**14 - CHROME,**
+**15 - ALUMINIUM,**
+**16 - OBSIDIAN,**
+**17 - NEON_PHC,**
+**18 - JADE,**
+**19 - DEFAULT,**
+**20 - UserDefined**
+**Example:**
+
+vinit
+meshfromstl mesh myfile.stl
+meshmat mesh JADE
+
+@subsubsection occt_draw_4_33057 meshshrcoef
+
+Syntax: meshshrcoef meshname shrinkcoefficient
+
+Changes the value of shrink coefficient used in the shrink mode. In the shrink mode the face is shown as a congruent part of a usual face, so that **shrinkcoefficient** controls the value of this part. The **shrinkcoefficient** is a positive real number.
+**Example:**
+
+vinit
+meshfromstl mesh myfile.stl
+meshshrcoef mesh 0.05
+
+@subsubsection occt_draw_4_33058 meshshow
+
+Syntax: meshshow meshname
+
+Displays **meshname** in the viewer (if it is erased).
+**Example:**
+
+vinit
+meshfromstl mesh myfile.stl
+meshshow mesh
+
+@subsubsection occt_draw_4_33059 meshhide
+
+Syntax: meshhide meshname
+
+Hides **meshname** in the viewer.
+**Example:**
+
+vinit
+meshfromstl mesh myfile.stl
+meshhide mesh
+
+@subsubsection occt_draw_4_330510 meshhidesel
+
+Syntax: meshhidesel meshname
+
+Hides only selected entities. The other part of **meshname** remains visible.
+
+@subsubsection occt_draw_4_330511 meshshowsel
+
+Syntax: meshshowsel meshname
+
+Shows only selected entities. The other part of **meshname** becomes invisible.
+
+@subsubsection occt_draw_4_330512 meshshowall
+
+Syntax: meshshowall meshname
+
+Changes the state of all entities to visible for **meshname**.
+
+@subsubsection occt_draw_4_330513 meshdelete
+
+Syntax: meshdelete meshname
+
+Deletes MeshVS_Mesh object **meshname**.
+**Example:**
+
+vinit
+meshfromstl mesh myfile.stl
+meshdelete mesh
+
+
+
+
+@subsection occt_draw_4_3306 AIS viewer – 2D viewer – view commands
+
+@subsubsection occt_draw_4_33061 v2dinit
+
+Syntax: v2dinit
+
+**v2dinit **creates the 2D viewer window.
+
+@subsubsection occt_draw_4_33062 v2dsetbg
+
+Syntax: v2dsetbg imagefile [filletype]
+
+**v2dsetbg** loads **imagefile** as background. **filletype** is **NONE**, **CENTERED**, **TILED**, **STRETCH**.
+**Example:**
+
+v2dinit
+v2dsetbg myimage.brep CENTERED
+
+@subsubsection occt_draw_4_33063 v2dfit
+
+Syntax: v2dfit
+
+Fits all shapes to the size of the window.
+
+@subsubsection occt_draw_4_33064 v2drepaint
+
+Syntax: v2drepaint
+
+Forcedly repaints all shapes.
+
+@subsubsection occt_draw_4_33065 v2dclear
+
+Syntax: v2dclear
+
+Clears the 2D viewer window
+
+@subsubsection occt_draw_4_33066 v2dtext
+
+Syntax: v2dtext text x y [angle scale fontindex]
+
+Creates a new object with the name **text_i** (i – integer value) and displays **text** at the position** x**, **y.** The text can be displayed at a certain **angle**, on a certain **scale** and with a certain **fontindex**.
+Default values are: **angle=0.0, scale=1.0, fontindex=0**.
+**Example:**
+
+v2dinit
+v2dtext *My text* 10 10
+@subsubsection occt_draw_4_33067 v2dsettextcolor
+
+Syntax: v2dsettextcolor text_name colorindex
+
+Changes the color of **text_name** object (**name** must be an integer value).
+**Example:**
+
+v2dinit
+v2dtext *My text* 10 10
+# Change color to red
+v2dsettextcolor text_0 3
+@subsubsection occt_draw_4_33068 v2dpick
+
+Syntax: v2dpick
+
+Displays mouse coordinates and color after clicking the mouse button in the 2D viewer window.
+
+
+@subsubsection occt_draw_4_33069 v2dgrid
+
+Syntax: v2dgrid [type x y xstep ystep angle [drawmode]]
+ v2dgrid [type x y radiusstep division angle [drawmode]]
+
+Loads a grid in the 2D viewer window.
+**type** is **Rect** or **Circ**.
+**drawmode** is **Lines**, **Points** or **None**.
+**Example:**
+
+v2dinit
+v2dgrid Circ 0 0 250 12 0 Lines
+v2drmgrid
+v2dgrid Rect 0 0 200 200 0 Lines
+@subsubsection occt_draw_4_330610 v2rmgrid
+
+Syntax: v2rmgrid
+
+Unloads a grid from the window.
+
+@subsubsection occt_draw_4_330611 v2dpickgrid
+
+Syntax: v2dpickgrid [mouse_x mouse_y [grid_x grid_y]]
+
+Gets coordinates of a grid point near the mouse button click in the 2D viewer window and sets it to **grid_x**, **grid_y** variables.
+
+@subsubsection occt_draw_4_330612 v2dpsout
+
+Syntax: v2dpsout imagefile [scale colorspace]
+ [width height [xcenter ycenter]]
+
+Exports **imagefile**. You can set its the scale, width, height and colorspace.
+**colorspace** can be **RGB, BlackAndWhite, GreyScale**.
+
+@subsubsection occt_draw_4_330612613 v2ddir
+
+Syntax: v2ddir
+
+Makes aLlist of the displayed objects.
+
+
+@subsection occt_draw_4_3306127 Ais viewer – 2D viewer – display commands
+
+@subsubsection occt_draw_4_33061271 v2ddisplay
+
+Syntax: v2ddisplay name [projection]
+
+Projection: origin_x origin_y origin_z normal_x normal_y normal_z dx_x dx_y dx_z.
+
+Displays named objects.
+**Example:**
+
+v2dinit
+box b 10 10 10
+psphere s 20
+v2ddisplay s
+v2ddisplay b
+v2dfit
+@subsubsection occt_draw_4_33061272 v2ddonly
+
+Syntax: v2ddonly [name1] … [name n]
+
+Displays only selected or named objects. If there are no selected or named objects, nothing is done.
+**Example:**
+
+v2dinit
+box b 10 10 10
+psphere s 20
+v2ddisplay b
+v2ddisplay s
+v2ddonly s
+v2dfit
+@subsubsection occt_draw_4_33061273 v2ddisplayall
+
+Syntax: v2ddisplayall
+
+Displays all created objects.
+**Example:**
+
+v2dinit
+box b 10 10 10
+psphere s 20
+v2ddisplay b
+v2ddisplay s
+v2ddonly
+v2ddisplayall
+v2dfit
+@subsubsection occt_draw_4_33061274 v2derase
+
+Syntax: v2derase name1 [name2] … [name n]
+
+Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased.
+**Example:**
+
+v2dinit
+box b 10 10 10
+psphere s 20
+v2ddisplay b
+v2ddisplay s
+v2derase b
+v2dfit
+@subsubsection occt_draw_4_33061275 v2deraseall
+
+Syntax: v2deraseall
+
+Erases all objects displayed in the viewer.
+**Example:**
+
+v2dinit
+box b 10 10 10
+psphere s 20
+v2ddisplay b
+v2ddisplay s
+v2deraseall
+v2dfit
+@subsubsection occt_draw_4_33061276 v2dsetcolor
+
+Syntax: v2dsetcolor [shapename] colorname
+
+Sets color for all, selected or named shapes.
+Values of **colorname** see **vsetcolor**.
+**Example:**
+
+v2dinit
+box b 10 10 10
+v2ddisplay b
+v2ddisplay s
+v2dsetcolor b RED
+v2dfit
+@subsubsection occt_draw_4_33061277 v2dunsetcolor
+
+Syntax: v2dunsetcolor [shapename]
+
+Sets default color for all, selected or named shapes.
+**Example:**
+
+v2dinit
+box b 10 10 10
+v2ddisplay b
+v2ddisplay s
+v2dsetcolor RED
+v2dunsetcolor b
+v2dfit
+@subsubsection occt_draw_4_33061278 v2dsetbgcolor
+
+Syntax: v2dsetbgcolor colorname
+
+Sets background color.
+See **vsetcolor** for the values of **colorname.**.
+**Example:**
+
+v2dinit
+box b 10 10 10
+v2ddisplay b
+v2ddisplay s
+v2dsetbgcolor RED
+v2dfit
+@subsubsection occt_draw_4_33061279 v2dsetwidth
+
+Syntax: v2dsetwidth [shapename] widthenum
+
+Set width of the edges for all, selected or named shapes.
+**widthenum** may be one of: **THIN, MEDIUM, THICK, VERYTHICK**.
+**Example:**
+
+v2dinit
+box b 10 10 10
+v2ddisplay b
+v2ddisplay s
+v2dsetwidth b THICK
+v2dfit
+@subsubsection occt_draw_4_330612710 v2dunsetwidth
+
+Syntax: vunsetwidth [shapename]
+
+Sets default width of the edges for all, selected or named shapes.
+**Example:**
+
+v2dinit
+box b 10 10 10
+v2ddisplay b
+v2ddisplay s
+v2dsetwidth THICK
+v2dunsetwidth b
+v2dfit
+
+@section occt_2142243456_930384826 OCAF commands
+
+
+This chapter contains a set of commands for Open CASCADE Technology Application Framework (OCAF).
+
+
+@subsection occt_2142243456_9303848261 Application commands
+
+
+@subsubsection occt_2142243456_93038482611 NewDocument
+
+Syntax: NewDocument docname [format]
+
+Creates a new **docname** document with MDTV-Standard or described format.
+**Example:**
+
+# Create new document with default (MDTV-Standard) format
+NewDocument D
+
+# Create new document with BinOcaf format
+NewDocument D2 BinOcaf
+
+@subsubsection occt_2142243456_93038482612 IsInSession
+
+Syntax: IsInSession path
+
+**I**Returns **0**, if **path** document is managed by the application session, **1** – otherwise.
+**Example:**
+
+IsInSession /myPath/myFile.std
+
+@subsubsection occt_2142243456_93038482613 ListDocuments
+
+Syntax: ListDocuments
+
+Makes a list of documents handled during the session of the application.
+
+
+@subsubsection occt_2142243456_93038482614 Open
+
+Syntax: Open path docname
+
+Retrieves the document of file **docname** in the path **path**. Overwrites the document, if it is already in session.
+**Example:**
+
+Open /myPath/myFile.std D
+
+@subsubsection occt_2142243456_93038482615 Close
+
+Syntax: Close docname
+
+Closes **docname** document. The document is no longer handled by the applicative session.
+**Example:**
+
+Close D
+
+@subsubsection occt_2142243456_93038482616 Save
+
+Syntax: Save docname
+
+Saves **docname** active document.
+**Example:**
+
+Save D
+
+@subsubsection occt_2142243456_93038482617 SaveAs
+
+Syntax: SaveAs docname path
+
+Saves the active document in the file **docname** in the path **path**. Overwrites the file if it already exists.
+**Example:**
+
+SaveAs D /myPath/myFile.std
+
+@subsection occt_2142243456_9303848262 Basic commands
+
+
+@subsubsection occt_2142243456_930384826521 Label
+
+Syntax: Label docname entry
+
+Creates the label expressed by **entry** if it does not exist.
+**Example:**
+
+Label D 0:2
+
+@subsubsection occt_2142243456_930384826522 NewChild
+
+Syntax: NewChild docname [taggerlabel = Root label]
+
+Finds (or creates) a TagSource attribute located at father label of **taggerlabel** and makes a new child label.
+**Example:**
+
+# Create new child of root label
+NewChild D
+
+# Create new child of existing label
+Label D 0:2
+NewChild D 0:2
+
+@subsubsection occt_2142243456_930384826523 Children
+
+Syntax: Children docname label
+
+Returns the list of attributes of **label**.
+**Example:**
+
+Children D 0:2
+
+@subsubsection occt_2142243456_930384826524 ForgetAll
+
+Syntax: ForgetAll docname label
+
+Forgets all attributes of the label.
+**Example:**
+
+ForgetAll D 0:2
+
+@subsection occt_2142243456_93038482653 Application commands
+
+
+@subsubsection occt_2142243456_930384826531 Main
+
+Syntax: Main docname
+
+Returns the main label of the framework.
+**Example:**
+
+Main D
+
+@subsubsection occt_2142243456_930384826532 UndoLimit
+
+Syntax: UndoLimit docname [value=0]
+
+
+Sets the limit on the number of Undo Delta stored. 0 will disable Undo on the document. A negative **value** means that there is no limit. Note that by default Undo is disabled. Enabling it will take effect with the next call to NewCommand. Of course, this limit is the same for Redo
+**Example:**
+
+UndoLimit D 100
+
+@subsubsection occt_2142243456_930384826533 Undo
+
+Syntax: Undo docname [value=1]
+
+Undoes **value** steps.
+**Example:**
+
+Undo D
+
+@subsubsection occt_2142243456_930384826534 Redo
+
+Syntax: Redo docname [value=1]
+
+Redoes **value** steps.
+**Example:**
+
+Redo D
+
+@subsubsection occt_2142243456_930384826535 OpenCommand
+
+Syntax: OpenCommand docname
+
+Opens a new command transaction.
+**Example:**
+
+OpenCommand D
+
+@subsubsection occt_2142243456_930384826536 CommitCommand
+
+Syntax: CommitCommand docname
+
+Commits the Command transaction.
+**Example:**
+
+CommitCommand D
+
+@subsubsection occt_2142243456_930384826537 NewCommand
+
+Syntax: NewCommand docname
+
+This is a short-cut for Commit and Open transaction.
+**Example:**
+
+NewCommand D
+
+@subsubsection occt_2142243456_930384826538 AbortCommand
+
+Syntax: AbortCommand docname
+
+Aborts the Command transaction.
+**Example:**
+
+AbortCommand D
+
+@subsubsection occt_2142243456_930384826539 Copy
+
+Syntax: Copy docname entry Xdocname Xentry
+
+Copies the contents of **entry** to **Xentry**. No links are registred.
+**Example:**
+
+Copy D1 0:2 D2 0:4
+
+@subsubsection occt_2142243456_9303848265310 UpdateLink
+
+Syntax: UpdateLink docname [entry]
+
+Updates external reference set at **entry**.
+**Example:**
+
+UpdateLink D
+
+@subsubsection occt_2142243456_9303848265311 CopyWithLink
+
+Syntax: CopyWithLink docname entry Xdocname Xentry
+
+Aborts the Command transaction.
+Copies the content of **entry** to **Xentry**. The link is registred with an Xlink attribute at ** Xentry** label.
+**Example:**
+
+CopyWithLink D1 0:2 D2 0:4
+
+@subsubsection occt_2142243456_9303848265312 UpdateXLinks
+
+Syntax: UpdateXLinks docname entry
+
+Sets modifications on labels impacted by external references to the **entry**. The **document** becomes invalid and must be recomputed
+**Example:**
+
+UpdateXLinks D 0:2
+
+@subsubsection occt_2142243456_9303848265313 DumpDocument
+
+Syntax: DumpDocument docname
+
+Displays parameters of **docname** document.
+**Example:**
+
+DumpDocument D
+
+@subsection occt_2142243456_93038482654 Data Framework commands
+
+
+@subsubsection occt_2142243456_930384826541 MakeDF
+
+Syntax: MakeDF dfname
+
+Creates a new data framework.
+**Example:**
+
+MakeDF D
+
+@subsubsection occt_2142243456_930384826542 ClearDF
+
+Syntax: ClearDF dfname
+
+Clears a data framework.
+**Example:**
+
+ClearDF D
+
+@subsubsection occt_2142243456_930384826543 CopyDF
+
+Syntax: CopyDF dfname1 entry1 [dfname2] entry2
+
+Copies a data framework.
+**Example:**
+
+CopyDF D 0:2 0:4
+
+@subsubsection occt_2142243456_930384826544 CopyLabel
+
+Syntax: CopyLabel dfname fromlabel tolablel
+
+Copies a label.
+**Example:**
+
+CopyLabel D1 0:2 0:4
+
+@subsubsection occt_2142243456_930384826545 MiniDumpDF
+
+Syntax: MiniDumpDF dfname
+
+Makes a mini-dump of a data framework.
+**Example:**
+
+MiniDumpDF D
+
+@subsubsection occt_2142243456_930384826546 XDumpDF
+
+Syntax: XDumpDF dfname
+
+Makes an extended dump of a data framework.
+**Example:**
+
+XDumpDF D
+
+@subsection occt_2142243456_93038482655 General attributes commands
+
+
+@subsubsection occt_2142243456_930384826551 SetInteger
+
+Syntax: SetInteger dfname entry value
+
+Finds or creates an Integer attribute at **entry** label and sets **value**.
+**Example:**
+
+SetInteger D 0:2 100
+
+@subsubsection occt_2142243456_930384826552 GetInteger
+
+Syntax: GetInteger dfname entry [drawname]
+
+Gets a value of an Integer attribute at **entry** label and sets it to **drawname** variable, if it is defined.
+**Example:**
+
+GetInteger D 0:2 Int1
+
+@subsubsection occt_2142243456_930384826553 SetReal
+
+Syntax: SetReal dfname entry value
+
+Finds or creates a Real attribute at **entry** label and sets **value**.
+**Example:**
+
+SetReal D 0:2 100.
+
+@subsubsection occt_2142243456_930384826554 GetReal
+
+Syntax: GetReal dfname entry [drawname]
+
+Gets a value of a Real attribute at **entry** label and sets it to **drawname** variable, if it is defined.
+**Example:**
+
+GetReal D 0:2 Real1
+
+@subsubsection occt_2142243456_930384826555 SetIntArray
+
+Syntax: SetIntArray dfname entry lower upper value1 value2 …
+
+Finds or creates an IntegerArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…**
+**Example:**
+
+SetIntArray D 0:2 1 4 100 200 300 400
+
+@subsubsection occt_2142243456_930384826556 GetIntArray
+
+Syntax: GetIntArray dfname entry
+
+Gets a value of an IntegerArray attribute at **entry** label.
+**Example:**
+
+GetIntArray D 0:2
+
+@subsubsection occt_2142243456_930384826557 SetRealArray
+
+Syntax: SetRealArray dfname entry lower upper value1 value2 …
+
+Finds or creates a RealArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…**
+**Example:**
+
+GetRealArray D 0:2 1 4 100. 200. 300. 400.
+
+@subsubsection occt_2142243456_930384826558 GetRealArray
+
+Syntax: GetRealArray dfname entry
+
+Gets a value of a RealArray attribute at **entry** label.
+**Example:**
+
+GetRealArray D 0:2
+
+@subsubsection occt_2142243456_930384826559 SetComment
+
+Syntax: SetComment dfname entry value
+
+Finds or creates a Comment attribute at **entry** label and sets **value**.
+**Example:**
+
+SetComment D 0:2 *My comment*
+
+@subsubsection occt_2142243456_9303848265510 GetComment
+
+Syntax: GetComment dfname entry
+
+Gets a value of a Comment attribute at **entry** label.
+**Example:**
+
+GetComment D 0:2
+
+@subsubsection occt_2142243456_9303848265511 SetExtStringArray
+
+Syntax: SetExtStringArray dfname entry lower upper value1 value2 …
+
+Finds or creates an ExtStringArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…**
+**Example:**
+
+SetExtStringArray D 0:2 1 3 *string1* *string2* *string3*
+
+@subsubsection occt_2142243456_9303848265512 GetExtStringArray
+
+Syntax: GetExtStringArray dfname entry
+
+Gets a value of an ExtStringArray attribute at **entry** label.
+**Example:**
+
+GetExtStringArray D 0:2
+
+@subsubsection occt_2142243456_9303848265513 SetName
+
+Syntax: SetName dfname entry value
+
+Finds or creates a Name attribute at **entry** label and set **value**.
+**Example:**
+
+SetName D 0:2 *My name*
+
+@subsubsection occt_2142243456_9303848265514 GetName
+
+Syntax: GetName dfname entry
+
+Gets a value of a Name attribute at **entry** label.
+**Example:**
+
+GetName D 0:2
+
+@subsubsection occt_2142243456_9303848265515 SetReference
+
+Syntax: SetReference dfname entry reference
+
+Creates a Reference attribute at **entry** label and sets **reference**.
+**Example:**
+
+SetReference D 0:2 0:4
+
+@subsubsection occt_2142243456_9303848265516 GetReference
+
+Syntax: GetReference dfname entry
+
+Gets a value of a Reference attribute at **entry** label.
+**Example:**
+
+GetReference D 0:2
+
+@subsubsection occt_2142243456_9303848265517 SetUAttribute
+
+Syntax: SetUAttribute dfname entry localGUID
+
+Creates a UAttribute attribute at **entry** label with **localGUID**.
+**Example:**
+
+set localGUID *c73bd076-22ee-11d2-acde-080009dc4422*
+SetUAttribute D 0:2 ${localGUID}
+
+@subsubsection occt_2142243456_9303848265518 GetUAttribute
+
+Syntax: GetUAttribute dfname entry loacalGUID
+
+Finds a UAttribute at **entry** label with **localGUID**.
+**Example:**
+
+set localGUID *c73bd076-22ee-11d2-acde-080009dc4422*
+GetUAttribute D 0:2 ${localGUID}
+
+@subsubsection occt_2142243456_9303848265519 SetFunction
+
+Syntax: SetFunction dfname entry ID failure
+
+Finds or creates a Function attribute at **entry** label with driver ID and **failure** index.
+**Example:**
+
+set ID *c73bd076-22ee-11d2-acde-080009dc4422*
+SetFunction D 0:2 ${ID} 1
+
+@subsubsection occt_2142243456_9303848265520 GetFunction
+
+Syntax: GetFunction dfname entry ID failure
+
+Finds a Function attribute at **entry** label and sets driver ID to **ID** variable and failure index to **failure** variable.
+**Example:**
+
+GetFunction D 0:2 ID failure
+
+@subsubsection occt_2142243456_9303848265521 NewShape
+
+Syntax: NewShape dfname entry [shape]
+
+
+Finds or creates a Shape attribute at **entry** label. Creates or updates the associated NamedShape attribute by **shape** if **shape** is defined.
+**Example:**
+
+box b 10 10 10
+NewShape D 0:2 b
+
+@subsubsection occt_2142243456_9303848265522 SetShape
+
+Syntax: SetShape dfname entry shape
+
+Creates or updates a NamedShape attribute at **entry** label by **shape**.
+**Example:**
+
+box b 10 10 10
+SetShape D 0:2 b
+
+@subsubsection occt_2142243456_9303848265523 GetShape
+
+Syntax: GetShape2 dfname entry shape
+
+Sets a shape from NamedShape attribute associated with **entry** label to **shape** draw variable.
+**Example:**
+
+GetShape2 D 0:2 b
+
+@subsection occt_2142243456_93038482656 Geometric attributes commands
+
+
+@subsubsection occt_2142243456_930384826561 SetPoint
+
+Syntax: SetPoint dfname entry point
+
+Finds or creates a Point attribute at **entry** label and sets **point** as generated in the associated NamedShape attribute.
+**Example:**
+
+point p 10 10 10
+SetPoint D 0:2 p
+
+@subsubsection occt_2142243456_930384826562 GetPoint
+
+Syntax: GetPoint dfname entry [drawname]
+
+Gets a vertex from NamedShape attribute at **entry** label and sets it to **drawname** variable, if it is defined.
+**Example:**
+
+GetPoint D 0:2 p
+
+@subsubsection occt_2142243456_930384826563 SetAxis
+
+Syntax: SetAxis dfname entry axis
+
+Finds or creates an Axis attribute at **entry** label and sets **axis** as generated in the associated NamedShape attribute.
+**Example:**
+
+line l 10 20 30 100 200 300
+SetAxis D 0:2 l
+
+@subsubsection occt_2142243456_930384826564 GetAxis
+
+Syntax: GetAxis dfname entry [drawname]
+
+Gets a line from NamedShape attribute at **entry** label and sets it to **drawname** variable, if it is defined.
+**Example:**
+
+GetAxis D 0:2 l
+
+@subsubsection occt_2142243456_930384826565 SetPlane
+
+Syntax: SetPlane dfname entry plane
+
+Finds or creates a Plane attribute at **entry** label and sets **plane** as generated in the associated NamedShape attribute.
+**Example:**
+
+plane pl 10 20 30 –1 0 0
+SetPlane D 0:2 pl
+
+@subsubsection occt_2142243456_930384826566 GetPlane
+
+Syntax: GetPlane dfname entry [drawname]
+
+Gets a plane from NamedShape attribute at **entry** label and sets it to **drawname** variable, if it is defined.
+**Example:**
+
+GetPlane D 0:2 pl
+
+@subsubsection occt_2142243456_930384826567 SetGeometry
+
+Syntax: SetGeometry dfname entry [type] [shape]
+
+
+Creates a Geometry attribute at **entry** label and sets **type** and **shape** as generated in the associated NamedShape attribute if they are defined. **type** must be one of the following: **any/pnt/lin/cir/ell/spl/pln/cyl**.
+**Example:**
+
+point p 10 10 10
+SetGeometry D 0:2 pnt p
+
+@subsubsection occt_2142243456_930384826568 GetGeometryType
+
+Syntax: GetGeometryType dfname entry
+
+Gets a geometry type from Geometry attribute at **entry** label.
+**Example:**
+
+GetGeometryType D 0:2
+
+@subsubsection occt_2142243456_930384826569 SetConstraint
+
+Syntax: SetConstraint dfname entry keyword geometrie [geometrie …]
+ SetConstraint dfname entry *plane* geometrie
+ SetConstraint dfname entry *value* value
+
+1. Creates a Constraint attribute at **entry** label and sets **keyword** constraint between geometry(ies).
+**keyword** must be one of the following:
+**rad/dia/minr/majr/tan/par/perp/concentric/equal/dist/angle/eqrad/symm/midp/ eqdist/fix/rigid**
+or
+**from/axis/mate/alignf/aligna/axesa/facesa/round/offset**
+
+2. Sets plane for the existing constraint.
+
+3. Sets value for the existing constraint.
+**Example:**
+
+SetConstraint D 0:2 *value* 5
+
+@subsubsection occt_2142243456_9303848265610 GetConstraint
+
+Syntax: GetConstraint dfname entry
+
+Dumps a Constraint attribute at **entry** label
+**Example:**
+
+GetConstraint D 0:2
+
+@subsubsection occt_2142243456_9303848265611 SetVariable
+
+Syntax: SetVariable dfname entry isconstant(0/1) units
+
+Creates a Variable attribute at **entry** label and sets **isconstant** flag and **units** as a string.
+**Example:**
+
+SetVariable D 0:2 1 *mm*
+
+@subsubsection occt_2142243456_9303848265612 GetVariable
+
+Syntax: GetVariable dfname entry isconstant units
+
+Gets an **isconstant** flag and **units** of a Variable attribute at **entry** label.
+**Example:**
+
+GetVariable D 0:2 isconstant units
+puts *IsConstant=${isconstant}*
+puts *Units=${units}*
+
+
+@subsection occt_2142243456_93038482657 Tree attributes commands
+
+
+@subsubsection occt_2142243456_930384826571 RootNode
+
+Syntax: RootNode dfname treenodeentry [ID]
+
+Returns ultimate father of TreeNode attribute identified by its **treenodeentry** and its **ID** (or default ID, if **ID** is not defined).
+
+
+@subsubsection occt_2142243456_930384826572 SetNode
+
+Syntax: SetNode dfname treenodeentry [ID]
+
+Creates a TreeNode attribute on the **treenodeentry** label with its tree **ID** (or assigns a default ID, if the **ID** is not defined).
+
+
+@subsubsection occt_2142243456_930384826573 AppendNode
+
+Syntax: AppendNode dfname fatherentry childentry [fatherID]
+
+
+Inserts a TreeNode attribute with its tree **fatherID** (or default ID, if **fatherID** is not defined) on **childentry** as last child of **fatherentry**.
+
+
+
+
+@subsubsection occt_2142243456_930384826574 PrependNode
+
+Syntax: PrependNode dfname fatherentry childentry [fatherID]
+
+
+Inserts a TreeNode attribute with its tree **fatherID** (or default ID, if **fatherID** is not defined) on **childentry** as first child of **fatherentry**.
+
+
+@subsubsection occt_2142243456_930384826575 InsertNodeBefore
+
+Syntax: InsertNodeBefore dfname treenodeentry beforetreenode [ID]
+
+Inserts a TreeNode attribute with tree **ID** (or default ID, if **ID** is not defined) **beforetreenode** before **treenodeentry**.
+
+
+@subsubsection occt_2142243456_930384826576 InsertNodeAfter
+
+Syntax: InsertNodeAfter dfname treenodeentry aftertreenode [ID]
+
+Inserts a TreeNode attribute with tree **ID** (or default ID, if **ID** is not defined) **aftertreenode** after **treenodeentry**.
+
+
+@subsubsection occt_2142243456_930384826577 DetachNode
+
+Syntax: DetachNode dfname treenodeentry [ID]
+
+Removes a TreeNode attribute with tree **ID** (or default ID, if **ID** is not defined) from **treenodeentry**.
+
+
+@subsubsection occt_2142243456_930384826578 ChildNodeIterate
+
+Syntax: ChildNodeIterate dfname treenodeentry alllevels(0/1) [ID]
+
+
+Iterates on the tree of TreeNode attributes with tree **ID** (or default ID, if **ID** is not defined). If **alllevels** is set to **1** it explores not only the first, but all the sub Step levels.
+**Example:**
+
+Label D 0:2
+Label D 0:3
+Label D 0:4
+Label D 0:5
+Label D 0:6
+Label D 0:7
+Label D 0:8
+Label D 0:9
+
+# Set root node
+SetNode D 0:2
+
+AppendNode D 0:2 0:4
+AppendNode D 0:2 0:5
+PrependNode D 0:4 0:3
+PrependNode D 0:4 0:8
+PrependNode D 0:4 0:9
+
+InsertNodeBefore D 0:5 0:6
+InsertNodeAfter D 0:4 0:7
+
+DetachNode D 0:8
+
+
+# List all levels
+ChildNodeIterate D 0:2 1
+
+==0:4
+==0:9
+==0:3
+==0:7
+==0:6
+==0:5
+
+
+# List only first levels
+ChildNodeIterate D 0:2 1
+
+==0:4
+==0:7
+==0:6
+==0:5
+
+@subsubsection occt_2142243456_930384826579 InitChildNodeIterator
+
+Syntax: InitChildNodeIterator dfname treenodeentry alllevels(0/1) [ID]
+
+
+Initializes the iteration on the tree of TreeNode attributes with tree **ID** (or default ID, if **ID** is not defined). If **alllevels** is set to **1** it explores not only the first, but also all sub Step levels.
+**Example:**
+
+InitChildNodeIterate D 0:5 1
+set aChildNumber 0
+for {set i 1} {$i 100} {incr i} {
+ if {[ChildNodeMore] == *TRUE*} {
+ puts *Tree node = [ChildNodeValue]*
+ incr aChildNumber
+ ChildNodeNext
+ }
+}
+puts *aChildNumber=$aChildNumber*
+
+@subsubsection occt_2142243456_9303848265710 ChildNodeMore
+
+Syntax: ChildNodeMore
+
+Returns TRUE if there is a current item in the iteration.
+
+
+@subsubsection occt_2142243456_9303848265711 ChildNodeNext
+
+Syntax: ChildNodeNext
+
+Moves to the next Item.
+
+
+@subsubsection occt_2142243456_9303848265712 ChildNodeValue
+
+Syntax: ChildNodeValue
+
+Returns the current treenode of ChildNodeIterator.
+
+
+@subsubsection occt_2142243456_9303848265713 ChildNodeNextBrother
+
+Syntax: ChildNodeNextBrother
+
+Moves to the next Brother. If there is none, goes up. This method is interesting only with ;allLevels; behavior.
+
+
+@subsection occt_2142243456_93038482658 Standard presentation commands
+
+
+@subsubsection occt_2142243456_930384826581 AISInitViewer
+
+Syntax: AISInitViewer docname
+
+Creates and sets AISViewer attribute at root label, creates AIS viewer window.
+**Example:**
+
+AISInitViewer D
+
+@subsubsection occt_2142243456_930384826582 AISRepaint
+
+Syntax: AISRepaint docname
+
+Updates the AIS viewer window.
+**Example:**
+
+AISRepaint D
+
+@subsubsection occt_2142243456_930384826583 AISDisplay
+
+Syntax: AISDisplay docname entry [not_update]
+
+
+Displays a presantation of AISobject from **entry** label in AIS viewer. If **not_update** is not defined then AISobject is recomputed and all visualization settings are applied.
+**Example:**
+
+AISDisplay D 0:5
+
+@subsubsection occt_2142243456_930384826584 AISUpdate
+
+Syntax: AISUpdate docname entry
+
+Recomputes a presantation of AISobject from **entry** label and applies the visualization setting in AIS viewer.
+**Example:**
+
+AISUpdate D 0:5
+
+@subsubsection occt_2142243456_930384826585 AISErase
+
+Syntax: AISErase docname entry
+
+Erases AISobject of **entry** label in AIS viewer.
+**Example:**
+
+AISErase D 0:5
+
+@subsubsection occt_2142243456_930384826586 AISRemove
+
+Syntax: AISRemove docname entry
+
+Erases AISobject of **entry** label in AIS viewer, then AISobject is removed from AIS_InteractiveContext.
+**Example:**
+
+AISRemove D 0:5
+
+@subsubsection occt_2142243456_930384826587 AISSet
+
+Syntax: AISSet docname entry ID
+
+
+Creates AISPresentation attribute at **entry** label and sets as driver ID. ID must be one of the following: **A** (axis), **C** (constraint), **NS** (namedshape), **G** (geometry), **PL** (plane), **PT** (point).
+**Example:**
+
+AISSet D 0:5 NS
+
+@subsubsection occt_2142243456_930384826588 AISDriver
+
+Syntax: AISDriver docname entry [ID]
+
+
+Returns DriverGUID stored in AISPresentation attribute of an **entry** label or sets a new one. ID must be one of the following: **A** (axis), **C** (constraint), **NS** (namedshape), **G** (geometry), **PL** (plane), **PT** (point).
+**Example:**
+
+# Get Driver GUID
+AISDriver D 0:5
+
+@subsubsection occt_2142243456_930384826589 AISUnset
+
+Syntax: AISUnset docname entry
+
+Deletes AISPresentation attribute (if it exists) of an **entry** label.
+**Example:**
+
+AISUnset D 0:5
+
+@subsubsection occt_2142243456_9303848265810 AISTransparency
+
+Syntax: AISTransparency docname entry [transparency]
+
+Sets (if **transparency** is defined) or gets the value of transparency for AISPresentation attribute of an **entry** label.
+**Example:**
+
+AISTransparency D 0:5 0.5
+
+@subsubsection occt_2142243456_9303848265811 AISHasOwnTransparency
+
+Syntax: AISHasOwnTransparency docname entry
+
+Tests AISPresentation attribute of an **entry** label by own transparency.
+**Example:**
+
+AISHasOwnTransparency D 0:5
+
+@subsubsection occt_2142243456_9303848265812 AISMaterial
+
+Syntax: AISMaterial docname entry [material]
+
+
+Sets (if **material** is defined) or gets the value of transparency for AISPresentation attribute of an **entry** label. **material** is integer from 0 to 20 (see **meshmat**).
+**Example:**
+
+AISMaterial D 0:5 5
+
+@subsubsection occt_2142243456_9303848265813 AISHasOwnMaterial
+
+Syntax: AISHasOwnMaterial docname entry
+
+Tests AISPresentation attribute of an **entry** label by own material.
+**Example:**
+
+AISHasOwnMaterial D 0:5
+
+@subsubsection occt_2142243456_9303848265814 AISColor
+
+Syntax: AISColor docname entry [color]
+
+Sets (if **color** is defined) or gets value of color for AISPresentation attribute of an **entry** label. **color** is integer from 0 to 516 (see color names in **vsetcolor**).
+**Example:**
+
+AISColor D 0:5 25
+
+@subsubsection occt_2142243456_9303848265815 AISHasOwnColor
+
+Syntax: AISHasOwnColor docname entry
+
+Tests AISPresentation attribute of an **entry** label by own color.
+**Example:**
+
+AISHasOwnColor D 0:5
+
+
+@section occt_2142243456_1101404852 Geometry commands
+
+@subsection occt_2142243456_110140485261 Overview
+
+Draw provides a set of commands to test geometry libraries. These commands are found in the TGEOMETRY executable, or in any Draw executable which includes GeometryTest commands.
+
+In the context of Geometry, Draw includes the following types of variable:
+
+ * 2d and 3d points
+ * The 2d curve, which corresponds to *Curve *in *Geom2d*.
+ * The 3d curve and surface, which correspond to *Curve *and *Surface *in *Geom *<a href="#_ftn2">[2]</a>.
+
+Draw geometric variables never share data; the **copy **command will always make a complete copy of the content of the variable.
+
+The following topics are covered in the nine sections of this chapter:
+
+ * **Curve creation** deals with the various types of curves and how to create them.
+ * **Surface creation** deals with the different types of surfaces and how to create them.
+ * **Curve and surface modification** deals with the commands used to modify the definition of curves and surfaces, most of which concern modifications to bezier and bspline curves.
+ * **Geometric transformations** covers translation, rotation, mirror image and point scaling transformations.
+ * **Curve and Surface Analysis** deals with the commands used to compute points, derivatives and curvatures.
+ * **Intersections** presents intersections of surfaces and curves.
+ * **Approximations** deals with creating curves and surfaces from a set of points.
+ * **Constraints** concerns construction of 2d circles and lines by constraints such as tangency.
+ * **Display** describes commands to control the display of curves and surfaces.
+
+Where possible, the commands have been made broad in application, i.e. they apply to 2d curves, 3d curves and surfaces. For instance, the **circle **command may create a 2d or a 3d circle depending on the number of arguments given.
+
+Likewise, the **translate **command will process points, curves or surfaces, depending on argument type. You may not always find the specific command you are looking for in the section where you expect it to be. In that case, look in another section. The **trim **command, for example, is described in the surface section. It can, nonetheless, be used with curves as well.
+
+@subsection occt_2142243456_110140485262 Curve creation
+
+This section deals with both points and curves. Types of curves are:
+
+ * Analytical curves such as lines, circles, ellipses, parabolas, and hyperbolas.
+ * Polar curves such as bezier curves and bspline curves.
+ * Trimmed curves and offset curves made from other curves with the **trim **and **offset **commands. Because they are used on both curves and surfaces, the **trim** and **offset** commands are described in the *surface creation *section.
+ * NURBS can be created from other curves using **convert **in the *Surface Creation *section.
+ * Curves can be created from the isoparametric lines of surfaces by the **uiso **and **viso **commands.
+ * 3d curves can be created from 2d curves and vice versa using the **to3d **and **to2d **commands. The **project **command computes a 2d curve on a 3d surface.
+
+Curves are displayed with an arrow showing the last parameter.
+
+
+@subsubsection occt_2142243456_1101404852621 point
+
+ @verbatim
+ Syntax: point name x y [z]
+ @endverbatim
+
+**point** creates a 2d or 3d point, depending on the number of arguments. **Example:**
+
+ @verbatim
+ # 2d point
+ point p1 1 2
+
+ # 3d point
+ point p2 10 20 -5
+ @endverbatim
+
+@subsubsection occt_2142243456_1101404852622 line
+
+ @verbatim
+ Syntax: line name x y [z] dx dy [dz]
+ @endverbatim
+
+**line** creates a 2d or 3d line. x y z are the coordinates of the line’s point of origin; dx, dy, dz give the direction vector.
+
+A 2d line will be represented asl x y dx dy, and a 3d line asl x y z dx dy dz. A line is parameterized along its length starting from the point of origin along the direction vector. The direction vector is normalized and must not be null. Lines are infinite, even though their representation is not. **Example:**
+
+ @verbatim
+ # a 2d line at 45 degrees of the X axis
+ line l 2 0 1 1
+
+ # a 3d line through the point 10 0 0 and parallel to Z
+ line l 10 0 0 0 0 1
+ @endverbatim
+
+@subsubsection occt_2142243456_1101404852623 circle
+
+Syntax: circle name x y [z [dx dy dz]] [ux uy [uz]] radius
+
+**circle **creates a 2d or a 3d circle.
+
+In 2d, x, y are the coordinates of the center and ux, uy define the vector towards the point of origin of the parameters. By default, this direction is (1,0). The X Axis of the local coordinate system defines the origin of the parameters of the circle. Use another vector than the x axis to change the origin of parameters.
+
+In 3d, x, y, z are the coordinates of the center; dx, dy, dz give the vector normal to the plane of the circle. By default, this vector is (0,0,1) i.e. the Z axis (it must not be null). ux, uy, uz is the direction of the origin; if not given, a default direction will be computed. This vector must neither be null nor parallel to dx, dy, dz.
+
+The circle is parameterized by the angle in [0,2*pi] starting from the origin and. Note that the specification of origin direction and plane is the same for all analytical curves and surfaces.
+
+**Example:**
+
+# A 2d circle of radius 5 centered at 10,-2
+circle c1 10 -2 5
+
+# another 2d circle with a user defined origin
+# the point of parameter 0 on this circle will be
+# 1+sqrt(2),1+sqrt(2)
+circle c2 1 1 1 1 2
+
+# a 3d circle, center 10 20 -5, axis Z, radius 17
+circle c3 10 20 -5 17
+
+# same 3d circle with axis Y
+circle c4 10 20 -5 0 1 0 17
+
+# full 3d circle, axis X, origin on Z
+circle c5 10 20 -5 1 0 0 0 0 1 17
+
+
+@subsubsection occt_2142243456_1101404852624 ellipse
+
+Syntax: ellipse name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius **ellipse **creates a 2d or 3d ellipse. In a 2d ellipse, the first two arguments define the center; in a 3d ellipse, the first three. The axis system is given by *firstradius*, the major radius, and *secondradius*, the minor radius. The parameter range of the ellipse is [0,2.*pi] starting from the X axis and going towards the Y axis. The Draw ellipse is parameterized by an angle:
+
+P(u) = O + firstradius*cos(u)*Xdir + secondradius*sin(u)*Ydir
+
+where:
+
+ * P is the point of parameter u,
+ * O, Xdir and Ydir are respectively the origin, *X Direction* and *Y Direction* of its local coordinate system.
+**Example:**
+
+# default 2d ellipse
+ellipse e1 10 5 20 10
+
+# 2d ellipse at angle 60 degree
+ellipse e2 0 0 1 2 30 5
+
+# 3d ellipse, in the XY plane
+ellipse e3 0 0 0 25 5
+
+# 3d ellipse in the X,Z plane with axis 1, 0 ,1
+ellipse e4 0 0 0 0 1 0 1 0 1 25 5
+
+See also: **circle**
+@subsubsection occt_2142243456_1101404852625 hyperbola
+
+Syntax: hyperbola name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius
+
+**hyperbola **creates a 2d or 3d conic. The first arguments define the center. The axis system is given by *firstradius*, the major radius, and *secondradius*, the minor radius. Note that the hyperbola has only one branch, that in the X direction.
+
+The Draw hyperbola is parameterized as follows:
+
+P(U) = O + firstradius*Cosh(U)*XDir + secondradius*Sinh(U)*YDir
+
+where:
+
+ * P is the point of parameter U,
+ * O, XDir and YDir are respectively the origin, *X Direction* and *Y
+
+Direction* of its local coordinate system.
+**Example:**
+
+# default 2d hyperbola, with asymptotes 1,1 -1,1
+hyperbola h1 0 0 30 30
+
+# 2d hyperbola at angle 60 degrees
+hyperbola h2 0 0 1 2 20 20
+
+# 3d hyperbola, in the XY plane
+hyperbola h3 0 0 0 50 50
+
+See also: **circle**
+
+
+@subsubsection occt_2142243456_1101404852626 parabola
+
+Syntax: parabola name x y [z [dx dy dz]] [ux uy [uz]] FocalLength
+
+**parabola **creates a 2d or 3d parabola. in the axis system defined by the first arguments.The origin is the apex of the parabola.
+
+The Geom_Parabola parabola is parameterized as follows:
+
+P(u) = O + u*u/(4.*F)*XDir + u*YDir
+
+where:
+ * P is the point of parameter u,
+ * O, XDir and YDir are respectively the origin, *X Direction* and *Y Direction* of its local coordinate system,
+ * F is the focal length of the parabola.
+**Example:**
+
+# 2d parabola
+parabola p1 0 0 50
+
+# 2d parabola with convexity +Y
+parabola p2 0 0 0 1 50
+
+# 3d parabola in the Y-Z plane, convexity +Z
+parabola p3 0 0 0 1 0 0 0 0 1 50
+
+See also: **circle**
+
+
+@subsubsection occt_2142243456_1101404852627 beziercurve, dbeziercurve
+
+Syntax: beziercurve name nbpole pole, [weight]
+2dbeziercurve name nbpole pole, [weight]
+
+**beziercurve **creates a 3d rational or non-rational Bezier curve. Give the number of poles (control points,) and the coordinates of the poles (x1 y1 z1 [w1] x2 y2 z2 [w2]). The degree will be nbpoles-1. To create a rational curve, give weights with the poles. You must give weights for all poles or for none. If the weights of all the poles are equal, the curve is polynomial, and therefore non-rational.
+**Example:**
+
+# a rational 2d bezier curve (arc of circle)
+2dbeziercurve ci 3 0 0 1 10 0 sqrt(2.)/2. 10 10 1
+
+# a 3d bezier curve, not rational
+beziercurve cc 4 0 0 0 10 0 0 10 0 10 10 10 10
+
+
+@subsubsection occt_2142243456_1101404852628 bsplinecurve, dbsplinecurve, pbsplinecurve, dpbsplinecurve
+
+Syntax: bsplinecurve name degree nbknots knot, umult pole, weight 2dbsplinecurve name degree nbknots knot, umult pole, weight pbsplinecurve name degree nbknots knot, umult pole, weight(periodic)
+2dpbsplinecurve name degree nbknots knot, umult pole, weight (periodic)
+
+**bsplinecurve **creates 2d or 3d bspline curves; the **pbsplinecurve **and **2dpbsplinecurve **commands create periodic bspline curves.
+
+A bspline curve is defined by its degree, its periodic or non-periodic nature, a table of knots and a table of poles (i.e. control points). Consequently, specify the degree, the number of knots, and for each knot, the multiplicity, for each pole, the weight. In the syntax above, the commas link the adjacent arguments which they fall between: knot and multiplicities, pole and weight.
+
+The table of knots is an increasing sequence of reals without repetition.
+Multiplicities must be lower or equal to the degree of the curve. For non-periodic curves, the first and last multiplicities can be equal to degree+1. For a periodic curve, the first and last multiplicities must be equal.
+
+The poles must be given with their weights, use weights of 1 for a non rational curve, the number of poles must be:
+
+ * For a non periodic curve: Sum of multiplicities - degree + 1
+ * For a periodic curve: Sum of multiplicities - last multiplicity
+**Example:**
+
+# a bspline curve with 4 poles and 3 knots
+bsplinecurve bc 2 3 0 3 1 1 2 3 \
+10 0 7 1 7 0 7 1 3 0 8 1 0 0 7 1
+# a 2d periodic circle (parameter from 0 to 2*pi !!)
+dset h sqrt(3)/2
+2dpbsplinecurve c 2 \
+4 0 2 pi/1.5 2 pi/0.75 2 2*pi 2 \
+0 -h/3 1 \
+0.5 -h/3 0.5 \
+0.25 h/6 1 \
+0 2*h/3 0.5 \
+-0.25 h/6 1 \
+-0.5 -h/3 0.5 \
+0 -h/3 1
+
+<h4>NOTE</h4>
+*You can create the **NURBS **subset of bspline curves and*
+*surfaces by trimming analytical curves and surfaces and*
+*executing the command *convert*; see below.*
+
+
+@subsubsection occt_2142243456_1101404852629 uiso, viso
+
+Syntax: uiso name surface u
+viso name surface u
+
+Use these commands to create a U or V isoparametric curve from a surface.
+**Example:**
+
+# create a cylinder and extract iso curves
+
+cylinder c 10
+uiso c1 c pi/6
+viso c2 c
+
+*NOTE*
+*Cannot be done from offset surfaces.*
+
+
+@subsubsection occt_2142243456_11014048526210 tod, tod
+
+Syntax: to3d name curve2d [plane]
+to2d name curve3d [plane]
+
+The **to3d **and **to2d **commands are used to create respectively a 3d curve from a 2d curve and a 2d curve from a 3d curve. The transformation uses a planar surface to define the XY plane in 3d (by default this plane is the default OXYplane). **to3d **always gives a correct result, but as **to2d **is not a projection, it may surprise you. It is always correct if the curve is planar and parallel to the plane of projection. The points defining the curve are projected on the plane. A circle, however, will remain a circle and will not be changed to an ellipse.
+**Example:**
+
+# the following commands
+circle c 0 0 5
+plane p -2 1 0 1 2 3
+to3d c c p
+
+# will create the same circle as
+circle c -2 1 0 1 2 3 5
+
+See also: **project**
+
+
+@subsubsection occt_2142243456_11014048526211 project
+
+Syntax: project name curve3d surface
+
+**project **computes a 2d curve in the parametric space of a surface corresponding to a 3d curve. This can only be used on analytical surfaces.
+**Example:**
+
+# intersect a cylinder and a plane
+# and project the resulting ellipse on the cylinder
+# this will create a 2d sinusoid-like bspline
+cylinder c 5
+plane p 0 0 0 0 1 1
+intersect i c p
+project i2d i c
+
+@subsection occt_2142243456_110140485263 Surface creation
+
+Types of surfaces are:
+
+ * Analytical surfaces: plane, cylinder, cone, sphere, torus.
+ * Polar surfaces: bezier surfaces, bspline surfaces
+ * Trimmed and Offset surfaces; see **trim**, **trimu**, **trimv**, **offset**.
+ * Surfaces produced by Revolution and Extrusion, created from curves with the **revsurf **and **extsurf**.
+ * NURBS surfaces.
+
+Surfaces are displayed with isoparametric lines. To show the parameterization, a small parametric line with a length 1/10 of V is displayed at 1/10 of U.
+
+
+@subsubsection occt_2142243456_1101404852631 plane
+
+Syntax: plane name [x y z [dx dy dz [ux uy uz]]]
+
+Uses this command to create an infinite plane. A plane is the same as a 3d coordinate system, x,y,z is the origin, dx, dy, dz is the Z direction and ux, uy, uz is the X direction. The plane is perpendicular to Z and X is the U parameter. dx,dy,dz and ux,uy,uz must not be null and not colinear. ux,uy,uz will be modified to be orthogonal to dx,dy,dz. There are default values for the coordinate system. If no arguments are given, the global system (0,0,0), (0,0,1), (1,0,0). If only the origin is given, the axes are those given by default(0,0,1), (1,0,0). If the origin and the Z axis are given, the X axis is generated perpendicular to the Z axis. Note that this definition will be used for all analytical surfaces.
+**Example:**
+
+# a plane through the point 10,0,0 perpendicular to X
+# with U direction on Y
+plane p1 10 0 0 1 0 0 0 1 0
+
+# an horixontal plane with origin 10, -20, -5
+plane p2 10 -20 -5
+
+
+@subsubsection occt_2142243456_1101404852632 cylinder
+
+Syntax: cylinder name [x y z [dx dy dz [ux uy uz]]] radius
+
+A cylinder is defined by a coordinate system, and a radius. The surface generated is an infinite cylinder with the Z axis as the axis. The U parameter is the angle starting from X going in the Y direction.
+See also: **plane**
+**Example:**
+
+# a cylinder on the default Z axis, radius 10
+cylinder c1 10
+
+# a cylinder, also along the Z axis but with origin 5,
+10, -3
+cylinder c2 5 10 -3 10
+
+# a cylinder through the origin and on a diagonal
+# with longitude pi/3 and latitude pi/4 (euler angles)
+dset lo pi/3. la pi/4.
+cylinder c3 0 0 0 cos(la)*cos(lo) cos(la)*sin(lo)
+sin(la) 10
+
+
+@subsubsection occt_2142243456_1101404852633 cone
+
+Syntax: cone name [x y z [dx dy dz [ux uy uz]]] semi-angle radius
+
+Creates a cone in the infinite coordinate system along the Z-axis. The radius is that of the circle at the intersection of the cone and the XY plane. The semi-angle is the angle formed by the cone relative to the axis; it should be between –90 and 90. If the radius is 0, the vertex is the origin.
+See also: **plane**
+**Example:**
+
+# a cone at 45 degrees at the origin on Z
+cone c1 45 0
+
+# a cone on axis Z with radius r1 at z1 and r2 at z2
+cone c2 0 0 z1 180.*atan2(r2-r1,z2-z1)/pi r1
+
+@subsubsection occt_2142243456_1101404852634 sphere
+
+Syntax: sphere name [x y z [dx dy dz [ux uy uz]]] radius
+
+Creates a sphere in the local coordinate system defined in the **plane **command. The sphere is centered at the origin. To parameterize the sphere, u is the angle from X to Y, between o and 2*pi. v is the angle in the half-circle at angle u in the plane containing the Z axis. v is between -pi/2 and pi/2. The poles are the points Z = +/- radius; their parameters are u,+/-pi/2 for any u in 0,2*pi.
+**Example:**
+# a sphere at the origin
+sphere s1 10
+# a sphere at 10 10 10, with poles on the axis 1,1,1
+sphere s2 10 10 10 1 1 1 10
+
+See also: **plane**
+
+
+@subsubsection occt_2142243456_1101404852635 torus
+
+Syntax: torus name [x y z [dx dy dz [ux uy uz]]] major minor
+
+Creates a torus in the local coordinate system with the given major and minor radii. Z is the axis for the major radius. The major radius may be lower in value than the minor radius.
+
+To parameterize a torus, u is the angle from X to Y; v is the angle in the plane at angle u from the XY plane to Z. u and v are in 0,2*pi.
+**Example:**
+
+# a torus at the origin
+torus t1 20 5
+
+# a torus in another coordinate system
+torus t2 10 5 -2 2 1 0 20 5
+
+See also: **plane**
+
+
+@subsubsection occt_2142243456_1101404852636 beziersurf
+
+Syntax: beziersurf name nbupoles nbvolpes pole, [weight]
+
+Use this command to create a bezier surface, rational or non-rational. First give the numbers of poles in the u and v directions.
+
+Then give the poles in the following order: pole(1, 1), pole(nbupoles, 1), pole(1, nbvpoles) and pole(nbupoles, nbvpoles).
+
+Weights may be omitted, but if you give one weight you must give all of them.
+**Example:**
+
+# a non-rational degree 2,3 surface
+beziersurf s 3 4 \
+0 0 0 10 0 5 20 0 0 \
+0 10 2 10 10 3 20 10 2 \
+0 20 10 10 20 20 20 20 10 \
+0 30 0 10 30 0 20 30 0
+
+See also: **beziercurve**
+
+@subsubsection occt_2142243456_1101404852637 bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf
+
+Syntax: bsplinesurf name udegree nbuknots uknot umult ... nbvknot vknot
+vmult ... x y z w ...
+upbsplinesurf ...
+vpbsplinesurf ...
+uvpbsplinesurf ...
+
+**bsplinesurf **generates bspline surfaces. **upbsplinesurf **creates a bspline surface periodic in u; **vpbsplinesurf **creates one periodic in v; and **uvpbsplinesurf **creates one periodic in uv.
+
+The syntax is similar to the **bsplinecurve **command. First give the degree in u and the knots in u with their multiplicities, then do the same in v. The poles follow. The number of poles is the product of the number in u and the number in v. See **bsplinecurve **to compute the number of poles, the poles are first given in U as in the beziersurf command. You must give weights if the surface is rational.
+**Example:**
+
+# create a bspline surface of degree 1 2
+# with two knots in U and three in V
+bsplinesurf s \
+1 2 0 2 1 2 \
+2 3 0 3 1 1 2 3 \
+0 0 0 1 10 0 5 1 \
+0 10 2 1 10 10 3 1 \
+0 20 10 1 10 20 20 1 \
+0 30 0 1 10 30 0 1
+
+See also: **bsplinecurve**, **beziersurf**, **convert**
+
+
+@subsubsection occt_2142243456_1101404852638 trim, trimu, trimv
+
+Syntax: trim newname name [u1 u2 [v1 v2]]
+trimu newname name
+trimv newname name
+
+The **trim **commands create trimmed curves or trimmed surfaces. Note that trimmed curves and surfaces are classes of the *Geom *package. The **trim **command creates either a new trimmed curve from a curve or a new trimmed surface in u and v from a surface. **trimu **creates a u-trimmed surface, and **trimv **a v-trimmed surface. After an initial trim, a second execution with no parameters given recreates the basis curve. The curves can be either 2d or 3d. If the trimming parameters decrease and if the curve or surface is not periodic, the direction is reversed.
+<h4>NOTE</h4>
+*Note that a trimmed curve or surface contains a copy of the*
+*basis geometry: modifying that will not modify the trimmed*
+*geometry. Trimming trimmed geometry will not create*
+*multiple levels of trimming. The basis geometry will be used.*
+**Example:**
+
+# create a 3d circle
+circle c 0 0 0 10
+
+# trim it, use the same variable, the original is
+deleted
+trim c c 0 pi/2
+
+# the original can be recovered!
+trim orc c
+
+# trim again
+trim c c pi/4 pi/2
+
+# the original is not the trimmed curve but the basis
+trim orc c
+
+# as the circle is periodic, the two following commands
+are identical
+trim cc c pi/2 0
+trim cc c pi/2 2*pi
+
+# trim an infinite cylinder
+cylinder cy 10
+trimv cy cy 0 50
+
+See also: **reverse**
+
+
+@subsubsection occt_2142243456_1101404852639 offset
+
+Syntax: offset name basename distance [dx dy dz]
+
+Creates offset curves or surfaces at a given distance from a basis curve or surface. Offset curves and surfaces are classes from the *Geom *package.
+
+The curve can be a 2d or a 3d curve. To compute the offsets for a 3d curve, you must also give a vector dx,dy,dz. For a planar curve, this vector is usually the normal to the plane containing the curve.
+
+The offset curve or surface copies the basic geometry, which can be modified later.
+**Example:**
+
+# graphic demonstration that the outline of a torus
+# is the offset of an ellipse
+smallview +X+Y
+dset angle pi/6
+torus t 0 0 0 0 cos(angle) sin(angle) 50 20
+fit
+ellipse e 0 0 0 50 50*sin(angle)
+# note that the distance can be negative
+offset l1 e 20 0 0 1
+@subsubsection occt_2142243456_11014048526310 revsurf
+
+Syntax: revsurf name curvename x y z dx dy dz
+
+Creates a surface of revolution from a 3d curve. A surface of revolution or revolved surface is obtained by rotating a curve (called the *meridian*) through a complete revolution about an axis (referred to as the *axis of revolution*). The curve and the axis must be in the same plane (the *reference plane* of the surface). Give the point of origin x,y,z and the vector dx,dy,dz to define the axis of revolution. To parameterize a surface of revolution: u is the angle of rotation around the axis. Its origin is given by the position of the meridian on the surface. v is the parameter of the meridian.
+**Example:**
+
+# another way of creating a torus like surface
+circle c 50 0 0 20
+revsurf s c 0 0 0 0 1 0
+
+
+@subsubsection occt_2142243456_11014048526311 extsurf
+
+Syntax: extsurf newname curvename dx dy dz
+
+Use the **extsurf **command to create a surface of linear extrusion from a 3d curve. The basis curve is swept in a given direction,the *direction of extrusion* defined by a vector. In the syntax, dx,dy,dz gives the direction of extrusion. To parameterize a surface of extrusion: u is the parameter along the extruded curve; the v parameter is along the direction of extrusion.
+**Example:**
+
+# an elliptic cylinder
+ellipse e 0 0 0 10 5
+extsurf s e 0 0 1
+# to make it finite
+trimv s s 0 10
+
+
+@subsubsection occt_2142243456_11014048526312 convert
+
+Syntax: convert newname name
+
+**convert **creates a 2d or 3d NURBS curve or a NURBS surface from any 2d curve, 3d curve or surface. In other words, conics, beziers and bsplines are turned into NURBS. Offsets are not processed.
+**Example:**
+
+# turn a 2d arc of a circle into a 2d NURBS
+circle c 0 0 5
+trim c c 0 pi/3
+convert c1 c
+
+# an easy way to make a planar bspline surface
+plane p
+trim p p -1 1 -1 1
+convert p1 p
+
+<h4>NOTE</h4>
+*Offset curves and surfaces are not treated by this command.*
+
+
+
+@subsection occt_2142243456_110140485264 Curve and surface modifications
+
+Draw provides commands to modify curves and surfaces, some of them are general, others restricted to bezier curves or bsplines.
+
+General modifications:
+
+ * Reversing the parametrization: **reverse**, **ureverse**, **vreverse**
+
+Modifications for both bezier curves and bsplines:
+
+ * Exchanging U and V on a surface: **exchuv**
+ * Segmentation: **segment**, **segsur**
+ * Increasing the degree: **incdeg**, **incudeg**, **incvdeg**
+ * Moving poles: **cmovep**, **movep**, **movecolp**, **moverowp**
+
+Modifications for bezier curves:
+
+ * Adding and removing poles: **insertpole**, **rempole**, **remcolpole**, **remrowpole**
+
+Modifications for bspline:
+
+ * Inserting and removing knots: **insertknot**, **remknot**, **insertuknot**, **remuknot**, **insetvknot**, **remvknot**
+ * Modifying periodic curves and surfaces: **setperiodic**, **setnotperiodic**, **setorigin**, **setuperiodic**, **setunotperiodic**, **setuorigin**, **setvperiodic**, **setvnotperiodic**, **setvorigin**
+
+
+
+
+
+@subsubsection occt_2142243456_1101404852641 reverse, ureverse, vreverse
+
+
+Syntax: reverse curvename
+ureverse surfacename
+vreverse surfacename
+
+The **reverse **command reverses the parameterization and inverses the orientation of a 2d or 3d curve. Note that the geometry is modified. To keep the curve or the surface, you must copy it before modification.
+
+**ureverse **or **vreverse **reverse the u or v parameter of a surface. Note that the new parameters of the curve may change according to the type of curve. For instance, they will change sign on a line or stay 0,1 on a bezier.
+
+Reversing a parameter on an analytical surface may create an indirect coordinate system.
+**Example:**
+
+# reverse a trimmed 2d circle
+circle c 0 0 5
+trim c c pi/4 pi/2
+reverse c
+
+# dumping c will show that it is now trimmed between
+# 3*pi/2 and 7*pi/4 i.e. 2*pi-pi/2 and 2*pi-pi/4
+
+
+@subsubsection occt_2142243456_1101404852642 exchuv
+
+Syntax: exchuv surfacename
+
+For a bezier or bspline surface this command exchanges the u and v parameters.
+**Example:**
+
+# exchanging u and v on a spline (made from a cylinder)
+cylinder c 5
+trimv c c 0 10
+convert c1 c
+exchuv c1
+
+
+@subsubsection occt_2142243456_1101404852643 segment, segsur
+
+Syntax: segment curve Ufirst Ulast
+segsur surface Ufirst Ulast Vfirst Vlast
+
+**segment **and **segsur **segment a bezier curve and a bspline curve or surface respectively. These commands modify the curve to restrict it between the new parameters: the starting point of the modified curve, Ufirst, and the end point, Ulast. Ufirst is less than Ulast.
+
+This command must not be confused with **trim **which creates new geometry.
+
+**Example:**
+
+# segment a bezier curve in half
+beziercurve c 3 0 0 0 10 0 0 10 10 0
+segment c ufirst ulast
+
+
+@subsubsection occt_2142243456_1101404852644 iincudeg, incvdeg
+
+Syntax: incudeg surfacename newdegree
+incvdeg surfacename newdegree
+
+**incudeg **and **incvdeg **increase the degree in the U or V parameter of a bezier or bspline surface.
+**Example:**
+
+# make a planar bspline and increase the degree to 2 3
+plane p
+trim p p -1 1 -1 1
+convert p1 p
+incudeg p1 2
+incvdeg p1 3
+
+<h4>NOTE</h4>
+*The geometry is modified.*
+
+
+@subsubsection occt_2142243456_1101404852645 cmovep, movep, movecolp, moverowp
+
+Syntax: cmovep curve index dx dy [dz]
+movep surface uindex vindex dx dy dz
+movecolp surface uindex dx dy dz
+moverowp surface vindex dx dy dz
+
+**move **methods translate poles of a bezier curve, a bspline curve or a bspline surface. **cmovep **and **movep **translate one pole with a given index.
+
+**movecolp **and **moverowp **translate a whole column (expressed by the uindex) or row (expressed by the vindex) of poles.
+**Example:**
+
+# start with a plane
+# transform to bspline, raise degree and add relief
+plane p
+trim p p -10 10 -10 10
+convert p1 p
+incud p1 2
+incvd p1 2
+movecolp p1 2 0 0 5
+moverowp p1 2 0 0 5
+movep p1 2 2 0 0 5
+
+
+@subsubsection occt_2142243456_1101404852646 insertpole, rempole, remcolpole, remrowpole
+
+Syntax: insertpole curvename index x y [z] [weight]
+rempole curvename index
+remcolpole surfacename index
+remrowpole surfacename index
+
+**insertpole **inserts a new pole into a 2d or 3d bezier curve. You may add a weight for the pole. The default value for the weight is 1. The pole is added at the position after that of the index pole. Use an index 0 to insert the new pole before the first one already existing in your drawing.
+
+**rempole **removes a pole from a 2d or 3d bezier curve. Leave at least two poles in the curves.
+
+**remcolpole **and **remrowpole **remove a column or a row of poles from a bezier surface. A column is in the v direction and a row in the u direction The resulting degree must be at least 1; i.e there will be two rows and two columns left.
+**Example:**
+
+# start with a segment, insert a pole at end
+# then remove the central pole
+beziercurve c 2 0 0 0 10 0 0
+insertpole c 2 10 10 0
+rempole c 2
+
+
+@subsubsection occt_2142243456_1101404852647 insertknot, insertuknot, insertvknot
+
+Syntax: insertknot name knot [mult = 1] [knot mult ...]
+insertuknot surfacename knot mult
+insertvknot surfacename knot mult
+
+**insertknot **inserts knots in the knot sequence of a bspline curve. You must give a knot value and a target multiplicity. The default multiplicity is 1. If there is already a knot with the given value and a multiplicity lower than the target one, its multiplicity will be raised. **insertuknot **and **insertvknot **insert knots in a surface.
+
+
+
+
+**Example:**
+
+# create a cylindrical surface and insert a knot
+cylinder c 10
+trim c c 0 pi/2 0 10
+convert c1 c
+insertuknot c1 pi/4 1
+
+@subsubsection occt_2142243456_1101404852648 remknot, remuknot, remvknot
+
+Syntax: remknot index [mult] [tol]
+remuknot index [mult] [tol]
+remvknot index [mult] [tol]
+
+**remknot **removes a knot from the knot sequence of a curve or a surface. Give the index of the knot and optionally, the target multiplicity. If the target multiplicity is not 0, the multiplicity of the knot will be lowered. As the curve may be modified, you are allowed to set a tolerance to control the process. If the tolerance is low, the knot will only be removed if the curve will not be modified.
+
+By default, if no tolerance is given, the knot will always be removed.
+**Example:**
+
+# bspline circle, remove a knot
+circle c 0 0 5
+convert c1 c
+incd c1 5
+remknot c1 2
+
+*NOTE*
+*Curves or Surfaces may be modified.*
+
+
+@subsubsection occt_2142243456_1101404852649 setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic
+
+Syntax: setperiodic curve
+setnotperiodic curve
+setuperiodic surface
+setunotperiodic surface
+setvperiodic surface
+setvnotperiodic surface
+
+**setperiodic **turns a bspline curve into a periodic bspline curve; the knot vector stays the same and excess poles are truncated. The curve may be modified if it has not been closed. **setnotperiodic **removes the periodicity of a periodic curve. The pole table mau be modified. Note that knots are added at the beginning and the end of the knot vector and the multiplicities are knots set to degree+1 at the start and the end.
+
+**setuperiodic **and **setvperiodic **make the u or the v parameter of bspline surfaces periodic; **setunotperiodic**, and **setvnotperiodic **remove periodicity from the u or the v parameter of bspline surfaces.
+**Example:**
+
+# a circle deperiodicized
+circle c 0 0 5
+convert c1 c
+setnotperiodic c1
+@subsubsection occt_2142243456_11014048526410 setorigin, setuorigin, setvorigin
+
+Syntax: setorigin curvename index
+setuorigin surfacename index
+setuorigin surfacename index
+
+These commands change the origin of the parameters on periodic curves or surfaces. The new origin must be an existing knot. To set an origin other than an existing knot, you must first insert one with the **insertknot **command.
+**Example:**
+
+# a torus with new U and V origins
+torus t 20 5
+convert t1 t
+setuorigin t1 2
+setvorigin t1 2
+
+
+@subsection occt_2142243456_110140485265 Transformations
+
+Draw provides commands to apply linear transformations to geometric objects: they include translation, rotation, mirroring and scaling.
+
+@subsubsection occt_2142243456_1101404852651 translate, dtranslate
+
+Syntax: translate name [names ...] dx dy dz
+2dtranslate name [names ...] dx dy
+
+The **Translate **command translates 3d points, curves and surfaces along a vector dx,dy,dz. You can translate more than one object with the same command.
+
+For 2d points or curves, use the **2dtranslate **command.
+**Example:**
+
+# 3d tranlation
+point p 10 20 30
+circle c 10 20 30 5
+torus t 10 20 30 5 2
+translate p c t 0 0 15
+*NOTE*
+*Objects are modified by this command.*
+
+@subsubsection occt_2142243456_1101404852652 rotate, drotate
+
+Syntax: rotate name [name ...] x y z dx dy dz angle
+2drotate name [name ...] x y angle
+The **rotate **command rotates a 3d point curve or surface. You must give an axis of rotation with a point x,y,z, a vector dx,dy,dz, and an angle in degrees.
+
+For a 2d rotation, you need only give the center point and the angle. In 2d or 3d, the angle can be negative.
+**Example:**
+
+# make a helix of circles. create a scripte file with
+this code and execute it using **source**.
+circle c0 10 0 0 3
+for {set i 1} {$i = 10} {incr i} {
+copy c[expr $i-1] c$i
+translate c$i 0 0 3
+rotate c$i 0 0 0 0 0 1 36
+}
+
+@subsubsection occt_2142243456_1101404852653 pmirror, lmirror, smirror, dpmirror, dlmirror
+
+Syntax: pmirror name [names ...] x y z
+lmirror name [names ...] x y z dx dy dz
+smirror name [names ...] x y z dx dy dz
+2dpmirror name [names ...] x y
+2dlmirror name [names ...] x y dx dy
+
+The mirror commands perform a mirror transformation of 2d or 3d geometry.
+
+**pmirror **is the point mirror, mirroring 3d curves and surfaces about a point of symmetry. **lmirror **is the line mirror commamd, mirroring 3d curves and surfaces about an axis of symmetry. **smirror **is the surface mirror, mirroring 3d curves and surfaces about a plane of symmetry. In the last case, the plane of symmetry is perpendicular to dx,dy,dz.
+
+In 2d, only **2dpmirror**, point symmetry mirroring, and **2dlmirror**, axis symmetry mirroring, are available.
+**Example:**
+
+# build 3 images of a torus
+torus t 10 10 10 1 2 3 5 1
+copy t t1
+pmirror t1 0 0 0
+copy t t2
+lmirror t2 0 0 0 1 0 0
+copy t t3
+smirror t3 0 0 0 1 0 0
+
+@subsubsection occt_2142243456_1101404852654 pscale, dpscale
+
+Syntax: pscale name [name ...] x y z s
+2dpscale name [name ...] x y s
+The **pscale **and **2dpscale **commands transform an object by point scaling. You must give the center and the scaling factor. Because other scalings modify the type of the object, they are not provided. For example, a sphere may be transformed into an ellipsoid. Using a scaling factor of -1 is similar to using **pmirror**.
+**Example:**
+
+# double the size of a sphere
+sphere s 0 0 0 10
+pscale s 0 0 0 2
+
+@subsection occt_2142243456_110140485266 Curve and surface analysis
+
+**Draw **provides methods to compute information about curves and surfaces:
+
+ * **coord **to find the coordinates of a point.
+ * **cvalue **and **2dcvalue **to compute points and derivatives on curves.
+ * **svalue **to compute points and derivatives on a surface.
+ * **localprop **and **minmaxcurandif **to compute the curvature on a curve.
+ * **parameters **to compute (u,v) values for a point on a surface.
+ * **proj **and **2dproj **to project a point on a curve or a surface.
+ * **surface_radius **to compute the curvature on a surface.
+
+@subsubsection occt_2142243456_1101404852661 coord
+
+Syntax: coord P x y [z]
+
+The **coord **command will set the coordinates of the point P. x, y (and optionally z)
+**Example:**
+
+# translate a point
+point p 10 5 5
+translate p 5 0 0
+coord p x y z
+# x value is 15
+See also: **point**
+@subsubsection occt_2142243456_1101404852662 cvalue, dcvalue
+
+Syntax: cvalue curve U x y z [d1x d1y d1z [d2x d2y d2z]]
+2dcvalue curve U x y [d1x d1y [d2x d2y]]
+
+For a curve at a given parameter, and depending on the number of arguments, **cvalue **computes: the coordinates in x,y,z, the first derivative in d1x,d1y,d1z and the second derivative in d2x,d2y,d2z.
+**Example:**
+
+# on a bezier curve at parameter 0
+# the point is the first pole
+# the derivative is the vector first to second pole
+# multiplied by the degree
+# the second derivative is the difference
+# first to second pole, second to third pole
+# multipied by degree * degree-1
+2dbeziercurve c 4 0 0 1 1 2 1 3 0
+2dcvalue c 0 x y d1x d1y d2x d2y
+
+# values of x y d1x d1y d2x d2y
+# are 0 0 3 3 0 -6
+
+
+@subsubsection occt_2142243456_1101404852663 svalue
+
+Syntax: svalue surfname U v x y z [dux duy duz dvx dvy dvz [d2ux d2uy d2uz d2vx d2vy d2vz d2uvx d2uvy d2uvz]]
+
+**svalue **computes points and derivatives on a surface for a pair of parameter values. The result depends on the number of arguments. You can compute first and second derivatives.
+**Example:**
+
+# display points on a sphere
+sphere s 10
+for {dset t 0} {[dval t] = 1} {dset t t+0.01} {
+svalue s t*2*pi t*pi-pi/2 x y z
+point . x y z
+}
+
+
+@subsubsection occt_2142243456_1101404852664 localprop, minmaxcurandinf
+
+Syntax: localprop curvename U
+minmaxcurandinf curve
+
+The **localprop **command computes the curvature of a curve.
+**minmaxcurandinf **computes and prints the parameters of the points where the curvature is minimum and maximum on a 2d curve.
+**Example:**
+
+# show curvature at the center of a bezier curve
+beziercurve c 3 0 0 0 10 2 0 20 0 0
+localprop c 0.5
+== Curvature : 0.02
+
+See also: **surface_radius**
+
+
+@subsubsection occt_2142243456_1101404852665 parameters
+
+Syntax: parameters surf/curve x y z U [V]
+
+The **parameters **command returns the parameters on the surface of the 3d point x,y,z in variables u and v . This command may only be used on analytical surfaces: plane, cylinder, cone, sphere and torus.
+**Example:**
+
+# Compute parameters on a plane
+plane p 0 0 10 1 1 0
+parameters p 5 5 5 u v
+# the values of u and v are : 0 5
+
+
+@subsubsection occt_2142243456_1101404852666 proj, dproj
+
+Syntax: proj name x y z
+2dproj name xy
+
+Use **proj **to project a point on a 3d curve or a surface and **2dproj **for a 2d curve.
+
+The command will compute and display all points in the projection. The lines joining the point to the projections are created with the names ext_1, ext_2, ...
+**Example:**
+
+# project point on a torus
+torus t 20 5
+proj t 30 10 7
+== ext_1 ext_2 ext_3 ext_4
+
+
+@subsubsection occt_2142243456_1101404852667 surface_radius
+
+Syntax: surface_radius surface u v [c1 c2]
+
+The **surface_radius **command computes the main curvatures of a surface at parameters (u,v). If there are extra arguments, their curvatures are stored in variables c1 and c2.
+**Example:**
+
+# computes curvatures of a cylinder
+cylinder c 5
+surface_radius c pi 3 c1 c2
+== Min Radius of Curvature : -5
+== Min Radius of Curvature : infinite
+
+
+
+@subsection occt_2142243456_110140485267 Intersections
+
+The **intersect **command computes intersections of surfaces; the **2dintersect **command, intersections of 2d curves.
+
+
+@subsubsection occt_2142243456_1101404852671 intersect
+
+Syntax: intersect name surface1 surface2
+
+The **intersect **command intersects two surfaces. If there is one intersection curve it will be named ;name;, if there are more than one they will be named ;name_1;, ;name_2;, ...
+**Example:**
+
+# create an ellipse
+cone c 45 0
+plane p 0 0 40 0 1 5
+intersect e c p
+
+
+@subsubsection occt_2142243456_1101404852672 dintersect
+
+Syntax: 2dintersect curve1 curve2
+
+**2dintersect **displays the intersection points between two 2d curves.
+**Example:**
+
+# intersect two 2d ellipses
+ellipse e1 0 0 5 2
+ellipse e2 0 0 0 1 5 2
+2dintersect e1 e2
+@subsection occt_2142243456_110140485268 Approximations
+
+Draw provides command to create curves and surfaces by approximation.
+
+**2dapprox **fits a curve through 2d points, **appro **fits a curve through 3d points, **surfapp **and **grilapp **fits a surface through 3d points, **2dinterpolate **may be used to interpolate a curve.
+
+@subsubsection occt_2142243456_1101404852681 appro, dapprox
+
+Syntax: appro result nbpoint [curve]
+2dapprox result nbpoint [curve / x1 y1 x2 y2]
+
+These commands fit a curve through a set of points. First give the number of points, then choose one of the three ways available to get the points. If you have no arguments, click on the points. If you have a curve argument or a list of points, the command launches computation of the points on the curve.
+**Example:**
+
+# pick points and they will be fitted
+2dapprox c 10
+
+
+@subsubsection occt_2142243456_1101404852682 surfapp, grilapp
+
+
+Syntax: surfapp name nbupoints nbvpoints x y z ....
+grilapp name nbupoints nbvpoints xo dx yo dy z11 z12 ...
+
+**surfapp **fits a surface through an array of u and v points, nbupoints*nbvpoints.
+
+**grilapp **has the same function, but the x,y coordinates of the points are on a grid starting at x0,y0 with steps dx,dy.
+**Example:**
+
+# a surface using the same data as in the beziersurf
+example sect 4.4
+surfapp s 3 4 \
+0 0 0 10 0 5 20 0 0 \
+0 10 2 10 10 3 20 10 2 \
+0 20 10 10 20 20 20 20 10 \
+0 30 0 10 30 0 20 30 0
+
+
+
+
+
+@subsection occt_2142243456_110140485269 Constraints
+
+The **cirtang **command is used to construct 2d circles tangent to curves and **lintan **to construct 2d lines tangent to curves.
+
+
+@subsubsection occt_2142243456_1101404852691 cirtang
+
+Syntax: cirtang cname curve/point/radius curve/point/radius curve/point/radius
+
+The **cirtang **command will build all circles satisfying the three constraints which are either a curve (the circle must be tangent to that curve), a point (the circle must pass through that point), or a radius for the circle. Only one constraint can be a radius. The solutions will be stored in variables *name_1*, *name_2*, etc.
+**Example:**
+
+# a point, a line and a radius. 2 solutions
+point p 0 0
+line 1 10 0 -1 1
+cirtang c p 1 4
+== c_1 c_2
+
+
+@subsubsection occt_2142243456_1101404852692 lintan
+
+Syntax: lintan name curve curve [angle]
+
+The **lintan **command will build all 2d lines tangent to two curves. If a third angle argument is given the second curve must be a line and **lintan **will build all lines tangent to the first curve and forming the given angle with the line. The angle is given in degrees. The solutions are named name_1, name_2, etc.
+**Example:**
+
+# lines tangent to 2 circles, 4 solutions
+circle c1 -10 0 10
+circle c2 10 0 5
+lintan l c1 c2
+
+# lines at 15 degrees tangent to a circle and a line, 2
+solutions: l1_1 l1_2
+circle c1 -10 0 1
+line l 2 0 1 1
+lintan l1 c1 l 15
+
+
+
+
+@subsection occt_2142243456_1101404852610 Display
+
+Draw provides commands to control the display of geometric objects. Some display parameters are used for all objects, others are valid for surfaces only, some for bezier and bspline only, and others for bspline only.
+
+On curves and surfaces, you can control the mode of representation with the **dmode **command. You can control the parameters for the mode with the **defle **command and the **discr **command, which control deflection and discretization respectively.
+
+On surfaces, you can control the number of isoparametric curves displayed on the surface with the **nbiso **commands.
+
+On bezier and bspline curve and surface you can toggle the display of the control points with the **clpoles **and **shpoles **commands.
+
+On bspline curves and surfaces you can toggle the display of the knots with the **shknots **and **clknots **commands.
+
+
+@subsubsection occt_2142243456_11014048526101 dmod, discr, defle
+
+Syntax: dmode name [name ...] u/d
+discr name [name ...] nbintervals
+defle name [name ...] deflection
+
+**dmode **allows you to choose the display mode for a curve or a surface.
+
+In mode ;u;, or *uniform deflection*, the points are computed to keep the polygon at a distance lower than the deflection of the geometry. The deflection is set with the **defle **command. This mode involves intensive use of computational power.
+
+In ;d;, or discretization mode, a fixed number of points is computed. This number is set with the **discr **command. This is the default mode. On a bspline, the fixed number of points is computed for each span of the curve. (A span is the interval between two knots).
+
+If the curve or the isolines seem to present too many angles, you can either increase the discretization or lower the deflection, depending on the mode. This will increase the number of points.
+**Example:**
+
+# increment the number of points on a big circle
+circle c 0 0 50 50
+discr 100
+
+# change the mode
+dmode c u
+
+
+@subsubsection occt_2142243456_11014048526102 nbiso
+
+Syntax: nbiso name [names...] nuiso nviso
+
+**nbiso **changes the number of isoparametric curves displayed on a surface in the U and V directions. On a bspline surface, isoparametric curves are displayed by default at knot values. Use **nbiso **to turn this feature off.
+**Example:**
+
+# display 35 meridians and 15 parallels on a spere
+sphere s 20
+nbiso s 35 15
+
+
+@subsubsection occt_2142243456_11014048526103 clpoles, shpoles
+
+Syntax: clpoles name
+shpoles name
+
+On bezier and bspline curves and surfaces, the control polygon is displayed by default: **clpoles **erases it and **shpoles **restores it.
+**Example:**
+
+# make a bezier curve and erase the poles
+beziercurve c 3 0 0 0 10 0 0 10 10 0
+clpoles c
+
+
+@subsubsection occt_2142243456_11014048526104 clknots, shknots
+
+Syntax: clknots name
+shknots name
+
+By default, knots on a bspline curve or surface are displayed with markers at the points with parametric value equal to the knots. **clknots **removes them and **shknots **restores them.
+**Example:**
+
+# hide the knots on a bspline curve
+bsplinecurve bc 2 3 0 3 1 1 2 3 \
+10 0 7 1 7 0 7 1 3 0 8 1 0 0 7 1
+clknots bc
+@section occt_2142243456_1869436669 Topology commands
+
+
+
+
+
+
+
+Draw provides a set of commands to test OCCT Topology libraries. The Draw commands are found in the DRAWEXE executable or in any executable including the BRepTest commands.
+
+Topology defines the relationship between simple geometric entities, which can thus be linked together to represent complex shapes. The type of variable used by Topology in Draw is the shape variable.
+
+The different topological shapes<a href="#_ftn3">[3]</a> include:
+
+ * COMPOUND: A group of any type of topological object.
+ * COMPSOLID: A set of solids connected by their faces. This expands the notions of WIRE and SHELL to solids.
+ * SOLID: A part of space limited by shells. It is three dimensional.
+ * SHELL: A set of faces connected by their edges. A shell can be open or closed.
+ * FACE: In 2d, a plane; in 3d, part of a surface. Its geometry is constrained (trimmed) by contours. It is two dimensional.
+ * WIRE: A set of edges connected by their vertices. It can be open or closed depending on whether the edges are linked or not.
+ * EDGE: A topological element corresponding to a restrained curve. An edge is generally limited by vertices. It has one dimension.
+ * VERTEX: A topological element corresponding to a point. It has a zero dimension.
+
+Shapes are usually shared. **copy **will create a new shape which shares its representation with the original. Nonetheless, two shapes sharing the same topology can be moved independently (see the section on **transformation**).
+
+The following topics are covered in the eight sections of this chapter:
+
+ * Basic shape commands to handle the structure of shapes and control the display.
+ * Curve and surface topology, or methods to create topology from geometry and vice versa.
+ * Primitive construction commands: box, cylinder, wedge etc.
+ * Sweeping of shapes.
+ * Transformations of shapes: translation, copy, etc.
+ * Topological operations, or booleans.
+ * Drafting and blending.
+ * Analysis of shapes.
+
+
+
+@subsection occt_2142243456_186943666971 Basic topology
+
+The set of basic commands allows simple operations on shapes, or step-by-step construction of objects. These commands are useful for analysis of shape structure and include:
+
+ * **isos **and **discretisation **to control display of shape faces by isoparametric curves .
+ * **orientation**, **complement **and **invert **to modify topological attributes such as orientation.
+ * **explode**, **exwire **and **nbshapes **to analyze the structure of a shape.
+ * **emptycopy**, **add**, **compound **to create shapes by stepwise construction.
+
+In Draw, shapes are displayed using isoparametric curves. There is color coding for the edges:
+
+ * a red edge is an isolated edge, which belongs to no faces.
+ * a green edge is a free boundary edge, which belongs to one face,
+ * a yellow edge is a shared edge, which belongs to at least two faces.
+
+
+@subsubsection occt_2142243456_1869436669711 isos, discretisation
+
+Syntax: isos [name ...][nbisos]
+discretisation nbpoints
+**isos **determines or changes the number of isoparametric curves on shapes.
+
+The same number is used for the u and v directions. With no arguments, **isos **prints the current default value. To determine, the number of isos for a shape, give it name as the first argument.
+
+**discretisation **changes the default number of points used to display the curves. The default value is 30.
+**Example:**
+
+# Display only the edges (the wireframe)
+isos 0
+
+<h4>NOTE</h4>
+Don’t confuse *isos* and *discretisation* with the geometric
+*commands *nbisos* and *discr*.*
+
+
+@subsubsection occt_2142243456_1869436669712 orientation, complement, invert, normals, range
+
+Syntax: orientation name [name ...] F/R/E/I
+complement name [name ...]
+invert name
+normals s (length = 10), disp normals
+range name value value
+
+**orientation **assigns the orientation of shapes - simple and complex - to one of the following four values: FORWARD, REVERSED, INTERNAL, EXTERNAL.
+
+**complement **changes the current orientation of shapes to its complement, FORWARD - REVERSED, INTERNAL - EXTERNAL.
+
+**invert **creates a new shape which is a copy of the original with the orientation all subshapes reversed. For example, it may be useful to reverse the normals of a solid.
+
+**normals **returns the assignment of colors to orientation values.
+
+**range **defines the length of a selected edge by defining the values of a starting point and an end point.
+**Example:**
+
+# invert normals of a box
+box b 10 20 30
+normals b 5
+invert b
+normals b 5
+
+# to assign a value to an edge
+box b1 10 20 30
+# to define the box as edges
+explode b1 e
+b_1 b_2 b_3 b_4 b_5 b_6 b_7 b_8 b_9 b_10 b_11 b_12
+# to define as an edge
+makedge e 1
+# to define the length of the edge as starting from 0
+and finishing at 1
+range e 0 1
+
+
+@subsubsection occt_2142243456_1869436669713 explode, exwire, nbshapes
+
+Syntax: explode name [C/So/Sh/F/W/E/V]
+exwire name
+nbshapes name
+
+**explode **extracts subshapes from an entity. The subshapes will be named *name_1*, *name_2*, ... Note that they are not copied but shared with the original.
+
+With name only, **explode **will extract the first sublevel of shapes: the shells of a solid or the edges of a wire, for example. With one argument, **explode **will extract all subshapes of that type: *C *for compounds, *So *for solids, *Sh *for shells, *F *for faces, *W *for wires, *E *for edges, *V *for vertices.
+
+**exwire **is a special case of **explode **for wires, which extracts the edges in an ordered way,if possible. Each edge, for example, is connected to the following one by a vertex.
+
+**nbshapes **counts the number of shapes of each type in an entity.
+**Example:**
+
+# on a box
+box b 10 20 30
+
+# whatis returns the type and various information
+whatis b
+= b is a shape SOLID FORWARD Free Modified
+
+# make one shell
+explode b
+whatis b_1
+= b_1 is a shape SHELL FORWARD Modified Orientable
+Closed
+
+# extract the edges b_1, ... , b_12
+explode b e
+==b_1 ... b_12
+
+# count subshapes
+nbshapes b
+==
+Number of shapes in b
+VERTEX : 8
+EDGE : 12
+WIRE : 6
+FACE : 6
+SHELL : 1
+SOLID : 1
+COMPSOLID : 0
+COMPOUND : 0
+SHAPE : 34
+
+
+@subsubsection occt_2142243456_1869436669714 emptycopy, add, compound
+
+Syntax: emptycopy [newname] name
+add name toname
+compound [name ...] compoundname
+
+**emptycopy **returns an empty shape with the same orientation, location, and geometry as the target shape, but with no sub-shapes. If the newname argument is not given, the new shape is stored with the same name. This command is used to modify a frozen shape. A frozen shape is a shape used by another one. To modify it, you must emptycopy it. Its subshape may be reinserted with the **add **command.
+
+**add **inserts shape C into shape S. Verify that C and S reference compatible types of objects:
+
+ * Any *Shape *can be added to a *Compound*.
+ * Only a *Solid *can be added to a *CompSolid*.
+ * Only a *Shell*, an *Edge *or a *Vertex *can be added into a *Solid*.
+ * Only a *Face *can be added to a *Shell*.
+ * Only a *Wire *and *Vertex *can be added in a *Solid*.
+ * Only an *Edge *can be added to a *Wire*.
+ * Only a *Vertex *can be added to an *Edge*.
+ * Nothing can be added to a *Vertex*.
+
+Care should be taken using **emptycopy **and **add**.
+
+On the other hand, **compound **is a safe way to achieve a similar result. It creates a compound from shapes. If no shapes are given, the compound is empty.
+**Example:**
+
+# a compound with three boxes
+box b1 0 0 0 1 1 1
+box b2 3 0 0 1 1 1
+box b3 6 0 0 1 1 1
+compound b1 b2 b3 c
+
+
+@subsubsection occt_2142243456_1869436669715 checkshape
+
+Syntax: checkshape [-top] shape [result] [-short]
+
+Where:
+*-top* – check only topological validity of a shape.
+*shape *– the only required parameter which represents the name of the shape to check.
+*result* – optional parameter which is the prefix of the output shape names.
+*-short* – short description of check.
+
+
+**checkshape **examines the selected object for topological and geometric coherence. The object should be a three dimensional shape.
+**Example:**
+
+# checkshape returns a comment valid or invalid
+box b1 0 0 0 1 1 1
+checkshape b1
+# returns the comment
+this shape seems to be valid
+
+<h4>NOTE</h4>
+*This test is performed using the tolerance set in the algorithm.*
+
+
+
+
+
+@subsection occt_2142243456_186943666972 Curve and surface topology
+
+This group of commands is used to create topology from shapes and to extract shapes from geometry.
+
+ * To create vertices, use the **vertex **command.
+ * To create edges use, the **edge**, **mkedge **commands.
+ * To create wires, use the **wire**, **polyline**, **polyvertex **commands.
+ * To create faces, use the **mkplane**, **mkface **commands.
+ * To extract the geometry from edges or faces, use the **mkcurve **and **mkface **commands.
+ * To extract the 2d curves from edges or faces, use the **pcurve **command.
+
+
+@subsubsection occt_2142243456_1869436669721 vertex
+
+Syntax: vertex name [x y z / p edge]
+
+Creates a vertex at either a 3d location x,y,z or the point at parameter p on an edge.
+**Example:**
+
+vertex v1 10 20 30
+
+
+@subsubsection occt_2142243456_1869436669722 edge, mkedge, uisoedge, visoedge
+
+Syntax: edge name vertex1 vertex2
+mkedge edge curve [surface] [pfirst plast] [vfirst [pfirst] vlast [plast]]
+uisoedge edge face u v1 v2
+visoedge edge face v u1 u2
+
+**edge **creates a straight line edge between two vertices.
+
+**mkedge **generates edges from curves<a href="#_ftn4">[4]</a>.Two parameters can be given for the vertices: the first and last parameters of the curve are given by default. Vertices can also be given with their parameters, this option allows you to block the creation of new vertices. If the parameters of the vertices are not given, they are computed by projection on the curve. Instead of a 3d curve, a 2d curve and a surface can be given.
+**Example:**
+
+# straight line edge
+vertex v1 10 0 0
+vertex v2 10 10 0
+edge e1 v1 v2
+
+# make a circular edge
+circle c 0 0 0 5
+mkedge e2 c 0 pi/2
+
+# A similar result may be achieved by trimming the curve
+# The trimming is removed by mkedge
+trim c c 0 pi/2
+mkedge e2 c
+
+**visoedge **and **uisoedge **are commands that generate a uiso parameter edge
+or a viso parameter edge.
+
+**Example:**
+
+# to create an edge between v1 and v2 at point u
+# to create the example plane
+plane p
+trim p p 0 1 0 1
+convert p p
+incudeg p 3
+incvdeg p 3
+movep p 2 2 0 0 1
+movep p 3 3 0 0 0.5
+mkface p p
+# to create the edge in the plane at the u axis point
+0.5, and between the v axis points v=0.2 and v =0.8
+uisoedge e p 0.5 0.20 0.8
+
+
+@subsubsection occt_2142243456_1869436669723 wire, polyline, polyvertex
+
+Syntax: wire wirename e1/w1 [e2/w2 ...]
+polyline name x1 y1 z1 x2 y2 z2 ...
+polyvertex name v1 v2 ...
+
+**wire **creates a wire from edges or wires. The order of the elements should ensure that the wire is connected, and vertex locations will be compared to detect connection. If the vertices are different, new edges will be created to ensure topological connectivity. The original edge may be copied in the new one.
+
+**polyline **creates a polygonal wire from point coordinates. To make a closed wire, you should give the first point again at the end of the argument list.
+
+**polyvertex **creates a polygonal wire from vertices.
+**Example:**
+
+# create two polygonal wires
+# glue them and define as a single wire
+polyline w1 0 0 0 10 0 0 10 10 0
+polyline w2 10 10 0 0 10 0 0 0 0
+wire w w1 w2
+
+
+@subsubsection occt_2142243456_1869436669724 profile
+
+Syntax profile name [code values] [code values] ...
+
+**Code** **Values ** **Action**
+O X Y Z Sets the origin of the plane
+P DX DY DZ UX UY UZ Sets the normal and X of the plane
+F X Y Sets the first point
+X DX Translates a point along X
+Y DY Translates a point along Y
+L DL Translates a point along direction
+XX X Sets point X coordinate
+YY Y Sets point Y coordinate
+T DX DY Translates a point
+TT X Y Sets a point
+R Angle Rotates direction
+RR Angle Sets direction
+D DX DY Sets direction
+IX X Intersects with vertical
+IY Y Intersects with horizontal
+C Radius Angle Arc of circle tangent to direction
+
+<h5>Suffix</h5>
+No suffix Makes a closed face
+W Make a closed wire
+WW Make an open wire
+
+
+**profile **builds a profile in a plane using a moving point and direction. By default, the profile is closed and a face is created. The original point is 0 0, and direction is 1 0 situated in the XY plane.
+
+Codes and values are used to define the next point or change the direction. When the profile changes from a straight line to a curve, a tangent is created. All angles are in degrees and can be negative.
+
+The point [code values] can be repeated any number of times and in any order to create the profile contour.
+
+The profile shape definition is the suffix; no suffix produces a face, **w **is a closed wire, **ww **is an open wire.
+
+Code letters are not case-sensitive.
+**Example:**
+
+# to create a trianglular plane using a vertex at the
+origin, in the xy plane
+profile p O 0 0 0 X 1 Y 0 x 1 y 1
+**Example:**
+
+# to create a contour using the different code
+possibilities
+
+# two vertices in the xy plane
+profile p F 1 0 x 2 y 1 ww
+
+# to view from a point normal to the plane
+top
+
+# add a circular element of 45 degrees
+profile p F 1 0 x 2 y 1 c 1 45 ww
+
+# add a tangential segment with a length value 1
+profile p F 1 0 x 2 y 1 c 1 45 l 1 ww
+
+# add a vertex with xy values of 1.5 and 1.5
+profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 ww
+
+# add a vertex with the x value 0.2, y value is constant
+profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 ww
+
+# add a vertex with the y value 2 x value is constant
+profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 yy 2 ww
+
+# add a circular element with a radius value of 1 and a circular value of 290 degrees
+profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 yy 2 c 1 290
+
+# wire continues at a tangent to the intersection x = 0
+profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 yy 2 c 1 290 ix 0 ww
+
+# continue the wire at an angle of 90 degrees until it intersects the y axis at y= -o.3
+profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 yy 2 c 1 290 ix 0 r 90 ix -0.3 ww
+
+#close the wire
+profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 yy 2 c 1 290 ix 0 r 90 ix -0.3 w
+
+# to create the plane with the same contour
+profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 yy 2 c 1 290 ix 0 r 90 ix -0.3
+
+
+@subsubsection occt_2142243456_1869436669725 bsplineprof
+
+Syntax: bsplineprof name [S face] [W WW]
+
+for an edge : digitizes ... mouse button 2
+to end profile : mouse button 3
+
+Build a profile in the XY plane from digitizes
+By default the profile is closed and a face is built.
+
+W Make a closed wire
+WW Make an open wires
+
+**bsplineprof **creates a 2d profile from bspline curves using the mouse as the input. MB1 creates the points, MB2 finishes the current curve and starts the next curve, MB3 closes the profile.
+
+The profile shape definition is the suffix; no suffix produces a face, **w **is a closed wire, **ww **is an open wire.
+**Example:**
+
+#to view the xy plane
+top
+#to create a 2d curve with the mouse
+bsplineprof res
+# click mb1 to start the curve
+# click mb1 to create the second vertex
+# click mb1 to create a curve
+==
+#click mb2 to finish the curve and start a new curve
+==
+# click mb1 to create the second curve
+# click mb3 to create the face
+
+
+@subsubsection occt_2142243456_1869436669726 mkoffset
+
+Syntax: mkoffset result face/compound of wires nboffset stepoffset
+
+**mkoffset **creates a parallel wire in the same plane using a face or an existing continuous set of wires as a reference. The number of occurences is not limited.
+
+The offset distance defines the spacing and the positionning of the occurences.
+**Example:**
+
+#Create a box and select a face
+box b 1 2 3
+explode b f
+#Create three exterior parallel contours with an offset
+value of 2
+mkoffset r b_1 3 2
+Create one interior parallel contour with an offset
+value of
+0.4
+mkoffset r b_1 1 -0.4
+
+NOTE
+*The mkoffset command must be used with prudence, angular contours produce offset contours with fillets. Interior parallel contours can produce more than one wire, normally these are refused. In the following example, any increase in the offset value is refused*
+**Example:**
+
+# to create the example contour
+profile p F 0 0 x 2 y 4 tt 1 1 tt 0 4 w
+# to create an incoherent interior offset
+mkoffset r p 1 -0.50
+==p is not a FACE but a WIRE
+BRepFill_TrimEdgeTool: incoherent intersection
+# to create two incoherent wires
+mkoffset r p 1 -0.50
+
+
+@subsubsection occt_2142243456_1869436669727 mkplane, mkface
+
+Syntax: mkplane name wire
+mkface name surface [ufirst ulast vfirst vlast]
+
+**mkplane **generates a face from a planar wire. The planar surface will be constructed with an orientation which keeps the face inside the wire.
+
+**mkface **generates a face from a surface. Parameter values can be given to trim a rectangular area. The default boundaries are those of the surface.
+**Example:**
+
+# make a polygonal face
+polyline f 0 0 0 20 0 0 20 10 0 10 10 0 10 20 0 0 20 0 0 0 0
+mkplane f f
+
+# make a cylindrical face
+cylinder g 10
+trim g g -pi/3 pi/2 0 15
+mkface g g
+
+
+@subsubsection occt_2142243456_1869436669728 mkcurve, mksurface
+
+Syntax: mkcurve curve edge
+mksurface name face
+
+**mkcurve **creates a 3d curve from an edge. The curve will be trimmed to the edge boundaries.
+
+**mksurface **creates a surface from a face. The surface will not be trimmed.
+**Example:**
+
+# make a line
+vertex v1 0 0 0
+vertex v2 10 0 0
+edge e v1 v2
+
+
+@subsubsection occt_2142243456_1869436669729 pcurve
+
+Syntax: pcurve [name edgename] facename
+
+**pcurve **extracts the 2d curve of an edge on a face. If only the face is specified, the command extracts all the curves and colors them according to their orientation. This is useful in checking to see if the edges in a face are correctly oriented, i.e. they turn counterclockwise. To make curves visible, use a fitted 2d view.
+**Example:**
+
+# view the pcurves of a face
+plane p
+trim p p -1 1 -1 1
+mkface p p
+av2d; # a 2d view
+pcurve p
+2dfit
+
+
+@subsubsection occt_2142243456_18694366697210 chfid
+
+Syntax: chfi2d result face [edge1 edge2 (F radius/CDD d1 d2/CDA d ang) ....
+
+chfi2d creates chamfers and fillets on 2D objects. Select t:wo adjacent edges and:
+
+ * a radius value
+ * two respective distance values
+ * a distance value and an angle
+
+The radius value produces a fillet between the two faces.
+
+The distance is the length value from the edge between the two selected faces in a normal direction.
+
+**Example:**
+
+# to create a 2d fillet
+top
+profile p x 2 y 2 x -2
+chfi2d cfr p . . F 0.3
+==Pick an object
+#select an edge
+==Pick an object
+#select an edge
+**Example:**
+
+# to create a 2d chamfer using two distances
+profile p x 2 y 2 x -2
+chfi2d cfr p . . CDD 0.3 0.6
+==Pick an object
+#select an edge
+==Pick an object
+#select an edge
+**Example:**
+
+# to create a 2d chamfer using a defined distance and
+angle
+top
+profile p x 2 y 2 x -2
+chfi2d cfr p . . CDA 0.3 75
+==Pick an object
+#select an edge
+==Pick an object
+#select an edge
+
+
+@subsubsection occt_2142243456_18694366697211 nproject
+
+Syntax: nproject pj e1 e2 e3 ... surf -g -d [dmax] [Tol
+[continuity [maxdeg [maxseg]]]
+
+**nproject **creates a shape projection which is normal to the target surface.
+**Example:**
+
+# create a curved surface
+line l 0 0 0 1 0 0
+trim l l 0 2
+convert l l
+
+incdeg l 3
+cmovep l 1 0 0.5 0
+cmovep l 3 0 0.5 0
+copy l ll
+translate ll 2 -0.5 0
+mkedge e1 l
+mkedge e2 ll
+wire w e1 e2
+prism p w 0 0 3
+donl p
+#display in four views
+mu4
+fit
+# create the example shape
+circle c 1.8 -0.5 1 0 1 0 1 0 0 0.4
+mkedge e c
+donly p e
+# create the normal projection of the shape(circle)
+nproject r e p
+
+
+
+@subsection occt_2142243456_186943666973 Primitives
+
+Primitive commands make it possible to create simple shapes. They include:
+
+ * **box **and **wedge **commands.
+ * **pcylinder**, **pcone**, **psphere**, **ptorus **commands.
+ * **halfspace **command
+
+
+@subsubsection occt_2142243456_1869436669731 box, wedge
+
+Syntax: box name [x y z] dx dy dz
+wedge name dx dy dz ltx / xmin zmin xmax xmax
+
+**box **creates a box parallel to the axes with dimensions dx,dy,dz. x,y,z is the corner of the box. It is the default origin.
+
+**wedge **creates a box with five faces called a wedge. One face is in the OXZ plane, and has dimensions dx,dz while the other face is in the plane y = dy. This face either has dimensions ltx, dz or is bounded by xmin,zmin,xmax,zmax.
+
+The other faces are defined between these faces. The face in the y=yd plane may be degenerated into a line if ltx = 0, or a point if xmin = xmax and ymin = ymax. In these cases, the line and the point both have 5 faces each. To position the wedge use the **ttranslate **and **trotate **commands.
+**Example:**
+
+# a box at the origin
+box b1 10 20 30
+
+# another box
+box b2 30 30 40 10 20 30
+
+# a wedge
+wedge w1 10 20 30 5
+
+# a wedge with a sharp edge (5 faces)
+wedge w2 10 20 30 0
+
+# a pyramid
+wedge w3 20 20 20 10 10 10 10
+
+
+@subsubsection occt_2142243456_1869436669732 pcylinder, pcone, psphere, ptorus
+
+Syntax: pcylinder name [plane] radius height [angle]
+pcone name [plane] radius1 radius2 height [angle]
+pcone name [plane] radius1 radius2 height [angle]
+psphere name [plane] radius1 [angle1 angle2] [angle]
+ptorus name [plane] radius1 radius2 [angle1 angle2] [angle]
+
+All these commands create solid blocks in the default coordinate system, using the Z axis as the axis of revolution and the X axis as the origin of the angles. To use another system, translate and rotate the resulting solid or use a plane as first argument to specify a coordinate system. All primitives have an optional last argument which is an angle expreesed in degrees and located on the Z axis, starting from the X axis. The default angle is 360.
+
+**pcylinder **creates a cylindrical block with the given radius and height.
+
+**pcone **creates a truncated cone of the given height with radius1 in the plane z = 0 and radius2 in the plane z = height. Neither radius can be negative, but one of them can be null.
+
+**psphere **creates a solid sphere centered on the origin. If two angles, *angle1 *and *angle2, *are given, the solid will be limited by two planes at latitude *angle1 *and *angle2*. The angles must be increasing and in the range -90,90.
+
+**ptorus **creates a solid torus with the given radii, centered on the origin, which is a point along the z axis. If two angles increasing in degree in the range 0 – 360 are given, the solid will be bounded by two planar surfaces at those positions on the circle.
+**Example:**
+
+# a can shape
+pcylinder cy 5 10
+
+# a quarter of a truncated cone
+pcone co 15 10 10 90
+
+# three-quarters of sphere
+psphere sp 10 270
+
+# half torus
+ptorus to 20 5 0 90
+@subsubsection occt_2142243456_1869436669733 halfspace
+
+Syntax: halfspace result face/shell x y z
+
+**halfspace **creates an infinite solid volume based on a face in a defined direction. This volume can be used to perform the boolean operation of cutting a solid by a face or plane.
+**Example:**
+
+box b 0 0 0 1 2 3
+explode b f
+==b_1 b_2 b_3 b_4 b_5 b_6
+halfspace hr b_3 0.5 0.5 0.5
+
+
+
+@subsection occt_2142243456_186943666974 Sweeping
+
+Sweeping creates shapes by sweeping out a shape along a defined path:
+
+ * **prism **sweeps along a direction.
+ * **revol **sweeps around an axis.
+ * **pipe **sweeps along a wire.
+ * **mksweep **and **buildsweep **are commands to create sweeps by defining the arguments and algorithms.
+ * **thrusections **creates a sweep from wire in different planes.
+
+
+@subsubsection occt_2142243456_1869436669741 prism
+
+Syntax: prism result base dx dy dz [Copy | Inf | SemiInf]
+
+**prism **creates a new shape by sweeping a shape in a direction. Any shape can be swept: a vertex gives an edge; an edge gives a face; and a face gives a solid.
+
+The shape is swept along the vector dx dy dz. The original shape will be shared in the result unless *Copy *is specified. If *Inf *is specified the prism is infinite in both directions. If *SemiInf *is specified the prism is infinite in the dx,dy,dz direction, and the length of the vector has no importance.
+**Example:**
+
+# sweep a planar face to make a solid
+polyline f 0 0 0 10 0 0 10 5 0 5 5 0 5 15 0 0 15 0 0 0 0
+mkplane f f
+
+
+@subsubsection occt_2142243456_1869436669742 revol
+
+Syntax: revol result base x y z dx dy dz angle [Copy]
+
+**revol **creates a new shape by sweeping a base shape through an angle along the axis x,y,z dx,dy,dz. As with the prism command, the shape can be of any type and is not shared if *Copy *is specified.
+**Example:**
+
+# shell by wire rotation
+polyline w 0 0 0 10 0 0 10 5 0 5 5 0 5 15 0 0 15 0
+revol s w 20 0 0 0 1 0 90
+
+
+
+@subsubsection occt_2142243456_1869436669743 pipe
+
+Syntax: pipe name wire_spine Profile
+
+**pipe **creates a new shape by sweeping a shape known as the profile along a wire known as the spine.
+**Example:**
+
+# sweep a circle along a bezier curve to make a solid
+pipe
+
+beziercurve spine 4 0 0 0 10 0 0 10 10 0 20 10 0
+mkedge spine spine
+wire spine spine
+circle profile 0 0 0 1 0 0 2
+mkedge profile profile
+wire profile profile
+mkplane profile profile
+pipe p spine profile
+
+
+@subsubsection occt_2142243456_1869436669744 mksweep, deletesweep, buildsweep, simulsweep
+
+Syntax: mksweep wire
+addsweep wire[vertex][-M][-C] [auxiilaryshapedeletesweep wire
+setsweep options [arg1 [arg2 [...]]]
+
+options are :
+
+-FR : Tangent and Normal are defined by a Frenet trihedron
+-CF : Tangent is given by Frenet,
+the Normal is computed to minimize the torsion
+-DX Surf : Tangent and Normal are given by Darboux trihedron,
+Surf must be a shell or a face
+-CN dx dy dz : BiNormal is given by dx dy dz
+-FX Tx Ty TZ [Nx Ny Nz] : Tangent and Normal are fixed
+-G guide 0|1(AC
+simulsweep r [n] [option]
+buildsweep [r] [option] [Tol]
+
+These commands are used to create a shape from wires. One wire is designated as the contour that defines the direction; it is called the spine. At least one other wire is used to define the the sweep profile.
+
+**mksweep **initializes the sweep creation and defines the wire to be used as the spine.
+
+**addsweep **defines the wire to be used as the profile.
+
+**deletesweep **cancels the choice of profile wire, without leaving the mksweep mode. You can re-select a profile wire.
+
+**setsweep **commands the algorithms used for the construction of the sweep.
+
+**simulsweep **can be used to create a preview of the shape. [n] is the number of sections that are used to simulate the sweep.
+
+**buildsweep **creates the sweep using the arguments defined by all the commands.
+**Example:**
+
+#create a sweep based on a semi-circular wire using the
+Frenet algorithm
+#create a circular figure
+circle c2 0 0 0 1 0 0 10
+trim c2 c2 -pi/2 pi/2
+mkedge e2 c2
+donly e2
+wire w e2
+whatis w
+mksweep w
+# to display all the options for a sweep
+setsweep
+#to create a sweep using the Frenet algorithm where the
+#normal is computed to minimise the torsion
+setsweep -CF
+addsweep w -R
+# to simulate the sweep with a visual approximation
+simulsweep w 3
+
+
+@subsubsection occt_2142243456_1869436669745 thrusections
+
+Syntax: thrusections [-N] result issolid isruled wire1 wire2 [..wire..]
+
+**thrusections **creates a shape using wires that are positioned in different planes. Each wire selected must have the same number of edges and vertices.
+A bezier curve is generated between the vertices of each wire. The option [-N] means no check is made on wires for direction.
+**Example:**
+
+#create three wires in three planes
+polyline w1 0 0 0 5 0 0 5 5 0 2 3 0
+polyline w2 0 1 3 4 1 3 4 4 3 1 3 3
+polyline w3 0 0 5 5 0 5 5 5 5 2 3 5
+# create the shape
+thrusections th issolid isruled w1 w2 w3
+==thrusections th issolid isruled w1 w2 w3
+Tolerances obtenues -- 3d : 0
+-- 2d : 0
+
+
+
+
+
+@subsection occt_2142243456_186943666975 Topological transformation
+
+Transformations are applications of matrices. When the transformation is nondeforming, such as translation or rotation, the object is not copied. The topology localcoordinate system feature is used. The copy can be enforced with the **tcopy **command.
+
+ * **tcopy **makes a copy of the structure of a shape.
+ * **ttranslate**, **trotate**, **tmove**, **reset **move a shape.
+ * **tmirror**, **tscale **always modify the shape.
+
+
+@subsubsection occt_2142243456_1869436669751 tcopy
+
+Syntax: tcopy name toname [name toname ...]
+
+Copies the structure of one shape, including the geometry, into another, newer shape.
+**Example:**
+
+# create an edge from a curve and copy it
+beziercurve c 3 0 0 0 10 0 0 20 10 0
+mkedge e1 c
+ttranslate e1 0 5 0
+tcopy e1 e2
+ttranslate e2 0 5 0
+# now modify the curve, only e1 and e2 will be modified
+
+@subsubsection occt_2142243456_1869436669752 tmove, treset
+
+Syntax: tmove name [name ...] shape
+reset name [name ...]
+
+**tmove **and **reset **modify the location, or the local coordinate system of a shape.
+
+**tmove **applies the location of a given shape to other shapes. **reset **restores one or several shapes it to its or their original coordinate system(s).
+**Example:**
+
+# create two boxes
+box b1 10 10 10
+box b2 20 0 0 10 10 10
+# translate the first box
+ttranslate b1 0 10 0
+# and apply the same location to b2
+tmove b2 b1
+# return to original positions
+reset b1 b2
+
+
+@subsubsection occt_2142243456_1869436669753 ttranslate, trotate
+
+Syntax: ttranslate [name ...] dx dy dz
+trotate [name ...] x y z dx dy dz angle
+
+**ttranslate **translates a set of shapes by a given vector, and **trotate **rotates them by a given angle around an axis. Both commands only modify the location of the shape.
+When creating multiple shapes, the same location is used for all the shapes. (See toto.tcl example below. Note that the code of this file can also be directly executed in interactive mode.)
+
+Locations are very economic in the data structure because multiple occurences of an object share the topological description.
+**Example:**
+# make rotated copies of a sphere in between two cylinders
+# create a file source toto.tcl
+# toto.tcl code:
+for {set i 0} {$i 360} {incr i 20} {
+copy s s$i
+trotate s$i 0 0 0 0 0 1 $i
+}
+
+# create two cylinders
+pcylinder c1 30 5
+copy c1 c2
+ttranslate c2 0 0 20
+
+#create a sphere
+psphere s 3
+ttranslate s 25 0 12.5
+
+# call the source file for multiple copies
+source toto.tcl
+
+
+@subsubsection occt_2142243456_1869436669754 tmirror, tscale
+
+Syntax: tmirror name x y z dx dy dz
+tscale name x y z scale
+
+**tmirror **makes a mirror copy of a shape about a plane x,y,z dx,dy,dz. **Tscale **applies a central homotopic mapping to a shape.
+**Example:**
+
+# mirror a portion of cylinder about the YZ plane
+pcylinder c1 10 10 270
+copy c1 c2
+tmirror c2 15 0 0 1 0 0
+# and scale it
+tscale c1 0 0 0 0.5
+
+
+
+@subsection occt_2142243456_186943666976 Old Topological operations
+
+
+
+ * **fuse**, **cut**, **common **are boolean operations.
+ * **section**, **psection **compute sections.
+ * **sewing **joins two or more shapes.
+
+
+@subsubsection occt_2142243456_1869436669761 fuse, cut, common
+
+Syntax: fuse name shape1 shape2
+cut name shape1 shape2
+common name shape1 shape2
+
+**fuse **creates a new shape by a boolean operation on two existing shapes. The new shape contains both originals intact.
+
+**cut **creates a new shape which contains all parts of the second shape but only the first shape without the intersection of the two shapes.
+
+**common **creates a new shape which contains only what is in common between the two original shapes in their intersection.
+**Example:**
+
+# all four boolean operations on a box and a cylinder
+
+box b 0 -10 5 20 20 10
+pcylinder c 5 20
+
+fuse s1 b c
+ttranslate s1 40 0 0
+
+cut s2 b c
+ttranslate s2 -40 0 0
+
+cut s3 c b
+ttranslate s3 0 40 0
+
+common s4 b c
+ttranslate s4 0 -40 0
+
+
+
+@subsubsection occt_2142243456_1869436669762 section, psection
+
+Syntax: section result shape1 shape2
+psection name shape plane
+
+**section **creates a compound object consisting of the edges for the intersection curves on the faces of two shapes.
+
+**psection **creates a planar section consisting of the edges for the intersection curves on the faces of a shape and a plane.
+**Example:**
+
+# section line between a cylinder and a box
+pcylinder c 10 20
+box b 0 0 5 15 15 15
+trotate b 0 0 0 1 1 1 20
+section s b c
+
+# planar section of a cone
+pcone c 10 30 30
+plane p 0 0 15 1 1 2
+psection s c p
+
+
+@subsubsection occt_2142243456_1869436669763 sewing
+
+Syntax: sewing result [tolerance] shape1 shape2 ...
+
+**Sewing **joins shapes by connecting their adjacent or near adjacent edges. Adjacency can be redefined by modifying the tolerance value.
+
+**Example:**
+
+# create two adjacent boxes
+box b 0 0 0 1 2 3
+box b2 0 2 0 1 2 3
+sewing sr b b2
+whatis sr
+sr is a shape COMPOUND FORWARD Free Modified
+
+
+@subsection occt_2142243456_186943666977 New Topological operations
+
+
+The new algorithm of Boolean operations avoids a large number of weak points and limitations presented in the old boolean operation algorithm.
+
+
+@subsubsection occt_2142243456_1869436669771 bop, bopfuse, bopcut, boptuc, bopcommon,
+
+**bop** defines **shape1** and **shape2** subject to ulterior Boolean operations
+
+**bopfuse **creates a new shape by a boolean operation on two existing shapes. The new shape contains both originals intact.
+
+**bopcut **creates a new shape which contains all parts of the second shape but only the first shape without the intersection of the two shapes.
+
+**boptuc **is a reverced** bopcut**.
+
+**bopcommon **creates a new shape which contains only whatever is in common between the two original shapes in their intersection.
+
+
+Syntax: bop shape1 shape2
+bopcommon result
+bopfuse result
+bopcut result
+boptuc result
+
+These commands have short variants:
+
+bcommon result shape1 shape2
+bfuse result shape1 shape2
+bcut result shape1 shape2
+
+
+**bop** fills data structure (DS) of boolean operation for **shape1** and **shape2**.
+**bopcommon, bopfuse, bopcut, boptuc **commands used after **bop** command. After one **bop** command it is possible to call several commands from the list above. For example: **bop** S1 S2; **bopfuse** R.
+
+**Example:**
+
+# all four boolean operations on a box and a cylinder
+
+box b 0 -10 5 20 20 10
+pcylinder c 5 20
+
+# fills data structure
+bop b c
+
+bopfuse s1
+ttranslate s1 40 0 0
+
+bopcut s2
+ttranslate s2 -40 0 0
+
+boptuc s3
+ttranslate s3 0 40 0
+
+bopcommon s4
+ttranslate s4 0 -40 0
+
+
+Short variants of commands:
+
+bfuse s11 b c
+ttranslate s11 40 0 100
+
+bcut s12 b c
+ttranslate s12 -40 0 100
+
+bcommon s14 b c
+ttranslate s14 0 -40 100
+
+@subsubsection occt_2142243456_1869436669772 bopsection
+
+**bopsection **creates a compound object consisting of the edges for the intersection curves on the faces of two shapes.
+
+
+Syntax: bop shape1 shape2
+bopsection result
+
+
+
+Short variant:
+
+bsection result shape1 shape2 [-2d/-2d1/-2s2] [-a]
+
+
+**bop** fills data structure (DS) of boolean operation for **shape1** and **shape2**.
+**bopsection** command used after **bop** command.
+
+**-2d** - PCurves are computed on both parts.
+**-2d1** - PCurves are computed on first part.
+**-2d2 **- PCurves are computed on second part.
+**-a** - geometries built are approximated.
+
+
+**Example:**
+
+# section line between a cylinder and a box
+pcylinder c 10 20
+box b 0 0 5 15 15 15
+trotate b 0 0 0 1 1 1 20
+bop b c
+bopsection s
+# Short variant:
+bsection s2 b c
+
+
+@subsubsection occt_2142243456_1869436669773 bopcheck, bopargshape
+
+Syntax: bopcheck shape
+bopargcheck shape1 [[shape2] [-F/O/C/T/S/U] [/R|F|T|V|E|I|P]] [#BF]
+
+
+**bopcheck** checks a shape for self-interference.
+
+**bopargcheck** checks the validity of argument(s) for boolean operations.
+
+-Boolean Operation
+ **F** (fuse)
+ **O** (common)
+ **C** (cut)
+ **T** (cut21)
+ **S** (section)
+ **U** (unknown)
+By default a section is made.
+
+ /Test Options
+ **R** (disable small edges (shrank range) test)
+ **F** (disable faces verification test)
+ **T** (disable tangent faces searching test)
+ **V** (disable test possibility to merge vertices)
+ **E** (disable test possibility to merge edges)
+ **I** (disable self-interference test)
+ **P** (disable shape type test)
+By default all options are enabled.
+
+ #Additional Test Options
+ **B** (stop test on first faulty found); default OFF
+ **F** (full output for faulty shapes);
+**By **default the output is made in a short format.
+
+ NOTE: Boolean Operation and Test Options are used only for a couple of argument shapes, except for **I** and **P** options that are always used to test a couple of shapes as well as a single shape.
+
+**Example:**
+
+# checks a shape on self-interference
+box b1 0 0 0 1 1 1
+bopcheck b1
+
+# checks the validity of argument for boolean cut operations
+box b2 0 0 0 10 10 10
+bopargcheck b1 b2 -C
+
+
+@subsection occt_2142243456_186943666978 Drafting and blending
+
+Drafting is creation of a new shape by tilting faces through an angle.
+
+Blending is the creation of a new shape by rounding edges to create a fillet.
+
+ * Use the **depouille **command for drafting.
+ * Use the **chamf **command to add a chamfer to an edge
+ * Use the **blend **command for simple blending.
+ * Use **fubl **for a fusion + blending operation.
+ * Use **buildevol**, **mkevol**, **updatevol **to realize varying radius blending.
+
+
+@subsubsection occt_2142243456_1869436669781 depouille
+
+Syntax: dep result shape dirx diry dirz face angle x y x dx dy dz [face angle...]
+
+**depouille **creates a new shape by drafting one or more faces of a shape.
+
+Identify the shape(s) to be drafted, the drafting direction, and the face(s) with an angle and an axis of rotation for each face. You can use dot syntax to identify the faces.
+**Example:**
+# draft a face of a box
+box b 10 10 10
+explode b f
+== b_1 b_2 b_3 b_4 b_5 b_6
+
+dep a b 0 0 1 b_2 10 0 10 0 1 0 5
+
+
+@subsubsection occt_2142243456_1869436669782 chamf
+
+Syntax: chamf newname shape edge face S dist
+chamf newname shape edge face dist1 dist2
+chamf newname shape edge face A dist angle
+
+**chamf **creates a chamfer along the edge between faces using:
+
+ * a equal distances from the edge
+ * the edge, a face and distance, a second distance
+ * the edge, a reference face and an angle
+
+Use the dot syntax to select the faces and edges.
+**Example:**
+
+# to create a chamfer based on equal distances from the
+edge (45 degree angle)
+# create a box
+box b 1 2 3
+chamf ch b . . S 0.5
+==Pick an object
+# select an edge
+==Pick an object
+# select an adjacent face
+**Example:**
+
+# to create a chamfer based on different distances from
+the selected edge
+box b 1 2 3
+chamf ch b . . 0.3 0.4
+==Pick an object
+# select an edge
+==Pick an object
+# select an adjacent face
+**Example:**
+
+# to create a chamfer based on a distance from the edge
+and an angle
+box b 1 2 3
+chamf ch b . . A 0.4 30
+==Pick an object
+# select an edge
+==Pick an object
+# select an adjacent face
+
+
+@subsubsection occt_2142243456_1869436669783 blend
+
+Syntax: blend result object rad1 ed1 rad2 ed2 ... [R/Q/P]
+
+**blend **creates a new shape by filleting the edges of an existing shape. The edge must be inside the shape. You may use the dot syntax. Note that the blend is propagated to the edges of tangential planar, cylindrical or conical faces.
+**Example:**
+
+# blend a box, click on an edge
+box b 20 20 20
+blend b b 2 .
+==tolerance ang : 0.01
+==tolerance 3d : 0.0001
+==tolerance 2d : 1e-05
+==fleche : 0.001
+==tolblend 0.01 0.0001 1e-05 0.001
+==Pick an object
+# click on the edge you want ot fillet
+
+==COMPUTE: temps total 0.1s dont :
+==- Init + ExtentAnalyse 0s
+==- PerformSetOfSurf 0.02s
+==- PerformFilletOnVertex 0.02s
+==- FilDS 0s
+==- Reconstruction 0.06s
+==- SetRegul 0s
+
+
+@subsubsection occt_2142243456_1869436669784 fubl
+
+Syntax: fubl name shape1 shape2 radius
+** **
+**fubl **creates a boolean fusion of two shapes and then blends (fillets) the intersection edges using the given radius.
+**Example:**
+
+# fuse-blend two boxes
+box b1 20 20 5
+copy b1 b2
+ttranslate b2 -10 10 3
+fubl a b1 b2 1
+See also: **fuse**, **blend**
+
+
+@subsubsection occt_2142243456_1869436669785 mkevol, updatevol, buildevol
+
+Syntax: mkevol result object (then use updatevol) [R/Q/P]
+updatevol edge u1 radius1 [u2 radius2 ...]
+buildevol
+
+These three commands work together to create fillets with evolving radii.
+
+**mkevol **allows you to specify the shape and the name of the result. It returns the tolerances of the fillet.
+
+**updatevol **allows you to describe the filleted edges you want to create. For each edge, you give a set of coordinates: parameter and radius and the command prompts you to pick the edge of the shape which you want to modify. The parameters will be calculated along the edges and the radius function applied to the whole edge.
+
+**buildevol **produces the result described previously in **mkevol **and **updatevol**.
+**Example:**
+
+# makes an evolved radius on a box
+box b 10 10 10
+mkevol b b
+==tolerance ang : 0.01
+==tolerance 3d : 0.0001
+==tolerance 2d : 1e-05
+==fleche : 0.001
+==tolblend 0.01 0.0001 1e-05 0.001
+
+# click an edge
+updatevol . 0 1 1 3 2 2
+==Pick an object
+
+buildevol
+==Dump of SweepApproximation
+==Error 3d = 1.28548881203818e-14
+==Error 2d = 1.3468326936926e-14 ,
+==1.20292299999388e-14
+==2 Segment(s) of degree 3
+
+==COMPUTE: temps total 0.91s dont :
+==- Init + ExtentAnalyse 0s
+==- PerformSetOfSurf 0.33s
+==- PerformFilletOnVertex 0.53s
+==- FilDS 0.01s
+==- Reconstruction 0.04s
+==- SetRegul 0s
+
+
+
+@subsection occt_2142243456_186943666979 Topological analysis
+
+Analysis of shapes includes commands to compute length, area, volumes and inertial properties.
+
+ * Use **lprops**, **sprops**, **vprops **to compute integral properties.
+ * Use **bounding **to display the bounding box of a shape.
+ * Use **distmini **to calculate the minimum distance between two shapes.
+
+
+
+
+@subsubsection occt_2142243456_1869436669791 lprops, sprops, vprops
+
+Syntax: lprops shape
+sprops shape
+vprops shape
+
+**lprops **computes the mass properties of all edges in the shape with a linear density of 1, **sprops **of all faces with a surface density of 1 and **vprops **of all solids with a density of 1.
+
+All three commands print the mass, the coordinates of the center of gravity, the matrix of inertia and the moments. Mass is either the length, the area or the volume. The center and the main axis of inertia are displayed.
+**Example:**
+
+# volume of a cylinder
+pcylinder c 10 20
+vprops c
+== results
+Mass : 6283.18529981086
+
+Center of gravity :
+X = 4.1004749224903e-06
+Y = -2.03392858349861e-16
+Z = 9.9999999941362
+
+Matrix of Inertia :
+366519.141445068 5.71451850691484e-12
+0.257640437382627
+5.71451850691484e-12 366519.141444962
+2.26823064169991e-10 0.257640437382627
+2.26823064169991e-10 314159.265358863
+
+Moments :
+IX = 366519.141446336
+IY = 366519.141444962
+I.Z = 314159.265357595
+
+
+
+@subsubsection occt_2142243456_1869436669792 bounding
+
+Syntax: bounding shape
+
+Displays the bounding box of a shape. The bounding box is a cuboid created with faces parallel to the x, y, and z planes. The command returns the dimension values of the the box, *xmin ymin zmin xmax ymax zmax.*
+**Example:**
+
+# bounding box of a torus
+ptorus t 20 5
+bounding t
+==-27.059805107309852 -27.059805107309852 -
+5.0000001000000003
+==27.059805107309852 27.059805107309852
+5.0000001000000003
+
+
+@subsubsection occt_2142243456_1869436669793 distmini
+
+Syntax: distmini name Shape1 Shape2
+
+**distmini **calculates the minimum distance between two shapes. The calculation returns the number of solutions, If more than one solution exists. The options are displayed in the viewer(red) and the results are listed in the shell window. The distmini lines are considered as shapes which have a value v.
+**Example:**
+
+box b 0 0 0 10 20 30
+box b2 30 30 0 10 20 30
+distmini d1 b b2
+==the distance value is : 22.3606797749979
+==the number of solutions is :2
+
+==solution number 1
+==the type of the solution on the first shape is 0
+==the type of the solution on the second shape is 0
+==the coordinates of the point on the first shape are:
+==X=10 Y=20 Z=30
+==the coordinates of the point on the second shape
+are:
+==X=30 Y=30 Z=30
+
+==solution number 2:
+==the type of the solution on the first shape is 0
+==the type of the solution on the second shape is 0
+==the coordinates of the point on the first shape are:
+==X=10 Y=20 Z=0
+==the coordinates of the point on the second shape
+are:
+==X=30 Y=30 Z=0
+
+==d1_val d1 d12
+
+
+
+
+@subsection occt_2142243456_1869436669710 Surface creation
+
+Surface creation commands include surfaces created from boundaries and from spaces between shapes.
+
+ * gplate creates a surface from a boundary definition.
+ * filling creates a surface from a group of surfaces.
+
+
+@subsubsection occt_2142243456_18694366697101 gplate,
+
+Syntax: gplate result nbrcurfront nbrpntconst [SurfInit] [edge 0] [edge tang (1:G1;2:G2) surf]...[point] [u v tang (1:G1;2:G2) surf] ...
+
+**gplate **creates a surface from a defined boundary. The boundary can be defined using edges, points, or other surfaces.
+**Example:**
+
+plane p
+trim p p -1 3 -1 3
+mkface p p
+
+beziercurve c1 3 0 0 0 1 0 1 2 0 0
+mkedge e1 c1
+tcopy e1 e2
+tcopy e1 e3
+
+ttranslate e2 0 2 0
+trotate e3 0 0 0 0 0 1 90
+tcopy e3 e4
+ttranslate e4 2 0 0
+# create the surface
+gplate r1 4 0 p e1 0 e2 0 e3 0 e4 0
+==
+======== Results ===========
+DistMax=8.50014503228635e-16
+* GEOMPLATE END*
+Calculation time: 0.33
+Loop number: 1
+Approximation results
+Approximation error : 2.06274907619957e-13
+Criterium error : 4.97600631215754e-14
+
+#to create a surface defined by edges and passing through a point
+# to define the border edges and the point
+plane p
+trim p p -1 3 -1 3
+mkface p p
+
+beziercurve c1 3 0 0 0 1 0 1 2 0 0
+mkedge e1 c1
+tcopy e1 e2
+tcopy e1 e3
+
+ttranslate e2 0 2 0
+trotate e3 0 0 0 0 0 1 90
+tcopy e3 e4
+ttranslate e4 2 0 0
+# to create a point
+point pp 1 1 0
+# to create the surface
+gplate r2 4 1 p e1 0 e2 0 e3 0 e4 0 pp
+==
+======== Results ===========
+DistMax=3.65622157610934e-06
+* GEOMPLATE END*
+Calculculation time: 0.27
+Loop number: 1
+Approximation results
+Approximation error : 0.000422195884750181
+Criterium error : 3.43709808053967e-05
+
+@subsubsection occt_2142243456_18694366697102 filling, fillingparam
+
+Syntax: filling result nbB nbC nbP [SurfInit] [edge][face]order...
+edge[face]order... point/u v face order...
+
+**filling **creates a surface between borders. It uses the **gplate **algorithm but creates a surface that is tangential to the adjacent surfaces. The result is a smooth continuous surface based on the G1 criterion.
+
+To define the surface border:
+
+ * enter the number of edges, constraints, and points
+ * enumerate the edges, constraints and points
+
+The surface can pass through other points. These are defined after the border definition.
+
+You can use the **fillingparam **command to access the filling parameters.
+
+The options are:
+
+-l : to list current values
+
+-i : to set default values
+
+-r deg nbPonC nbIt anis : to set filling options
+
+-c t2d t3d tang tcur : to set tolerances
+
+-a maxdeg maxseg : Approximation option
+**Example:**
+
+# to create four curved survaces and a point
+plane p
+trim p p -1 3 -1 3
+mkface p p
+
+beziercurve c1 3 0 0 0 1 0 1 2 0 0
+mkedge e1 c1
+tcopy e1 e2
+tcopy e1 e3
+
+ttranslate e2 0 2 0
+trotate e3 0 0 0 0 0 1 90
+tcopy e3 e4
+ttranslate e4 2 0 0
+
+point pp 1 1 0
+
+prism f1 e1 0 -1 0
+prism f2 e2 0 1 0
+prism f3 e3 -1 0 0
+prism f4 e4 1 0 0
+
+# to create a tangential surface
+filling r1 4 0 0 p e1 f1 1 e2 f2 1 e3 f3 1 e4 f4 1
+# to create a tangential surface passing through point pp
+filling r2 4 0 1 p e1 f1 1 e2 f2 1 e3 f3 1 e4 f4 1 pp#
+# to visualise the surface in detail
+isos r2 40
+# to display the current filling parameters
+fillingparam -l
+==
+Degree = 3
+NbPtsOnCur = 10
+NbIter = 3
+Anisotropie = 0
+Tol2d = 1e-05
+Tol3d = 0.0001
+TolAng = 0.01
+TolCurv = 0.1
+
+MaxDeg = 8
+MaxSegments = 9
+
+
+
+
+@subsection occt_2142243456_1869436669711 Complex Topology
+
+Complex topology is the group of commands that modify the topology of shapes. This includes feature modeling.
+
+
+@subsubsection occt_2142243456_18694366697111 offsetshape, offsetcompshape
+
+Syntax: offsetshape r shape offset [tol] [face ...]
+offsetcompshape r shape offset [face ...]
+
+**offsetshape **and **offsetcompshape **assigns a thickness to the edges of a shape. The **offset **value can be negative or positive. This value defines the thickness and direction of the resulting shape. Each face can be removed to create a hollow object.
+
+The resulting shape is based on a calculation of intersections. In case of simple shapes such as a box, only the adjacent intersections are required and you can use the **offsetshape **command.
+
+In case of complex shapes, where intersections can occur from non-adjacent edges and faces, use the **offsetcompshape **command. **comp **indicates complete and requires more time to calculate the result.
+
+
+The opening between the object interior and exterior is defined by the argument face or faces.
+**Example:**
+
+box b1 10 20 30
+explode b1 f
+== b1_1 b1_2 b1_3 b1_4 b1_5 b1_6
+offsetcompshape r b1 -1 b1_3
+
+Syntax: offsetparameter tolerance intersection(c/p) join(a/i)
+offsetload shape offset [face1 face2 …]
+offsetonface face1 offset1 face2 offset2 …
+offsetperform result
+
+**offsetparameter** sets the values of parameters and options for the following command **offsetload**:
+ * *tolerance* defines the coincidence tolerance criterion for generated shapes;
+ * *intersection* defines the mode of intersection: *c* means complete intersection, *p* means partial intersection;
+ * *join* defines the mode of connecting new adjacent faces: *a* means GeomAbs_Arc, *i* means GeomAbs_Intersection.
+
+**offsetload** loads shape, offset value and, if necessary, a set of faces to remove from the shape. These data are later used by command **offsetperform**.
+**offsetonface** indicates the faces of shape (loaded earlier by command **offsetload**) that should be shifted with special offset value. This command is optional. **Warning:** this command should be called only after **offsetload** and it takes effect only if parameter join = GeomAbs_Intersection.
+
+**offsetperform** performs the result of 3d-offset algorithm using the data loaded by previous commands.
+**Example:**
+
+box b1 10 20 30
+explode b1 f
+== b1_1 b1_2 b1_3 b1_4 b1_5 b1_6
+offsetparameter 1e-7 p i
+offsetload b1 2 b1_1 b1_2
+offsetonface b1_3 5
+offsetperform result
+
+
+
+@subsubsection occt_2142243456_18694366697112 featprism, featdprism, featrevol, featlf, featrf
+
+Syntax: featprism shape element skface Dirx Diry Dirz Fuse(0/1/2) Modify(0/1)
+featdprism shape face skface angle Fuse(0/1/2) Modify(0/1)
+featrevol shape element skface Ox Oy Oz Dx Dy Dz Fuse(0/1/2) Modify(0/1)
+featlf shape wire plane DirX DirY DirZ DirX DirY DirZ Fuse(0/1/2) Modify(0/1)
+featrf shape wire plane X Y Z DirX DirY DirZ Size Size Fuse(0/1/2) Modify(0/1)
+featperform prism/revol/pipe/dprism/lf result [[Ffrom] Funtil]
+featperformval prism/revol/dprism/lf result value
+
+**featprism **loads the arguments for a prism with contiguous sides normal to the face.
+
+**featdprism **loads the arguments for a prism which is created in a direction normal to the face and includes a draft angle.
+
+**featrevol **loads the arguments for a prism with a circular evolution.
+
+**featlf **loads the arguments for a linear rib or slot. This feature uses planar faces and a wire as a guideline.
+
+**featrf **loads the arguments for a rib or slot with a curved surface. This feature uses a circular face and a wire as a guideline.
+
+**featperform **loads the arguments to create the feature.
+
+**featperformval **uses the defined arguments to create a feature with a limiting value.
+
+All the features are created from a set of arguments which are defined when you initialize the feature context. Negative values can be used to create depressions.
+**Example:**
+
+# to create a feature prism with a draft angle and a
+normal direction
+# create a box with a wire contour on the upper face
+box b 1 1 1
+profil f O 0 0 1 F 0.25 0.25 x 0.5 y 0.5 x -0.5
+explode b f
+# loads the feature arguments defining the draft angle
+featdprism b f b_6 5 1 0
+# create the feature
+featperformval dprism r 1
+==BRepFeat_MakeDPrism::Perform(Height)
+BRepFeat_Form::GlobalPerform ()
+Gluer
+still Gluer
+Gluer result
+
+# to create a feature prism with circular direction
+# create a box with a wire contour on the upper face
+box b 1 1 1
+profil f O 0 0 1 F 0.25 0.25 x 0.5 y 0.5 x -0.5
+explode b f
+# loads the feature arguments defining a rotation axis
+featrevol b f b_6 1 0 1 0 1 0 1 0
+featperformval revol r 45
+==BRepFeat_MakeRevol::Perform(Angle)
+BRepFeat_Form::GlobalPerform ()
+Gluer
+still Gluer
+Gluer result
+
+# to create a slot using the linear feature
+#create the base model using the multi viewer
+mu4
+profile p x 5 y 1 x -3 y -0.5 x -1.5 y 0.5 x 0.5 y 4 x -1 y -5
+prism pr p 0 0 1
+# create the contour for the linear feature
+vertex v1 -0.2 4 0.3
+vertex v2 0.2 4 0.3
+vertex v3 0.2 0.2 0.3
+vertex v4 4 0.2 0.3
+vertex v5 4 -0.2 0.3
+edge e1 v1 v2
+edge e2 v2 v3
+edge e3 v3 v4
+edge e4 v4 v5
+wire w e1 e2 e3 e4
+# define a plane
+plane pl 0.2 0.2 0.3 0 0 1
+# loads the linear feature arguments
+featlf pr w pl 0 0 0.3 0 0 0 0 1
+featperform lf result
+
+# to create a rib using the revolution feature
+#create the base model using the multi viewer
+mu4
+pcylinder c1 3 5
+# create the contour for the revolution feature
+profile w c 1 190 WW
+trotate w 0 0 0 1 0 0 90
+ttranslate w -3 0 1
+trotate w -3 0 1.5 0 0 1 180
+plane pl -3 0 1.5 0 1 0
+# loads the revolution feature arguments
+featrf c1 w pl 0 0 0 0 0 1 0.3 0.3 1 1
+featperform rf result
+
+
+@subsubsection occt_2142243456_18694366697113 draft
+
+Syntax: draft result shape dirx diry dirz angle shape/surf/length [-IN/-OUT] [Ri/Ro] [-Internal]
+
+**draft **computes a draft angle surface from a wire. The surface is determined by the draft direction, the inclination of the draft surface, a draft angle, and a limiting distance.
+
+ * The draft angle is measured in radians.
+ * The draft direction is determined by the argument -INTERNAL
+ * The argument Ri/Ro deftermines wether the corner edges of the
+
+draft surface are angular or rounded.
+
+ * Arguments that can be used to define the surface distance are:
+ * length, a defined distance
+ * shape, until the surface contacts a shape
+ * surface, until the surface contacts a surface.
+
+<h4>NOTE</h4>
+*The original aim of adding a draft angle to a shape is to*
+*produce a shape which can be removed easily from a mould.*
+*The Examples below use larger angles than are used normally*
+*and the calculation results returned are not indicated.*
+
+**Example:**
+
+# to create a simple profile
+profile p F 0 0 x 2 y 4 tt 0 4 w
+# creates a draft with rounded angles
+draft res p 0 0 1 3 1 -Ro
+# to create a profile with an internal angle
+profile p F 0 0 x 2 y 4 tt 1 1.5 tt 0 4 w
+# creates a draft with rounded external angles
+draft res p 0 0 1 3 1 -Ro
+
+
+@subsubsection occt_2142243456_18694366697114 deform, nurbsconvert
+
+Syntax: deform newname name CoeffX CoeffY CoeffZ
+
+**deform **modifies the shape using the x, y, and z coefficients. You can reduce or magnify the shape in the x,y, and z directions.
+
+Syntax nurbsconvert result name [result name]
+
+**nurbsconvert **changes the NURBS curve definition of a shape to a Bspline curve definition. This conversion is required for assymetric deformation and prepares the arguments for other commands such as **deform. **The conversion can be necessary when transferring shape data to other applications.
+**Example:**
+
+pcylinder c 20 20
+deform a c 1 3 5
+# the conversion to bspline is followed by the
+deformation
+
+
+
+@subsection occt_2142243456_1869436669712 Texture Mapping to a Shape
+
+Texture mapping allows you to map textures on a shape. Textures are texture image files and several are predefined. You can control the number of occurrences of the texture on a face, the position of a texture and the scale factor of the texture.
+
+@subsubsection occt_2142243456_18694366697121 vtexture
+
+Syntax vtexture NameOfShape TextureFile
+vtexture NameOfShape
+vtexture NameOfShape ?
+vtexture NameOfShape IdOfTexture
+
+**TextureFile **identifies the file containing the texture you want. The same syntax without **TextureFile **disables texture mapping. The question-mark ***?* **lists available textures. **IdOfTexture **allows you to apply predefined textures.
+
+@subsubsection occt_2142243456_18694366697122 vtexscale
+
+Syntax: vtexscale NameOfShape ScaleU ScaleV
+vtexscale NameOfShape ScaleUV
+vtexscale NameOfShape
+
+**ScaleU **and **Scale V **allow you to scale the texture according to the U and V parameters individually, while **ScaleUV **applies the same scale to both parameters. The same syntax without **ScaleU**, **ScaleV **or **ScaleUV **disables texture scaling.
+
+@subsubsection occt_2142243456_18694366697123 vtexorigin
+
+Syntax vtexorigin NameOfShape UOrigin VOrigin
+vtexorigin NameOfShape UVOrigin
+vtexorigin NameOfShape
+
+**UOrigin **and **VOrigin **allow you to place the texture according to the U and V parameters individually while **UVOrigin **applies the same position value to both parameters. The same syntax without **UOrigin**, **VOrigin **or **UVOrigin **disables origin positioning.
+
+@subsubsection occt_2142243456_18694366697124 vtexrepeat
+
+Syntax vtexrepeat NameOfShape URepeat VRepeat
+vtexrepeat NameOfShape UVRepeat
+vtexrepeat NameOfShape
+
+**URepeat **and **VRepeat **allow you to repeat the texture along the U and V parameters individually while **UVRepeat **applies the same number of repetitions for both parameters. The same syntax without **URepeat**, **VRepeat **or **UVRepeat **disables texture repetition.
+
+@subsubsection occt_2142243456_18694366697125 vtexdefault
+
+Syntax vtexdefault NameOfShape
+
+**Vtexdefault **sets or resets the texture mapping default parameters.
+
+The defaults are:
+
+URepeat = VRepeat = 1 = no repetition
+UOrigin = VOrigin = 1 = origin set at (0,0)
+UScale = VScale = 1 = texture covers 100% of the face
+@section occt_2142243456_1866931135 Data Exchange commands
+
+
+@subsection occt_2142243456_186693113581 General
+
+This paragraph presents some general information about Data Exchange (DE) operations.
+
+DE commands are intended for translation files of various formats (IGES,STEP) into OCCT shapes with their attributes (colors, layers etc.)
+
+This files include a number of entities. Each entity has its own number in the file which we call label and denote as # for a STEP file and D for an IGES file. Each file has entities called roots (one or more). A full description of such entities is contained in the Users’s Guide for a corresponding format.
+
+Each Draw session has an interface model – some structure for keeping various information.
+First step of translation – loading information from a file into a model.
+Second step – creation of an OpenCASCADE shape from this model.
+Each entity from file has its own number in the model (num).
+During the translation a map of correspondences between labels(from file) and numbers (from model) is created.
+The model and the mentioned map are used for working with most of DE commands.
+
+@subsection occt_2142243456_186693113582 IGES commands
+
+These commands are used during the translation of IGES models.
+
+
+@subsubsection occt_2142243456_1866931135821 igesread
+
+Syntax: igesread file_name result_shape_name [selection]
+
+Read an IGES file to an OCCT shape.
+This command will interactively ask the user to select a set of entities to be converted:
+
+
+After the selected set of entities is loaded the user will be asked how loaded entities should be converted into OCCT shapes (e.g., one shape per root or one shape for all the entities). It is also possible to save loaded shapes in files, and to cancel loading.
+The second parameter of this command defines the name of the loaded shape. If several shapes are created, they will get indexed names. For instance, if the last parameter was ‘s’, they will be s_1, ... s_N.
+selection specifies the scope of selected entities in the model, it is xst-transferrable-roots by default. More about selection see in the *IGES FORMAT User’s Guide*.
+If we use symbol * as selection all roots will be translated.
+**Example:**
+
+# translation all roots from file
+igesread /disk01/files/model.igs a *
+
+@subsubsection occt_2142243456_1866931135822 tplosttrim
+
+Syntax: tplosttrim [IGES_type]
+
+Sometimes the trimming contours of IGES faces (i.e., entity 141 for 143, 142 for 144) can be lost during translation due to fails. This command gives us a number of lost trims and the number of corresponding IGES entities.
+It outputs the rank and numbers of faces that lost their trims and their numbers for each type (143, 144, 510) and their total number. If a face lost several of its trims it is output only once.
+Optional parameter IGES_type can be TrimmedSurface, BoundedSurface or Face to specify the only type of IGES faces.
+**Example:**
+
+tplosttrim TrimmedSurface
+
+@subsubsection occt_2142243456_1866931135823 brepiges
+
+Syntax: brepiges shape_name filename.igs
+
+Writes an OCCT shape to an IGES file.
+**Example:**
+
+# write shape with name aa to IGES file
+brepiges aa /disk1/tmp/aaa.igs
+== unit (write) : MM
+== mode write : Faces
+== To modifiy : command param
+== 1 Shapes written, giving 345 Entities
+== Now, to write a file, command : writeall filename
+== Output on file : /disk1/tmp/aaa.igs
+== Write OK
+
+
+
+@subsection occt_2142243456_186693113583 STEP commands
+
+These commands are used during the translation of STEP models.
+
+
+@subsubsection occt_2142243456_1866931135831 stepread
+
+Syntax: stepread file_name result_shape_name [selection]
+
+Read a STEP file to an OCCT shape.
+This command will interactively ask the user to select a set of entities to be converted:
+
+
+After the selected set of entities is loaded the user will be asked how loaded entities should be converted into OCCT shapes.
+The second parameter of this command defines the name of the loaded shape. If several shapes are created, they will get indexed names. For instance, if the last parameter was ‘s’, they will be s_1, ... s_N.
+selection specifies the scope of selected entities in the model. More about selection see in the *STEP FORMAT User’s Guide*.
+If as selection we use symbol * all roots will be translated.
+**Example:**
+
+# translation all roots from file
+stepread /disk01/files/model.stp a *
+
+@subsubsection occt_2142243456_1866931135832 stepwrite
+
+Syntax: stepwrite mode shape_name file_name
+
+Writes an OCCT shape to a STEP file.
+The available modes are the following:
+ 0 or ‘a’ - ;as is; mode – mode is selected automatically depending on type & geometry of the shape
+ 1 or ‘m’ - manifold_solid_brep or brep_with_voids
+ 2 or ‘f’ - faceted_brep
+ 3 or ‘w’ - geometric_curve_set
+ 4 or ‘s’ - shell_based_surface_model
+For further information see ;STEP FORMAT User’s Guide ;.
+**Example:**
+
+# write shape with name a to STEP file with mode 0
+stepwrite 0 a /disk1/tmp/aaa.igs
+
+
+
+@subsection occt_2142243456_186693113584 General commands
+
+These commands are auxilary commands. Most of them are used for the analysis of result of translation of IGES and STEP files.
+
+@subsubsection occt_2142243456_1866931135841 count
+
+Syntax: count counter [selection]
+
+Is used to calculate statistics on the entities in the model.
+Gives us a count of entities.
+The optional selection argument, if specified, defines a subset of entities, which are to be taken into account. The first argument should be one of the currently defined counters (for example):
+
+**Example:**
+
+count xst-types
+
+@subsubsection occt_2142243456_1866931135842 data
+
+Syntax: data symbol
+
+Is used to obtain general statistics on the loaded data.
+Information printed by this command depends on the symbol specified:
+**Example:**
+
+# print full information about warnings and fails
+data c
+
+@subsubsection occt_2142243456_1866931135843 elabel
+
+Syntax: elabel num
+
+Entities in the IGES and STEP files are numbered in the succeeding order. An entity can be identified either by its number or by its label. Label is the letter ‘#'(for STEP, for IGES use ‘D’) followed by the rank. This command gives us a label for an entity with a known number.
+**Example:**
+
+elabel 84
+
+@subsubsection occt_2142243456_1866931135844 entity
+
+Syntax: entity #(D)_or_num level_of_information
+
+The content of an IGES or STEP entity can be obtained by using this command.
+Entity can be determined by its number or label.
+level_of_information has range [0-6]. You can get more information about this level using this command without parameters.
+**Example:**
+
+# full information for STEP entity with label 84
+entity #84 6
+
+@subsubsection occt_2142243456_1866931135845 enum
+
+Syntax: enum #(D)
+
+Prints a number for the entity with a given label.
+**Example:**
+
+# give a number for IGES entity with label 21
+enum D21
+
+@subsubsection occt_2142243456_1866931135846 estatus
+
+Syntax: estatus #(D)_or_num
+
+The list of entities referenced by a given entity and the list of entities referencing to it can be obtained by this command.
+**Example:**
+
+estatus #315
+
+@subsubsection occt_2142243456_1866931135847 fromshape
+
+Syntax: fromshape shape_name
+
+Gives us the number of an IGES or STEP entity corresponding to an OCCT shape. If no corresponding entity can be found and if OCCT shape is a compound the command explodes it to subshapes and try to find corresponding entities for them.
+**Example:**
+
+fromshape a_1_23
+
+@subsubsection occt_2142243456_1866931135848 givecount
+
+Syntax: givecount selection_name [selection_name]
+
+**Example:**
+
+givecount xst-model-roots
+
+@subsubsection occt_2142243456_1866931135849 givelist
+
+Syntax: givelist selection_name
+
+Prints a list of a subset of loaded entities defined by the selection argument:
+
+**Example:**
+
+# give a list of all entities of the model
+givelist xst-model-all
+
+@subsubsection occt_2142243456_18669311358410 listcount
+
+Syntax: listcount counter [selection ...]
+
+Prints a list of entities per each type matching the criteria defined by arguments.
+Optional selection argument, if specified, defines a subset of entities, which are to be taken into account. Argument counter should be one of the currently defined counters:
+
+**Example:**
+
+listcount xst-types
+
+@subsubsection occt_2142243456_18669311358411 listitems
+
+Syntax: listitems
+
+This command prints a list of objects (counters, selections etc.) defined in the current session.
+**Example:**
+
+listitems
+
+@subsubsection occt_2142243456_18669311358412 listtypes
+
+Syntax: listtypes [selection_name ...]
+
+Gives a list of entity types which were encountered in the last loaded file (with a number of entities of each type). The list can be shown not for all entities but for a subset of them. This subset is defined by an optional selection argument.
+**Example:**
+
+# full list of all entities with thier counts
+listtypes
+
+@subsubsection occt_2142243456_18669311358413 newmodel
+
+Syntax: newmodel
+
+Clears the current model.
+**Example:**
+
+newmodel
+
+@subsubsection occt_2142243456_18669311358414 param
+
+Syntax: param [parameter] [value]
+
+This command is used to manage translation parameters.
+Command without arguments gives us a full list of parameters with current values.
+Command with parameter (without value) gives us the current value of this parameter and all possible values for it. Command with value sets this new value to parameter.
+For more information about translation parameters see the corresponding User’s Guide.
+**Example:**
+
+# info about possible schemes for writing STEP file
+param write.step.schema
+
+@subsubsection occt_2142243456_18669311358415 sumcount
+
+Syntax: sumcount counter [selection ...]
+
+Prints only a number of entities per each type matching the criteria defined by arguments.
+**Example:**
+
+sumcount xst-types
+
+@subsubsection occt_2142243456_18669311358416 tpclear
+
+Syntax: tpclear
+
+Clears the map of correspondences between IGES or STEP entities and OCCT shapes.
+**Example:**
+
+tpclear
+
+@subsubsection occt_2142243456_18669311358417 tpdraw
+
+Syntax: tpdraw #(D)_or_num
+
+**Example:**
+
+tpdraw 57
+
+@subsubsection occt_2142243456_18669311358418 tpent
+
+Syntax: tpent #(D)_or_num
+
+**Example:**
+
+tpent #23
+
+@subsubsection occt_2142243456_18669311358419 tpstat
+
+Syntax: tpstat [*|?]symbol [selection]
+
+Gives all statistics on the last transfer, including the list of transferred entities with mapping from IGES or STEP to OCCT types, as well as fail and warning messages. The parameter *symbol *defines what information will be printed:
+
+
+The sign ‘*’ before the parameters **n**, **s**, **b**, **t**, **r** makes it work on all entities (not only on roots). The sign ‘?’ before **n**, **s**, **b**, **t** limits the scope of information to invalid entities.
+Optional argument selection can limit the action of the command with a selected subset of entities.
+**Example:**
+
+# translation ratio on IGES faces
+tpstat *l iges-faces
+
+@subsubsection occt_2142243456_18669311358420 xload
+
+Syntax: xload file_name
+
+This command loads an IGES or STEP file into memory (i.e. to fill the model with data from the file) without creation of an OCCT shape.
+**Example:**
+
+xload /disk1/tmp/aaa.stp
+
+
+
+@subsection occt_2142243456_186693113585 Overview of XDE commands
+
+These commands are used for translation of IGES and STEP files into an XCAF document (special document is inherited from CAF document and is intended for Extended Data Exchange (XDE) ) and working with it. XDE translation allows reading and writing of shapes with additional attributes – colors, layers etc. All commands can be divided into the following groups:
+ * **XDE translation commands**
+ * **XDE general commands**
+ * **XDE shape’s commands**
+ * **XDE color’s commands**
+ * **XDE layer’s commands**
+ * **XDE property’s commands**
+
+
+
+@subsection occt_2142243456_186693113586 XDE translation commands
+
+Reminding: All operations of translation are performed with parameters managed by command param (see above)
+
+@subsubsection occt_2142243456_1866931135861 ReadIges
+
+Syntax: ReadIges document file_name
+
+Reads information from an IGES file to an XCAF document.
+**Example:**
+
+ReadIges D /disk1/tmp/aaa.igs
+== Document saved with name D
+
+@subsubsection occt_2142243456_1866931135862 ReadStep
+
+Syntax: ReadStep document file_name
+
+Reads information from a STEP file to an XCAF document.
+**Example:**
+
+ReadStep D /disk1/tmp/aaa.stp
+== Document saved with name D
+
+@subsubsection occt_2142243456_1866931135863 WriteIges
+
+Syntax: WriteIges document file_name
+
+**Example:**
+
+WriteIges D /disk1/tmp/aaa.igs
+
+@subsubsection occt_2142243456_1866931135864 WriteStep
+
+Syntax: WriteStep document file_name
+
+Writes information from an XCAF document to a STEP file.
+**Example:**
+
+WriteStep D /disk1/tmp/aaa.stp
+
+@subsubsection occt_2142243456_1866931135865 XFileCur
+
+Syntax: XFileCur
+
+Returns the name of file which is set as the current one in the Draw session.
+**Example:**
+
+XFileCur
+== *as1-ct-203.stp*
+
+@subsubsection occt_2142243456_1866931135866 XFileList
+
+Syntax: XFileList
+
+Returns a list all files that were transferred by the last transfer. This command is meant (assigned) for the assemble step file.
+**Example:**
+
+XFileList
+== *as1-ct-Bolt.stp*
+== *as1-ct-L-Bracktet.stp*
+== *as1-ct-LBA.stp*
+== *as1-ct-NBA.stp*
+== …
+
+@subsubsection occt_2142243456_1866931135867 XFileSet
+
+Syntax: XFileSet filename
+
+Sets the current file taking it from the components list of the assemble file.
+**Example:**
+
+XFileSet as1-ct-NBA.stp
+
+@subsubsection occt_2142243456_1866931135868 XFromShape
+
+Syntax: XFromShape shape
+
+This command is similar to command *fromshape* (see above) but gives additional information about the name of file. It is useful in the case when a shape was translated from several files.
+**Example:**
+
+XFromShape a
+== Shape a: imported from entity 217:#26 in file as1-ct-Nut.stp
+
+
+@subsection occt_2142243456_186693113587 XDE general commands
+
+@subsubsection occt_2142243456_1866931135871 XNewDoc
+
+Syntax: XNewDoc document
+
+Creates a new XCAF document.
+**Example:**
+
+XNewDoc D
+
+@subsubsection occt_2142243456_1866931135872 XShow
+
+Syntax: XShow document [ label1 … ]
+
+Shows a shape from a given label in the 3D viewer. If the label is not given – shows all shapes from the document.
+**Example:**
+
+# show shape from label 0:1:1:4 from document D
+XShow D 0:1:1:4
+
+@subsubsection occt_2142243456_1866931135873 XStat
+
+Syntax: XStat document
+
+Prints common information from an XCAF document.
+**Example:**
+
+XStat D
+==Statistis of shapes in the document:
+==level N 0 : 9
+==level N 1 : 18
+==level N 2 : 5
+==Total number of labels for shapes in the document = 32
+==Number of labels with name = 27
+==Number of labels with color link = 3
+==Number of labels with layer link = 0
+==Statistis of Props in the document:
+==Number of Centroid Props = 5
+==Number of Volume Props = 5
+==Number of Area Props = 5
+==Number of colors = 4
+==BLUE1 RED YELLOW BLUE2
+==Number of layers = 0
+
+@subsubsection occt_2142243456_1866931135874 XWdump
+
+Syntax: XWdump document filename
+
+Saves the contents of the viewer window as an image (XWD, png or BMP file).
+filename must have a corresponding extention.
+**Example:**
+
+XWdump D /disk1/tmp/image.png
+
+@subsubsection occt_2142243456_1866931135875 Xdump
+
+Syntax: Xdump document [int deep {0|1}]
+
+Prints information about the tree structure of the document. If parameter 1 is given, then the tree is printed with a link to shapes.
+**Example:**
+
+Xdump D 1
+== ASSEMBLY 0:1:1:1 L-BRACKET(0xe8180448)
+== ASSEMBLY 0:1:1:2 NUT(0xe82151e8)
+== ASSEMBLY 0:1:1:3 BOLT(0xe829b000)
+== ASSEMBLY 0:1:1:4 PLATE(0xe8387780)
+== ASSEMBLY 0:1:1:5 ROD(0xe8475418)
+== ASSEMBLY 0:1:1:6 AS1(0xe8476968)
+== ASSEMBLY 0:1:1:7 L-BRACKET-ASSEMBLY(0xe8476230)
+== ASSEMBLY 0:1:1:1 L-BRACKET(0xe8180448)
+== ASSEMBLY 0:1:1:8 NUT-BOLT-ASSEMBLY(0xe8475ec0)
+== ASSEMBLY 0:1:1:2 NUT(0xe82151e8)
+== ASSEMBLY 0:1:1:3 BOLT(0xe829b000)
+etc.
+
+
+@subsection occt_2142243456_186693113588 XDE shape’s commands
+
+@subsubsection occt_2142243456_1866931135881 XAddComponent
+
+Syntax: XAddComponent document label shape
+
+Adds a component shape to assembly.
+**Example:**
+
+# Add shape b as component shape to assembly shape from
+# label 0:1:1:1
+XAddComponent D 0:1:1:1 b
+
+@subsubsection occt_2142243456_1866931135882 XAddShape
+
+Syntax: XAddShape document shape [makeassembly=1]
+
+Adds a shape (or an assembly) to a document. If this shape already exists in the document, then prints the label which points to it. By default, a new shape is added as an assembly (i.e. last parameter 1), otherwise it is necessary to pass 0 as the last parameter.
+**Example:**
+
+# add shape b to document D
+XAddShape D b 0
+== 0:1:1:10
+# if pointed shape is compound and last parameter in
+# XAddShape command is used by default (1), then for
+# each subshapes new label is created
+
+@subsubsection occt_2142243456_1866931135883 XFindComponent
+
+Syntax: XFindComponent document shape
+
+Prints a sequence of labels of the assembly path.
+**Example:**
+
+XFindComponent D b
+
+@subsubsection occt_2142243456_1866931135884 XFindShape
+
+Syntax: XFindShape document shape
+
+Finds and prints a label with an indicated top-level shape.
+**Example:**
+
+XFindShape D a
+
+@subsubsection occt_2142243456_1866931135885 XGetFreeShapes
+
+Syntax: XGetFreeShapes document [shape_prefix]
+
+Print labels or create DRAW shapes for all free shapes in the document.
+If [shape_prefix] is absent – prints labels, else – creates DRAW shapes with names
+[shape_prefix]_num (i.e. for example: there are 3 free shapes and [shape_prefix] = a therefore shapes will be created with names a_1, a_2 and a_3).
+Note: a free shape is a shape to which no other shape refers to.
+**Example:**
+
+XGetFreeShapes D
+== 0:1:1:6 0:1:1:10 0:1:1:12 0:1:1:13
+
+XGetFreeShapes D sh
+== sh_1 sh_2 sh_3 sh_4
+
+@subsubsection occt_2142243456_1866931135886 XGetOneShape
+
+Syntax: XGetOneShape shape document
+
+Creates one DRAW shape for all free shapes from a document.
+**Example:**
+
+XGetOneShape a D
+
+@subsubsection occt_2142243456_1866931135887 XGetReferredShape
+
+Syntax: XGetReferredShape document label
+
+Prints a label that contains a top-level shape that corresponds to a shape at a given label.
+**Example:**
+
+XGetReferredShape D 0:1:1:1:1
+
+@subsubsection occt_2142243456_1866931135888 XGetShape
+
+Syntax: XGetShape result document label
+
+Puts a shape from the indicated label in document to result.
+**Example:**
+
+XGetShape b D 0:1:1:3
+
+@subsubsection occt_2142243456_1866931135889 XGetTopLevelShapes
+
+Syntax: XGetTopLevelShapes document
+
+Prints labels that contain top-level shapes.
+**Example:**
+
+XGetTopLevelShapes D
+== 0:1:1:1 0:1:1:2 0:1:1:3 0:1:1:4 0:1:1:5 0:1:1:6 0:1:1:7
+0:1:1:8 0:1:1:9
+
+@subsubsection occt_2142243456_18669311358810 XLabelInfo
+
+Syntax: XLabelInfo document label
+
+Prints information about a shape, stored at an indicated label.
+**Example:**
+
+XLabelInfo D 0:1:1:6
+== There are TopLevel Shape. There are an Assembly. This Shape don’t used.
+
+@subsubsection occt_2142243456_18669311358811 XNewShape
+
+Syntax: XNewShape document
+
+Creates a new empty top-level shape.
+**Example:**
+
+XNewShape D
+
+@subsubsection occt_2142243456_18669311358812 XRemoveComponent
+
+Syntax: XRemoveComponent document label
+
+Removes a component from the components label.
+**Example:**
+
+XRemoveComponent D 0:1:1:1:1
+
+@subsubsection occt_2142243456_18669311358813 XRemoveShape
+
+Syntax: XRemoveShape document label
+
+Removes a shape from a document (by it’s label).
+**Example:**
+
+XRemoveShape D 0:1:1:2
+
+@subsubsection occt_2142243456_18669311358814 XSetShape
+
+Syntax: XSetShape document label shape
+
+Sets a shape at the indicated label.
+**Example:**
+
+XSetShape D 0:1:1:3 b
+
+
+@subsection occt_2142243456_186693113589 XDE color’s commands
+
+@subsubsection occt_2142243456_1866931135891 XAddColor
+
+Syntax: XAddColor document R G B
+
+Adds color in document to the color table. Parameters R,G,B are real.
+**Example:**
+
+XAddColor D 0.5 0.25 0.25
+
+@subsubsection occt_2142243456_1866931135892 XFindColor
+
+Syntax: XFindColor document R G B
+
+Finds a label where the indicated color is situated.
+**Example:**
+
+XFindColor D 0.25 0.25 0.5
+== 0:1:2:2
+
+@subsubsection occt_2142243456_1866931135893 XGetAllColors
+
+Syntax: XGetAllColors document
+
+Prints all colors that are defined in the document.
+**Example:**
+
+XGetAllColors D
+== RED DARKORANGE BLUE1 GREEN YELLOW3
+
+@subsubsection occt_2142243456_1866931135894 XGetColor
+
+Syntax: XGetColor document label
+
+Returns a color defined at the indicated label from the color table.
+**Example:**
+
+XGetColor D 0:1:2:3
+== BLUE1
+
+@subsubsection occt_2142243456_1866931135895 XGetObjVisibility
+
+Syntax: XGetObjVisibility document {label|shape}
+
+Returns the visibility of a shape.
+**Example:**
+
+XGetObjVisibility D 0:1:1:4
+
+@subsubsection occt_2142243456_1866931135896 XGetShapeColor
+
+Syntax: XGetShapeColor document label colortype(s|c)
+
+Returns the color defined by label. If colortype=’s’ – returns surface color, else – returns curve color.
+**Example:**
+
+XGetShapeColor D 0:1:1:4 c
+
+@subsubsection occt_2142243456_1866931135897 XRemoveColor
+
+Syntax: XRemoveColor document label
+
+Removes a color from the color table in a document.
+**Example:**
+
+XRemoveColor D 0:1:2:1
+
+@subsubsection occt_2142243456_1866931135898 XSetColor
+
+Syntax: XSetColor document {label|shape} R G B
+
+Sets an RGB color to a shape given by label.
+**Example:**
+
+XsetColor D 0:1:1:4 0.5 0.5 0.
+
+@subsubsection occt_2142243456_1866931135899 XSetObjVisibility
+
+Syntax: XSetObjVisibility document {label|shape} {0|1}
+
+Sets the visibility of a shape.
+**Example:**
+
+# set shape from label 0:1:1:4 as invisible
+XSetObjVisibility D 0:1:1:4 0
+
+@subsubsection occt_2142243456_18669311358910 XUnsetColor
+
+Syntax: XUnsetColor document {label|shape} colortype
+
+Unset a color given??? type (‘s’ or ‘c’) for the indicated shape.
+**Example:**
+
+XUnsetColor D 0:1:1:4 s
+
+
+@subsection occt_2142243456_1866931135810 XDE layer’s commands
+
+@subsubsection occt_2142243456_18669311358101 XAddLayer
+
+Syntax: XAddLayer document layer
+
+Adds a new layer in an XCAF document. layer - name of new layer (string).
+**Example:**
+
+XAddLayer D layer2
+
+@subsubsection occt_2142243456_18669311358102 XFindLayer
+
+Syntax: XFindLayer document layer
+
+Prints a label where a layer is situated.
+**Example:**
+
+XFindLayer D Bolt
+== 0:1:3:2
+
+@subsubsection occt_2142243456_18669311358103 XGetAllLayers
+
+Syntax: XGetAllLayers document
+
+Prints all layers in an XCAF document.
+**Example:**
+
+XGetAllLayers D
+== *0:1:1:3* *Bolt* *0:1:1:9*
+
+@subsubsection occt_2142243456_18669311358104 XGetLayers
+
+Syntax: XGetLayers document {shape|label}
+
+Returns names of layers, which are pointed to by links of an indicated shape.
+**Example:**
+
+XGetLayers D 0:1:1:3
+== *bolt* *123*
+
+@subsubsection occt_2142243456_18669311358105 XGetOneLayer
+
+Syntax: XGetOneLayer document label
+
+Prints the name of a layer at a given label.
+**Example:**
+
+XGetOneLayer D 0:1:3:2
+
+@subsubsection occt_2142243456_18669311358106 XIsVisible
+
+Syntax: XIsVisible document {label|layer}
+
+Returns 1 if the indicated layer is visible, else returns 0.
+**Example:**
+
+XIsVisible D 0:1:3:1
+
+@subsubsection occt_2142243456_18669311358107 XRemoveAllLayers
+
+Syntax: XRemoveAllLayers document
+
+Removes all layers from an XCAF document.
+**Example:**
+
+XRemoveAllLayers D
+
+@subsubsection occt_2142243456_18669311358108 XRemoveLayer
+
+Syntax: XRemoveLayer document {label|layer}
+
+Removes the indicated layer from an XCAF document.
+**Example:**
+
+XRemoveLayer D layer2
+
+@subsubsection occt_2142243456_18669311358109 XSetLayer
+
+Syntax: XSetLayer document {shape|label} layer
+ [shape_in_one_layer {0|1}]
+
+Sets a reference between a shape and a layer (adds a layer if it is necessary).
+Parameter shape_in_one_layer shows whether a shape could be in a number of layers or only in one (0 by default).
+**Example:**
+
+XSetLayer D 0:1:1:2 layer2
+
+@subsubsection occt_2142243456_186693113581010 XSetVisibility
+
+Syntax: XSetVisibility document {label|layer} isvisible {0|1}
+
+Sets the visibility of a layer.
+**Example:**
+
+# set layer at label 0:1:3:2 as invisible
+XSetVisibility D 0:1:3:2 0
+
+@subsubsection occt_2142243456_186693113581011 XUnSetAllLayers
+
+Syntax: XUnSetAllLayers document {label|shape}
+
+Unsets a shape from all layers.
+**Example:**
+
+XUnSetAllLayers D 0:1:1:2
+
+@subsubsection occt_2142243456_186693113581012 XUnSetLayer
+
+Syntax: XUnSetLayer document {label|shape} layer
+
+Unsets a shape from the indicated layer.
+**Example:**
+
+XUnSetLayer D 0:1:1:2 layer1
+
+
+@subsection occt_2142243456_1866931135811 XDE property’s commands
+
+@subsubsection occt_2142243456_18669311358111 XCheckProps
+
+Syntax: XCheckProps document [ {0|deflection} [shape|label] ]
+
+Gets properties for a given shape (volume, area and centroid) and compares them with the results after internal calculations. If the second parameter is 0, the standard OCCT tool is used for the computation of properties. If the second parameter is not 0, it is treated as a deflection. If the deflection is positive the computation is done by triangulations, if it is negative – meshing is forced.
+**Example:**
+
+# check properties for shapes at label 0:1:1:1 from
+# document using standard Open CASCADE Technology tools
+XCheckProps D 0 0:1:1:1
+== Label 0:1:1:1 ;L-BRACKET*
+== Area defect: -0.0 ( 0%)
+== Volume defect: 0.0 ( 0%)
+== CG defect: dX=-0.000, dY=0.000, dZ=0.000
+
+@subsubsection occt_2142243456_18669311358112 XGetArea
+
+Syntax: XGetArea document {shape|label}
+
+Returns the area of a given shape.
+**Example:**
+
+XGetArea D 0:1:1:1
+== 24628.31815094999
+
+@subsubsection occt_2142243456_18669311358113 XGetCentroid
+
+Syntax: XGetCentroid document {shape|label}
+
+Returns the center of gravity coordinates of a given shape.
+**Example:**
+
+XGetCentroid D 0:1:1:1
+
+@subsubsection occt_2142243456_18669311358114 XGetVolume
+
+Syntax: XGetVolume document {shape|label}
+
+Returns the volume of a given shape.
+**Example:**
+
+XGetVolume D 0:1:1:1
+
+@subsubsection occt_2142243456_18669311358115 XSetArea
+
+Syntax: XSetArea document {shape|label} area
+
+Sets new area to attribute list ??? given shape.
+**Example:**
+
+XSetArea D 0:1:1:1 2233.99
+
+@subsubsection occt_2142243456_18669311358116 XSetCentroid
+
+Syntax: XSetCentroid document {shape|label} x y z
+
+Sets new center of gravity to the attribute list ??? given shape.
+**Example:**
+
+XSetCentroid D 0:1:1:1 0. 0. 100.
+
+@subsubsection occt_2142243456_18669311358117 XSetMaterial
+
+Syntax: XSetMaterial document {shape|label} name
+ density(g/cu sm)
+
+Adds a new label with material into the material table in a document, and adds a link to this material to the attribute list of agiven shape or a given label. The last parameter sets the density of a pointed material.
+**Example:**
+
+XSetMaterial D 0:1:1:1 Titanium 8899.77
+
+@subsubsection occt_2142243456_18669311358118 XSetVolume
+
+Syntax: XSetVolume document {shape|label} volume
+
+Sets new volume to the attribute list ??? given shape.
+**Example:**
+
+XSetVolume D 0:1:1:1 444555.33
+
+@subsubsection occt_2142243456_18669311358119 XShapeMassProps
+
+Syntax: XShapeMassProps document [ deflection [{shape|label}] ]
+
+Computes and returns real mass and real center of gravity for a given shape or for all shapes in a document. The second parameter is used for calculation of the volume and CG(center of gravity). If it is 0, then the standard CASCADE tool (geometry) is used for computation, otherwise - by triangulations with a given deflection.
+**Example:**
+
+XShapeMassProps D
+== Shape from label : 0:1:1:1
+== Mass = 193.71681469282299
+== CenterOfGravity X = 14.594564763807696,Y =
+ 20.20271885211281,Z = 49.999999385313245
+== Shape from label : 0:1:1:2 not have a mass
+etc.
+
+@subsubsection occt_2142243456_186693113581110 XShapeVolume
+
+Syntax: XShapeVolume shape deflection
+
+Calculates the real volume of a pointed shape with a given deflection.
+**Example:**
+
+XShapeVolume a 0
+
+@section occt_2142243456_1672096717 Shape Healing commands
+
+
+
+@subsection occt_2142243456_16720967171 General commands
+
+@subsubsection occt_2142243456_1672096717111 bsplres
+
+Syntax: bsplres result shape tol3d tol2d reqdegree reqnbsegments continuity3d continuity2d PriorDeg RationalConvert
+
+Performs approximations of a given shape (BSpline curves and surfaces or other surfaces) to BSpline with given required parameters. The specified continuity can be reduced if the approximation with a specified continuity was not done successfully. Results are put into the shape, which is given as a parameter result. For a more detailed description see the ShapeHealing User’s Guide (operator: BSplineRestriction).
+
+@subsubsection occt_2142243456_1672096717112 checkfclass2d
+
+Syntax: checkfclass2d face ucoord vcoord
+
+Shows where a point which is given by coordinates is located in relation to a given face – outbound, inside or at the bounds.
+**Example:**
+
+checkfclass2d f 10.5 1.1
+== Point is OUT
+
+@subsubsection occt_2142243456_1672096717113 checkoverlapedges
+
+Syntax: checkoverlapedges edge1 edge2 [toler domaindist]
+
+Checks the overlapping of two given edges. If the distance between two edges is less than the given value of tolerance then edges are overlapped. Parameter domaindist sets length of part of edges on which edges are overlapped.
+**Example:**
+
+checkoverlapedges e1 e2
+
+@subsubsection occt_2142243456_1672096717114 comtol
+
+Syntax: comptol shape [nbpoints] [prefix]
+
+Compares the real value of tolerance on curves with the value calculated by standard (using 23 points). The maximal value of deviation of 3d curve from pcurve at given simple points is taken as a real value (371 is by default). Command returns the maximal, minimal and average value of tolerance for all edges and difference between real values and set values. Edges with the maximal value of tolerance and relation will be saved if the ‘prefix’ parameter is given.
+**Example:**
+
+comptol h 871 t
+
+== Edges tolerance computed by 871 points:
+== MAX=8.0001130696523449e-008 AVG=6.349346868091096e-009
+ MIN=0
+== Relation real tolerance / tolerance set in edge
+== MAX=0.80001130696523448 AVG=0.06349345591805905 MIN=0
+== Edge with max tolerance saved to t_edge_tol
+== Concerned faces saved to shapes t_1, t_2
+
+
+@subsubsection occt_2142243456_1672096717115 convtorevol
+
+Syntax: convtorevol result shape
+
+Converts all elementary surfaces of a given shape into surfaces of revolution.
+Results are put into the shape, which is given as theresult parameter.
+**Example:**
+
+convtorevol r a
+
+@subsubsection occt_2142243456_1672096717116 directfaces
+
+Syntax: directfaces result shape
+
+Converts indirect surfaces and returns the results into the shape, which is given as the result parameter.
+**Example:**
+
+directfaces r a
+
+@subsubsection occt_2142243456_1672096717117 expshape
+
+Syntax: expshape shape maxdegree maxseg
+
+Gives statistics for a given shape. This test command is working with Bezier and BSpline entities.
+**Example:**
+
+expshape a 10 10
+== Number of Rational Bspline curves 128
+== Number of Rational Bspline pcurves 48
+
+@subsubsection occt_2142243456_1672096717118 fixsmall
+
+Syntax: fixsmall result shape [toler=1.]
+
+Fixes small edges in given shape by merging adjacent edges with agiven tolerance. Results are put into the shape, which is given as the result parameter.
+**Example:**
+
+fixsmall r a 0.1
+
+@subsubsection occt_2142243456_1672096717119 fixsmalledges
+
+Syntax: fixsmalledges result shape [toler mode maxangle]
+
+Searches at least one small edge at a given shape. If such edges have been found, then small edges are merged with a given tolerance. If parameter mode is equal to Standard_True (can be given any values, except 2), then small edges, which can not be merged, are removed, otherwise they are to be kept (Standard_False is used by default). Parameter maxangle sets a maximum possible angle for merging two adjacent edges, by default no limit angle is applied (-1).Results are put into the shape, which is given as parameter result.
+**Example:**
+
+fixsmalledges r a 0.1 1
+
+@subsubsection occt_2142243456_16720967171110 fixshape
+
+Syntax: fixshape result shape [preci [maxpreci]] [{switches}]
+
+Performs fixes of all sub-shapes (such as Solids, Shells, Faces, Wires and Edges) of a given shape. Parameter preci sets a basic precision value, maxpreci sets the maximal allowed tolerance. Results are put into the shape, which is given as parameter result.
+{switches} allows to tune parameters of ShapeFix
+The following syntax is used: symbolparameter
+- symbol may be - to set parameter off, + to set on or * to set default
+- parameters are identified by letters:
+l - FixLackingMode
+o - FixOrientationMode
+h - FixShiftedMode
+m - FixMissingSeamMode
+d - FixDegeneratedMode
+s - FixSmallMode
+i - FixSelfIntersectionMode
+n - FixNotchedEdgesMode
+For enhanced message output, use switch '+?'
+**Example:**
+
+fixshape r a 0.001
+
+@subsubsection occt_2142243456_16720967171111 fixwgaps
+
+Syntax: fixwgaps result shape [toler=0]
+
+Fixes gaps between ends of curves of adjacent edges (both 3d and pcurves) in wires in a given shape with a given tolerance. Results are put into the shape, which is given as parameter result.
+**Example:**
+
+fixwgaps r a
+
+@subsubsection occt_2142243456_16720967171112 offsetcurve, offset2dcurve
+
+Syntax: offsetcurve result curve offset direction(as point)
+ offset2dcurve result curve offset
+
+Both commands are intended to create a new offset curve by copying the given curve to distance, given by parameter offset. Parameter direction defines direction of the offset curve. It is created as a point. For correct work of these commands the direction of normal of the offset curve must be perpendicular to the plane, the basis curve is located there. Results are put into the curve, which is given as parameter result. **offsetcurve **works with the curve in 3d space, **offset2dcurve **in 2d space accordingly.
+**Example:**
+
+point pp 10 10 10
+offsetcurve r c 20 pp
+
+@subsubsection occt_2142243456_16720967171113 projcurve
+
+Syntax: projcurve edge|curve3d|curve3d first last X Y Z
+
+**projcurve **returns the projection of a given point on a given curve. The curve may be defined by three ways: by giving the edge name, giving the 3D curve and by giving the unlimited curve and limiting it by pointing its start and finish values.
+**Example:**
+
+projcurve k_1 0 1 5
+==Edge k_1 Params from 0 to 1.3
+==Precision (BRepBuilderAPI) : 9.9999999999999995e-008 ==Projection : 0 1 5
+==Result : 0 1.1000000000000001 0
+==Param = -0.20000000000000001 Gap = 5.0009999000199947
+
+
+@subsubsection occt_2142243456_16720967171114 projface
+
+Syntax: projface face X Y [Z]
+
+Returns the projection of a given point to a given face in 2d or 3d space. If two coordinates (2d space) are given then returns coordinates projection of this point in 3d space and vice versa.
+**Example:**
+
+projface a_1 10.0 0.0
+== Point UV U = 10 V = 0
+== = proj X = -116 Y = -45 Z = 0
+
+@subsubsection occt_2142243456_16720967171115 scaleshape
+
+Syntax: scaleshape result shape scale
+
+**Example:**
+
+scaleshape r a_1 0.8
+
+@subsubsection occt_2142243456_16720967171116 settolerance
+
+Syntax: settolerance shape [mode=v-e-w-f-a] val(fix value) or
+ tolmin tolmax
+
+Sets new values of tolerance for a given shape. If the given second parameter (mode) is given, then the atolerance value is set only for these sub shapes.
+**Example:**
+
+settolerance a 0.001
+
+@subsubsection occt_2142243456_16720967171117 splitface
+
+Syntax: splitface result face [u usplit1 usplit2...] [v vsplit1 vsplit2 ...]
+
+Splits a given face in parametric space and puts the result into the given parameter result.
+Returns the status of split face.
+**Example:**
+
+# split face f by parameter u = 5
+splitface r f u 5
+== Splitting by U: ,5
+== Status: DONE1
+
+@subsubsection occt_2142243456_16720967171118 statshape
+
+Syntax: statshape shape [particul]
+
+Returns the number of sub-shapes, which compose the given shape. For example, the number of solids, number of faces etc. It also returns the number of geometrical objects or sub-shapes with a specified type, example, number of free faces, number of C0 surfaces. The last parameter becomes out of date.
+**Example:**
+
+statshape a
+== Count Item
+== ----- ----
+== 402 Edge (oriented)
+== 402 Edge (Shared)
+== 74 Face
+== 74 Face (Free)
+== 804 Vertex (Oriented)
+== 402 Vertex (Shared)
+== 78 Wire
+== 4 Face with more than one wire
+== 34 bspsur: BSplineSurface
+
+@subsubsection occt_2142243456_16720967171119 tolerance
+
+Syntax: tolerance shape [mode:D v e f c] [tolmin tolmax:real]
+
+Returns tolerance (maximal, avg and minimal values) of all given shapes and tolerance of their Faces, Edges and Vertices. If parameter tolmin or tolmax or both of them are given, then sub-shapes are returned as a result of analys of this shape, which satisfy the given tolerances. If a particular value of entity (all shapes (D) (v) vertices (e) edges (f) faces (c) combined (faces)) is given as the second parameter then only this group will be analyzed for tolerance.
+**Example:**
+
+tolerance a
+== Tolerance MAX=0.31512672416608001 AVG=0.14901359484722074 MIN=9.9999999999999995e-08
+== FACE : MAX=9.9999999999999995e-08 AVG=9.9999999999999995e-08 MIN=9.9999999999999995e-08
+== EDGE : MAX=0.31512672416608001 AVG=0.098691334511810405 MIN=9.9999999999999995e-08
+== VERTEX : MAX=0.31512672416608001 AVG=0.189076074499648 MIN=9.9999999999999995e-08
+
+tolerance a v 0.1 0.001
+== Analysing Vertices gives 6 Shapes between tol1=0.10000000000000001 and tol2=0.001 , named tol_1 to tol_6
+
+
+
+@subsection occt_2142243456_16720967172 Convertion commands
+More detailed information about using here classes can be found into Shape Healing documentation. All this commands are created for testing.
+
+@subsubsection occt_2142243456_1672096717121 DT_ClosedSplit
+
+Syntax: DT_ClosedSplit result shape
+
+Divides all closed faces in the shape (for example cone) and returns result of given shape into shape, which is given as parameter result. Number of faces in resulting shapes will be increased.
+Note: Closed face – it’s face with one or more seam.
+**Example:**
+
+DT_ClosetSplit r a
+
+@subsubsection occt_2142243456_1672096717122 DT_ShapeConvert, DT_ShapeConvertRev
+
+Syntax: DT_ShapeConvert result shape convert2d convert3d
+ DT_ShapeConvertRev result shape convert2d convert3d
+
+Both commands are intended for the conversion of 3D, 2D curves to Bezier curves and surfaces to Bezier based surfaces. Parameters convert2d and convert3d take on a value 0 or 1. If the given value is 1, then the conversion will be performed, otherwise it will not be performed. The results are put into the shape, which is given as parameter Result. Command **DT_ShapeConvertRev **differs from **DT_ShapeConvert **by converting all elementary surfaces into surfaces of revolution first.
+**Example:**
+
+DT_ShapeConvert r a 1 1
+== Status: DONE1
+
+@subsubsection occt_2142243456_1672096717123 DT_ShapeDivide
+
+Syntax: DT_ShapeDivide result shape tol
+
+Divides the shape with C1 criterion and returns the result of geometry conversion of a given shape into the shape, which is given as parameter result. This command illustrates how class ShapeUpgrade_ShapeDivideContinuity works. This class allows to convert geometry with a continuity less than the specified continuity to geometry with target continuity. If conversion is not possible then the geometrical object is split into several ones, which satisfy the given tolerance. It also returns the status shape splitting:
+OK : no splitting was done
+Done1 : Some edges were split
+Done2 : Surface was split
+Fail1 : Some errors occurred
+**Example:**
+
+DT_ShapeDivide r a 0.001
+== Status: OK
+
+@subsubsection occt_2142243456_1672096717124 DT_SplitAngle
+
+Syntax: DT_SplitAngle result shape [MaxAngle=95]
+
+Works with all revolved surfaces, like cylinders, surfaces of revolution etc. This command divides given revolved surfaces into segments so that each resulting segment covers not more than the given MaxAngle degrees and puts the result of splitting into the shape, which is given as parameter result. Values of returned status are given above.
+This command illustrates how class ShapeUpgrade_ShapeDivideAngle works.
+**Example:**
+
+DT_SplitAngle r a
+== Status: DONE2
+
+@subsubsection occt_2142243456_1672096717125 DT_SplitCurve
+
+Syntax: DT_SplitCurve curve tol split(0|1)
+
+Divides the 3d curve with C1 criterion and returns the result of splitting of the given curve into a new curve. If the curve had been divided by segments, then each segment is put to an individual result. This command can correct a given curve at a knot with the given tolerance, if it is impossible, then the given surface is split at that knot. If the last parameter is 1, then 5 knots are added at the given curve, and its surface is split by segments, but this will be performed not for all parametric spaces.
+**Example:**
+
+DT_SplitCurve r c
+
+@subsubsection occt_2142243456_1672096717126 DT_SplitCurve2d
+
+Syntax: DT_SplitCurve2d Curve Tol Split(0/1)
+
+Works just as DT_SplitCurve (see above), only with 2d curve.
+**Example:**
+
+DT_SplitCurve2d r c
+
+@subsubsection occt_2142243456_1672096717127 DT_SplitSurface
+
+Syntax: DT_SplitSurface result Surface|GridSurf tol split(0|1)
+
+Divides surface with C1 criterion and returns the result of splitting of a given surface into surface, which is given as parameter result. If the surface has been divided into segments, then each segment is put to an individual result. This command can correct a given C0 surface at a knot with a given tolerance, if it is impossible, then the given surface is split at that knot. If the last parameter is 1, then 5 knots are added to the given surface, and its surface is split by segments, but this will be performed not for all parametric spaces.
+**Example:**
+
+# split surface with name ‘su’
+DT_SplitSurface res su 0.1 1
+== single surf
+== appel a SplitSurface::Init
+== appel a SplitSurface::Build
+== appel a SplitSurface::GlobalU/VKnots
+== nb GlobalU;nb GlobalV=7 2 0 1 2 3 4 5 6.2831853072 0 1
+== appel a Surfaces
+== transfert resultat
+== res1_1_1 res1_2_1 res1_3_1 res1_4_1 res1_5_1 res1_6_1
+
+
+@subsubsection occt_2142243456_1672096717128 DT_ToBspl
+
+Syntax: DT_ToBspl result shape
+
+Converts a surface of linear extrusion, revolution and offset surfaces into BSpline surfaces. Returns the result into the shape, which is given as parameter result.
+**Example:**
+
+DT_ToBspl res sh
+== error = 5.20375663162094e-08 spans = 10
+== Surface is aproximated with continuity 2
+
+@section occt_2142243456_1640587828 Performance evaluation commands
+
+
+@subsubsection occt_2142243456_16405878281.1 VDrawSphere
+
+Syntax: vdrawsphere shapeName Fineness [X=0.0 Y=0.0 Z=0.0] [Radius=100.0] [ToEnableVBO=1] [NumberOfViewerUpdate=1] [ToShowEdges=0]
+
+Calculates and displays in a given number of steps a sphere with given coordinates, radius and fineness. Returns the information about the properties of the sphere, the time and the amount of memory required to build it.
+
+This command can be used for visualization performance evaluation instead of the outdated Visualization Performance Meter.
+**Example:**
+
+vdrawsphere s 200 1 1 1 500 1 == Compute Triangulation... == NumberOfPoints: 39602 == NumberOfTriangles: 79200 == Amount of memory required for PolyTriangulation without Normals: 2 Mb == Amount of memory for colors: 0 Mb == Amount of memory for PolyConnect: 1 Mb == Amount of graphic card memory required: 2 Mb == Number of scene redrawings: 1 == CPU user time: 15.6000999999998950 msec == CPU system time: 0.0000000000000000 msec == CPU average time of scene redrawing: 15.6000999999998950 msec
+
+
+
+@section occt_2142243456_713659999 Extending Test Harness with custom commands
+
+
+The following chapters explain how to extend Test Harness with custom commands and how to activate them using a plug-in mechanism.
+
+
+@subsection occt_2142243456_7136599991 Custom command implementation
+
+Custom command implementation has not undergone any changes since the introduction of the plug-in mechanism. The syntax of every command should still be like in the following example.
+**Example:**
+
+static Standard_Integer myadvcurve(Draw_Interpretor& di,
+Standard_Integer n,
+char** a)
+{
+...
+}
+
+For examples of existing commands refer to Open CASCADE Technology (e.g. GeomliteTest.cxx).
+
+
+@subsection occt_2142243456_7136599992 Registration of commands in Test Harness
+
+To become available in the Test Harness the custom command must be registered in it. This should be done as follows.
+**Example:**
+
+void MyPack::CurveCommands(Draw_Interpretor& theCommands)
+{
+...
+char* g = ;Advanced curves creation;;
+
+
+ theCommands.Add ( ;myadvcurve;, ;myadvcurve name p1 p2 p3 –
+ Creates my advanced curve from points;,
+__FILE__, myadvcurve, g);
+...
+}
+
+@subsection occt_2142243456_7136599993 Creating a toolkit (library) as a plug-in
+
+All custom commands are compiled and linked into a dynamic library (.dll on Windows, or .so on Unix/Linux). To make Test Harness recognize it as a plug-in it must respect certain conventions. Namely, it must export function PLUGINFACTORY() accepting the Test Harness interpreter object (Draw_Interpretor). This function will be called when the library is dynamically loaded during the Test Harness session.
+This exported function PLUGINFACTORY() must be implemented only once per library.
+For convenience the DPLUGIN macro (defined in the Draw_PluginMacro.hxx file) has been provided. It implements the PLUGINFACTORY() function as a call to the Package::Factory() method and accepts Package as an argument. Respectively, this Package::Factory() method must be implemented in the library and activate all implemented commands.
+**Example:**
+
+#include Draw_PluginMacro.hxx
+
+void MyPack::Factory(Draw_Interpretor& theDI)
+{
+...
+//
+MyPack::CurveCommands(theDI);
+...
+}
+
+// Declare entry point PLUGINFACTORY
+DPLUGIN(MyPack)
+
+
+@subsection occt_2142243456_7136599994 Creation of the plug-in resource file
+
+As mentioned above, the plug-in resource file must be compliant with Open CASCADE Technology requirements (see Resource_Manager.cdl file for details). In particular, it should contain keys separated from their values by a colon (;:;).
+For every created plug-in there must be a key. For better readability and comprehension it is recommended to have some meaningful name.
+Thus, the resource file must contain a line mapping this name (key) to the library name. The latter should be without file extension (.dll on Windows, .so on Unix/Linux) and without the ;lib; prefix on Unix/Linux.
+For several plug-ins one resource file can be created. In such case, keys denoting plug-ins can be combined into groups, these groups - into their groups and so on (thereby creating some hierarchy). Any new parent key must have its value as a sequence of child keys separated by spaces, tabs or commas. Keys should form a tree without cyclic dependencies.
+**Examples** (file MyDrawPlugin):
+
+! Hierarchy of plug-ins
+ALL : ADVMODELING, MESHING
+DEFAULT : MESHING
+ADVMODELING : ADVSURF, ADVCURV
+
+! Mapping from naming to toolkits (libraries)
+ADVSURF : TKMyAdvSurf
+ADVCURV : TKMyAdvCurv
+MESHING : TKMyMesh
+
+
+For other examples of the plug-in resource file refer to the *;Plug-in resource file;* chapter above or to the $CASROOT/src/DrawPlugin file shipped with Open CASCADE Technology.
+
+
+@subsection occt_2142243456_7136599995 Dynamic loading and activation
+
+Loading a plug-in and activating its commands is described in the *;Activation of the commands implemented in the plug-in;* chapter.
+
+The procedure consists in defining the system variables and using the pload commands in the Test Harness session.
+
+**Example:**
+
+~~~~
+ Draw[] set env(CSF_MyDrawPluginDefaults) /users/test
+~~~~
+
+++ /dev/null
-Draw Test Harness {#user_guides__test_harness}
-===============================
-
-@section occt_2142243456_1775316760 Introduction
-
-This manual explains how to use Draw, the test harness for Open CASCADE Technology (**OCCT**). It provides basic documentation on using Draw. For advanced information on Draw and its applications, see our offerings on our web site at <a href="http://www.opencascade.org/support/training">http://www.opencascade.org/support/training</a>
-
-Draw is a command interpreter based on TCL and a graphical system used to test and demonstrate Open CASCADE Technology modeling libraries.
-
-
-@subsection occt_2142243456_17753167601 Overview
-
-Draw is a test harness for Open CASCADE Technology. It provides a flexible and easy to use means of testing and demonstrating the OCCT modeling libraries.
-
-Draw can be used interactively to create, display and modify objects such as curves, surfaces and topological shapes.
-
-Scripts may be written to customize Draw and perform tests. New types of objects and new commands may be added using the C++ programing language.
-
-Draw consists of:
-
- * A command interpreter based on the TCL command language.
- * A 3d graphic viewer based on the X system.
- * A basic set of commands covering scripts, variables and graphics.
- * A set of geometric commands allowing the user to create and modify curves and surfaces and to use OCCT geometry algorithms. This set of commands is optional.
- * A set of topological commands allowing the user to create and modify BRep shapes and to use the OCCT topology algorithms.
-
-
-There is also a set of commands for each delivery unit in the modeling libraries:
-
-GEOMETRY, TOPOLOGY, ADVALGOS, GRAPHIC, PRESENTATION.
-
-
-@subsection occt_2142243456_17753167602 Contents of this documentation
-
-This documentation describes:
-
- * The command language.
- * The basic set of commands.
- * The graphical commands.
- * The Geometry set of commands.
- * The Topology set of commands.
-
-This document does not describe other sets of commands and does not explain how to extend Draw using C++.
-
-This document is a reference manual. It contains a full description of each command. All descriptions have the format illustrated below for the exit command.
-**Example**
-
-**exit**
-Syntax: exit
-
-Terminates the Draw, TCL session. If the commands are read from a file using the source command, this will terminate the file.
-
-**Example**
-
-# this is a very short example
-exit
-
-
-
-@subsection occt_2142243456_17753167603 Getting started
-
-Install Draw and launch Emacs. Get a command line in Emacs using *Esc x *and key in *woksh*.
-
-Since version 5.1.1 Open CASCADE Technology introduces a single executable in the DRAW Test Harness that supersedes the several separate executables that existed before. Respectively the user does not need to have his own executables to activate his custom commands. All he needs to do is to implement the commands themselves, they will be activated in the common executable. This executable is now called **DRAWEXE**.
-
-Commands grouped in toolkits can now be loaded at run-time thereby implementing dynamically loaded plug-ins. Thus, the user can work only with those commands that suit his needs adding these commands dynamically without leaving the Test Harness session.
-
-Declaration of available plug-ins is done through the special resource file(s). The **pload** command loads the plug-in in accordance with the specified resource file and activates the commands implemented in the plug-in.
-The whole process of using new advantages of the plug-in mechanism as well as instructions for extending Test Harness are described below.
-
-
-@subsubsection occt_2142243456_177531676031 Launching DRAW Test Harness
-
-Test Harness executable DRAWEXE is located in the $CASROOT/platform/bin directory (where platform is win32 for Windows, SunOS for Sun Solaris and Linux for Linux operating systems). Prior to launching it is important to make sure the environment is correctly set-up (usually this is done automatically after the installation process on Windows or after launching specific scripts on Unix/Linux) - refer to Technical Documentation for details.
-
-
-@subsubsection occt_2142243456_177531676032 Plug-in resource file
-
-Open CASCADE Technology is shipped with the DrawPlugin resource file located in the $CASROOT/src/DrawResources directory.
-The format of the file is compliant with standard Open CASCADE Technology resource files (see the Resource_Manager.cdl file for details).
-
-Each key defines a sequence of either further (nested) keys or a name of the dynamic library. Keys can be nested down to an arbitrary level. However, cyclic dependencies between the keys are not checked.
-**Example** (excerpt from DrawPlugin):
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-OCAF : VISUALIZATION, OCAFKERNEL
-VISUALIZATION : AISV
-OCAFKERNEL : DCAF
-
-DCAF : TKDCAF
-AISV : TKViewerTest
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-@subsubsection occt_2142243456_177531676033 Activation of commands implemented in the plug-in
-
-To load a plug-in declared in the resource file and to activate the commands the following command must be used in Test Harness:
-
-pload [-PluginFileName] [[Key1] [Key2]...], where:
-
--PluginFileName Defines the name of a plug-in resource file (prefix ;-; is mandatory) described above.
-If this parameter is omitted then the default name DrawPlugin is used.
-
-Key… Defines the key(s) enumerating plug-ins to be loaded.
-If no keys are specified then the key named DEFAULT is used (if there is no such key in the file then no plug-ins are loaded).
-According to the OCCT resource file management rules, to access the resource file the environment variable CSF_PluginFileNameDefaults (and optionally CSF_PluginFileNameUserDefaults) must be set and point to the directory storing the resource file. If it is omitted then the plug-in resource file will be searched in the $CASROOT/src/DrawResources directory.
-**Examples:**
-
-Draw[] pload -DrawPlugin OCAF
-Will search the resource file DrawPlugin using variable CSF_DrawPluginDefaults (and CSF_DrawPluginUserDefaults) and will start with the OCAF key. Since the DrawPlugin is the file shipped with Open CASCADE Technology it will be found in the $CASROOT/src/DrawResources directory (unless this location is redefined by user's variables). The OCAF key will be recursively extracted into two toolkits/plug-ins: TKDCAF and TKViewerTest (e.g. on Windows they correspond to TKDCAF.dll and TKViewerTest.dll). Thus, commands implemented for Visualization and OCAF will be loaded and activated in Test Harness.
-
-Draw[] pload (equivalent to pload -DrawPlugin DEFAULT).
-Will find the default DrawPlugin file and the DEFAULT key. The latter finally maps to the TKTopTest toolkit which implements basic modeling commands.
-
-
-@subsubsection occt_2142243456_177531676034 Mapping between former separate Test Harness executables and the new plug-ins
-
-Before version 5.1.1 Open CASCADE Technology used to be shipped with several separate executables providing different sets of commands. The following table represents the mapping between former executables and new plug-ins.
-
-
-For instance, in order to activate commands available in the former AISViewer executable, now it is enough to use the command pload VISUALIZATION.
-
-When you have the tclsh prompt, key in the library references:
-
-*wokcd MDL:k1deb:ref:DRAWEXE*. At the prompt, key in the environment
-(*@@ -setenv *in Unix). Draw displays a prompt. Here is a sample session:
-
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# create two views, one 2d the other axonometric. Use either the command line or the Draw taskbar (*Views/av2d*).
-Draw[1]av2d
-
-# create a 2d circle
-Draw[2]circle c 0 0 1 0 5
-# trim the circle and dump it
-Draw[3] trim c c 0 pi/2
-Draw[4] dump c
-==***** Dump of c *****
-==Trimmed curve
-==Parameters : 0 1.5707963267949
-==Basis curve :
-==Circle
-== Center :0, 0
-== XAxis :1, 0
-== YAxis :-0, 1
-== Radius :5
-# make a 3d circle from it, and turn it into a bspline
-Draw[6] to3d c1 c
-Draw[7] fit
-Draw[8] convert c2 c1
-Draw[9] dump c2
-***** Dump of c2 *****
-BSplineCurve rational
-Degree 2, 3 Poles, 2 Knots
-Poles :
-1 : 5, 0, 0 1
-2 : 5, 5, 0 0.707106781186548
-3 : 3.06161699786838e-16, 5, 0 1
-Knots :
-1 : 0 3
-2 : 1.5707963267949 3
-
-# make a surface of revolution from the spline
-Draw[10] fit
-Draw[11] help rev
-reverse : reverse name ...
-revsurf : revsurf name curvename x y z dx dy dz
-# here you must click on the curve with the mouse
-Draw[12] revsurf s . 5 5 0 -1 1 0
-Pick an object
-Draw[13] fit
-# rotate the view
-Draw[14] u
-Draw[15] erase c
-# make a bspline surface and intersect with a plane
-Draw[20] convert s s
-Draw[21] fit
-Draw[22] plane p 5 5 5 1 1 1 1 0 0
-Draw[23] intersect c p s
-# pick one of the intersection curves
-# you may get c_2 onstead of c_1
-Draw[24] whatis .
-Pick an object
-c_1 is a a 3d curve
-Draw[25] clear
-Draw[27] rename c_1 c
-Draw[28] fit
-# save the curve, use datadir (p. 32) to specify the
-directory you want to save your file in.
-Draw[29] save c
-Draw[30] exit
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-In this example some geometrical operations have been performed. Objects displayed and written to files.
-@section occt_2142243456_1668530729 The Command Language
-
-
-
-
-
-@subsection occt_2142243456_16685307294 Overview
-
-The command language used in Draw is Tcl. Tcl<a href="#_ftn1">[1]</a> documentation such as ;TCL and the TK Toolkit; by John K. Ousterhout (Addison-Wesley) will prove useful if you intend to use Draw extensively.
-
-This chapter is designed to give you a short outline of both the TCL language and some extensions included in Draw. The following topics are covered:
-
- * Syntax of the TCL language.
- * Accessing variables in TCL and Draw.
- * Control structures.
- * Procedures.
-
-@subsection occt_2142243456_16685307295 Syntax of TCL
-
-TCL is an interpreted command language, not a structured language like C, Pascal, LISP or Basic. It uses a shell similar to that of csh. TCL is, however, easier to use than csh because control structures and procedures are easier to define. As well, because TCL does not assign a process to each command, it is faster than csh.
-
-The basic program for TCL is a script. A script consists of one or more commands. Commands are separated by new lines or semicolons.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-set a 24
-set b 15
-set a 25; set b 15
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Each command consists of one or more *words*; the first word is the name of a command and additional words are arguments to that command.
-
-Words are separated by spaces or tabs. In the preceding example each of the four commands has three words. A command may contain any number of words and each word is a string of arbitrary length.
-
-The evaluation of a command by TCL is done in two steps. In the first step, the command is parsed and broken into words. Some substitutions are also performed. In the second step, the command procedure corresponding to the first word is called and the other words are interpreted as arguments. In the first step, there is only string manipulation, The words only acquire *meaning* in the second step by the command procedure.
-
-The following substitutions are performed by TCL:
-
-**1. **Variable substitution is triggered by the $ character (as with csh), the content of the variable is substitued; { } may be used as in csh to enclose the name of the variable.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# set a variable value
-set file documentation
-puts $file #to display file contents on the screen
-
-# a simple substitution, set psfile to documentation.ps
-set psfile $file.ps
-puts $psfile
-
-# another substitution, set pfile to documentationPS
-set pfile ${file}PS
-
-# a last one,
-# delete files NEWdocumentation and OLDdocumentation
-foreach prefix {NEW OLD} {rm $prefix$file}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**2. **Command substitution is triggered by the [ ] characters. The brackets must enclose a valid script. The script is evaluated and the result is substituted.
-Compare command construction in csh.
-
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-set degree 30
-set pi 3.14159265
-# expr is a command evaluating a numeric expression
-set radian [expr $pi*$degree/180]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**3. **Backslash substitution is triggered by the backslash character. It is used to insert special characters like $, [ , ] , etc. It is also useful to insert a new line, a backslash terminated line is continued on the following line.
-TCL uses two forms of *quoting* to prevent substitution and word breaking.
-
-**4. **Double quote *quoting* enables the definition of a string with space and tabs as a single word. Substitutions are still performed inside the inverted commas ; ;.
-
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# set msg to ;the price is 12.00;
-set price 12.00
-set msg ;the price is $price;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**5. **Braces *quoting* prevents all substitutions. Braces are also nested. The main use of braces is to defer evaluation when defining procedures and control structures. Braces are used for a clearer presentation of TCL scripts on several lines.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-set x 0
-# this will loop for ever
-# because while argument is ;0 3;
-while ;$x 3; {set x [expr $x+1]}
-# this will terminate as expected because
-# while argument is {$x 3}
-while {$x 3} {set x [expr $x+1]}
-# this can be written also
-while {$x 3} {
-set x [expr $x+1]
-}
-# the following cannot be written
-# because while requires two arguments
-while {$x 3}
-{
-set x [expr $x+1]
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Comments start with a # character as the first non-blank character in a command. To add a comment at the end of the line, the comment must be preceded by a semi-colon to end the preceding command.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# This is a comment
-set a 1 # this is not a comment
-set b 1; # this is a comment
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The number of words is never changed by substitution when parsing in TCL. For example, the result of a substitution is always a single word. This is different from csh but convenient as the behavior of the parser is more predictable. It may sometimes be necessary to force a second round of parsing. **eval **accomplishes this: it accepts several arguments, concatenates them and executes the resulting script.
-
-
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-# I want to delete two files
-
-set files ;foo bar;
-
-# this will fail because rm will receive only one argument
-# and complain that ;foo bar; does not exit
-
-exec rm $files
-
-# a second evaluation will do it
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-@subsection occt_2142243456_16685307296 Accessing variables in TCL and Draw
-
-TCL variables have only string values. Note that even numeric values are stored as string literals, and computations using the **expr **command start by parsing the strings. Draw, however, requires variables with other kinds of values such as curves, surfaces or topological shapes.
-
-TCL provides a mechanism to link user data to variables. Using this functionality, Draw defines its variables as TCL variables with associated data.
-
-The string value of a Draw variable is meaningless. It is usually set to the name of the variable itself. Consequently, preceding a Draw variable with a *$ *does not change the result of a command. The content of a Draw variable is accessed using appropriate commands.
-
-There are many kinds of Draw variables, and new ones may be added with C++. Geometric and topological variables are described below.
-
-Draw numeric variables can be used within an expression anywhere a Draw command requires a numeric value. The **expr **command is useless in this case as the variables are stored not as strings but as floating point values.
-
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# dset is used for numeric variables
-# pi is a predefined Draw variable
-dset angle pi/3 radius 10
-point p radius*cos(angle) radius*sin(angle) 0
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-It is recommended that you use TCL variables only for strings and Draw for numerals. That way, you will avoid the **expr **command. As a rule, Geometry and Topology require numbers but no strings.
-
-@subsubsection occt_2142243456_166853072961 set, unset
-
-Syntax: set varname [value]
-unset varname [varname varname ...]
-
-**set **assigns a string value to a variable. If the variable does not already exist, it is ñreated.
-
-Without a value, **set **returns the content of the variable.
-
-**unset **deletes variables. It is is also used to delete Draw variables.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-set a ;Hello world;
-set b ;Goodbye;
-set a
-== ;Hello world;
-unset a b
-set a
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-<h4>NOTE</h4>
-*The set command can set only one variable, unlike the dset command.*
-
-
-See also: **dset**, **dval**
-
-
-@subsubsection occt_2142243456_166853072962 dset, dval
-
-Syntax dset var1 value1 vr2 value2 ...
-dval name
-
-**dset **assigns values to Draw numeric variables. The argument can be any numeric expression including Draw numeric variables. Since all Draw commands expect a numeric expression, there is no need to use $ or **expr**. The **dset **command can assign several variables. If there is an odd number of arguments, the last variable will be assigned a value of 0. If the variable does not exist, it will be created.
-
-**dval **evaluates an expression containing Draw numeric variables and returns the result as a string, even in the case of a single variable. This is not used in Draw commands as these usually interpret the expression. It is used for basic TCL commands expecting strings.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# z is set to 0
-dset x 10 y 15 z
-== 0
-
-# no $ required for Draw commands
-point p x y z
-
-# *puts* prints a string
-puts ;x = [dval x], cos(x/pi) = [dval cos(x/pi)];
-== x = 10, cos(x/pi) = -0.99913874099467914
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-<h4>NOTE</h4>
-*In TCL, parentheses are not considered to be special characters. Do not forget to quote an expression if it contains spaces in order to avoid parsing different words. (a + b) is parsed as three words:;(a + b); or (a+b) are correct.*
-
-See also: **set**, **unset**
-
-
-
-@subsection occt_2142243456_16685307297 lists
-
-TCL uses lists. A list is a string containing elements separated by spaces or tabs. If the string contains braces, the braced part accounts as one element.
-
-This allows you to insert lists within lists.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# a list of 3 strings
-;a b c;
-
-# a list of two strings the first is a list of 2
-;{a b} c;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Many TCL commands return lists and **foreach **is a useful way to create loops on list elements.
-
-@subsubsection occt_2142243456_166853072971 Control Structures
-
-TCL allows looping using control structures. The control structures are implemented by commands and their syntax is very similar to that of their C counterparts (**if**, **while**, **switch**, etc.). In this case, there are two main differences between TCL and C:
-
-2. You use braces instead of parentheses to enclose conditions.
-3. You do not start the script on the next line of your command.
-
-
-@subsubsection occt_2142243456_166853072911 if
-
-Syntax if condition script [elseif script .... else script]
-
-**If **evaluates the condition and the script to see whether the condition is true.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-if {$x 0} {
-puts ;positive;
-} elseif {$x == 0} {
-puts ;null;
-} else {
-puts ;negative;
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-@subsubsection occt_2142243456_166853072912 while, for, foreach
-
-Syntax: while condition script
-for init condition reinit script
-foreach varname list script
-
-The three loop structures are similar to their C or csh equivalent. It is important to use braces to delay evaluation. **foreach **will assign the elements of the list to the variable before evaluating the script.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# while example
-dset x 1.1
-while {[dval x] 100} {
- circle c 0 0 x
- dset x x*x
-}
-# for example
-# incr var d, increments a variable of d (default 1)
-for {set i 0} {$i 10} {incr i} {
- dset angle $i*pi/10
- point p$i cos(angle0 sin(angle) 0
-}
-# foreach example
-foreach object {crapo tomson lucas} {display $object}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-See also: **break**, **continue**
-
-
-@subsubsection occt_2142243456_166853072913 break, continue
-
-Syntax: break
-continue
-
-Within loops, the **break **and **continue **commands have the same effect as in C.
-
-**break **interrupts the innermost loop and **continue **jumps to the next iteration.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# search the index for which t$i has value ;secret;
-for {set i 1} {$i = 100} {incr i} {
- if {[set t$i] == ;secret;} break;
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-@subsection occt_2142243456_16685307292 Procedures
-
-TCL can be extended by defining procedures using the **proc **command, which sets up a context of local variables, binds arguments and executes a TCL script.
-
-The only problematic aspect of procedures is that variables are strictly local, and as they are implicitly created when used, it may be difficult to detect errors.
-
-There are two means of accessing a variable outside the scope of the current procedures: **global **declares a global variable (a variable outside all procedures); **upvar **accesses a variable in the scope of the caller. Since arguments in TCL are always string values, the only way to pass Draw variables is by reference, i.e. passing the name of the variable and using the **upvar **command as in the following examples.
-
-As TCL is not a strongly typed language it is very difficult to detect programing errors and debugging can be tedious. TCL procedures are, of course, not designed for large scale software development but for testing and simple command or interactive writing.
-
-
-@subsubsection occt_2142243456_166853072921 proc
-
-Syntax: proc argumentlist script
-
-**proc **defines a procedure. An argument may have a default value. It is then a list of the form {argument value}. The script is the body of the procedure.
-
-**return **gives a return value to the procedure.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# simple procedure
-proc hello {} {
- puts ;hello world;
-}
-# procedure with arguments and default values
-proc distance {x1 y1 {x2 0} {y2 0}} {
- set d [expr (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)]
- return [expr sqrt(d)]
-}
-proc fact n {
- if {$n == 0} {return 1} else {
- return [expr n*[fact [expr n -1]]]
- }
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-See also: **global**, **upvar**
-
-
-@subsubsection occt_2142243456_166853072922 global, upvar
-
-Syntax: global varname [varname ...]
-upvar varname localname [varname localname ...]
-
-**global **accesses high level variables. Unlike C, global variables are not visible in procedures.
-
-**upvar **gives a local name to a variable in the caller scope. This is useful when an argument is the name of a variable instead of a value. This is a call by reference and is the only way to use Draw variables as arguments.
-
-<h4>NOTE</h4>
-*Note in the following examplesthat the $ character is always*
-*necessarily used to access the arguments.*
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# convert degree to radian
-# pi is a global variable
-proc deg2rad (degree} {
- return [dval pi*$degree/2.]
-}
-# create line with a point and an angle
-proc linang {linename x y angle} {
- upvar linename l
- line l $x $y cos($angle) sin($angle)
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-@section occt_2142243456_967049381 Basic Commands
-
-This chapter describes all the commands defined in the basic Draw package. Some are TCL commands, but most of them have been formulated in Draw. These commands are found in all Draw applications. The commands are grouped into four sections:
-
- * General commands, which are used for Draw and TCL management.
- * Variable commands, which are used to manage Draw variables such as storing and dumping.
- * Graphic commands, which are used to manage the graphic system, and so pertain to views.
- * Variable display commands, which are used to manage the display of objects within given views.
-
-Note that Draw also features a GUI taskbar providing an alternative way to give certain general, graphic and display commands
-
-
-
-@subsection occt_2142243456_9670493811 General commands
-
-This section describes several useful commands: **help **to get information, **source **to eval a script from a file, **spy **to capture the commands in a file, **cpulimit **to limit the process cpu time, **wait **to waste some time, **chrono **to time commands.
-
-
-@subsubsection occt_2142243456_96704938111 help
-
-Syntax: help [command [helpstring group]]
-
-Provides help or modifies the help information.
-
-**help **without arguments lists all groups and the commands in each group.
-
-Specifying the command returns its syntax and in some cases, information on the command, The joker,*, is automatically added at the end so that all completing commands are returned as well.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# Gives help on all commands starting with *a*
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-@subsubsection occt_2142243456_96704938112 source
-
-Syntax: source filename
-
-Executes a file.
-
-The **exit **command will terminate the file.
-
-See also: exit
-
-
-@subsubsection occt_2142243456_96704938113 spy
-
-Syntax: spy [filename]
-
-Saves interactive commands in the file. If spying has already been performed, the current file is closed. **spy **without an argument closes the current file and stops spying. If a file already exists, the file is overwritten. Commands are not appended.
-If a command returns an error it is saved with a comment mark.
-
-The file created by **spy **can be executed with the **source **command.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# all commands will be saved in the file ;session;
-spy session
-# the file ;session; is closed and commands are not saved
-spy
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-See also: **source**
-
-
-@subsubsection occt_2142243456_96704938114 cpulimit
-
-Syntax: cpulimit [nbseconds]
-
-**cpulimit **limits a process after the number of seconds specified in *nbseconds. *It is used in tests to avoid infinite loops. **cpulimit **without arguments removes all existing limits.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-#limit cpu to one hour
-cpulimit 3600
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-@subsubsection occt_2142243456_96704938115 wait
-
-Syntax: wait [nbseconds]
-
-Suspends execution for the number of seconds specified in *nbseconds*. The default value is ten (10) seconds. This is a useful command for a slide show.
-
-<h5>Example</h5>
-
-# You have ten seconds ...
-wait
-
-@subsubsection occt_2142243456_96704938116 chrono
-
-Syntax: chrono [ name start/stop/reset/show]
-
-Without arguments, **chrono **activates Draw chronometers. The elapsed time ,cpu system and cpu user times for each command will be printed.
-
-With arguments, **chrono **is used to manage activated chronometers. You can perform the following actions with a chronometer.
-
- * run the chronometer (start).
- * stop the chronometer (stop).
- * reset the chronometer to 0 (reset).
- * display the current time (show).
-
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-chrono
-==Chronometers activated.
-ptorus t 20 5
-==Elapsed time: 0 Hours 0 Minutes 0.0318 Seconds
-==CPU user time: 0.01 seconds
-==CPU system time: 0 seconds
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-@subsection occt_2142243456_9670493812 Variable management commands
-
-@subsubsection occt_2142243456_96704938121 isdraw, directory
-
-Syntax: isdraw varname
-directory [pattern]
-
-**isdraw **tests to see if a variable is a Draw variable. **isdraw **will return 1 if there is a Draw value attached to the variable.
-Use **directory **to return a list of all Draw global variables matching a pattern.
-
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-set a 1
-isdraw a
-=== 0
-
-dset a 1
-isdraw a
-=== 1
-
-circle c 0 0 1 0 5
-isdraw c
-=== 1
-
-# to destroy all Draw objects with name containing curve
-foreach var [directory *curve*] {unset $var}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-See also: **whatis**
-
-
-@subsubsection occt_2142243456_96704938122 whatis, dump
-
-Syntax: whatis varname [varname ...]
-dump varname [varname ...]
-
-**whatis **returns short information about a Draw variable. This is usually the type name.
-
-**dump **returns a brief type description, the coordinates, and if need be, the parameters of a Draw variable.
-
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-circle c 0 0 1 0 5
-whatis c
-c is a 2d curve
-
-dump c
-
-***** Dump of c *****
-Circle
-Center :0, 0
-XAxis :1, 0
-YAxis :-0, 1
-Radius :5
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-<h4>NOTE</h4>
-*The behavior of whatis on other variables (not Draw) is not*
-*excellent.*
-
-
-@subsubsection occt_2142243456_96704938123 rename, copy
-
-Syntax: rename varname tovarname [varname tovarname ...]
-copy varname tovarname [varname tovarname ...]
-
-**rename **changes the name of a Draw variable. The original variable will no longer exist. Note that the content is not modified. Only the name is changed.
-
-**copy **creates a new variable with a copy of the content of an existing variable. The exact behavior of **copy **is type dependent; in the case of certain topological variables, the content may still be shared.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-circle c1 0 0 1 0 5
-rename c1 c2
-
-# curves are copied, c2 will not be modified
-copy c2 c3
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-@subsubsection occt_2142243456_96704938124 datadir, save, restore
-
-Syntax: datadir [directory]
-save variable [filename]
-restore filename [variablename]
-
-**datadir **without arguments prints the path of the current data directory.
-**datadir **with an argument sets the data directory path.
-If the path starts with a dot (.) only the last directory name will be changed in the path.
-
-**save **writes a file in the data directory with the content of a variable. By default the name of the file is the name of the variable. To give a different name use a second argument.
-
-**restore **reads the content of a file in the data directory in a local variable. By default, the name of the variable is the name of the file. To give a different name, use a second argument.
-
-The exact content of the file is type-dependent. They are usually ASCII files and so, architecture independent.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# note how TCL accesses shell environment variables
-# using $env()
-datadir
-==.
-
-datadir $env(WBCONTAINER)/data/default
-==/adv_20/BAG/data/default
-
-box b 10 20 30
-save b theBox
-==/adv_20/BAG/data/default/theBox
-
-# when TCL does not find a command it tries a shell command
-ls [datadir]
-== theBox
-
-restore theBox
-== theBox
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-@subsection occt_2142243456_9670493813 User defined commands
-
-DrawTrSurf provides commands to create and display a Draw **geometric **variable from a Geom_Geometry object and also get a Geom_Geometry object from a Draw geometric variable name.
-
-DBRep provides commands to create and display a Draw **topological **variable from a TopoDS_Shape object and also get a TopoDS_Shape object from a Draw topological variable name.
-
-@subsubsection occt_2142243456_96704938131 set
-
-**DrawTrSurf Package:**
-Syntax:
-
-void Set(Standard_CString& Name,const gp_Pnt& G) ;
-void Set(Standard_CString& Name,const gp_Pnt2d& G) ;
-void Set(Standard_CString& Name,
-const Handle(Geom_Geometry)& G) ;
-void Set(Standard_CString& Name,
-const Handle(Geom2d_Curve)& C) ;
-void Set(Standard_CString& Name,
-const Handle(Poly_Triangulation)& T) ;
-void Set(Standard_CString& Name,
-const Handle(Poly_Polygon3D)& P) ;
-void Set(Standard_CString& Name,
-const Handle(Poly_Polygon2D)& P) ;
-
-**DBRep Package:**
-Syntax:
-
-void Set(const Standard_CString Name,
-const TopoDS_Shape& S) ;
-
-**Example: DrawTrSurf**
-
-Handle(Geom2d_Circle) C1 = new Geom2d_Circle
-(gce_MakeCirc2d (gp_Pnt2d(50,0,) 25));
-DrawTrSurf::Set(char*, C1);
-
-**Example: DBRep**
-
-TopoDS_Solid B;
-B = BRepPrimAPI_MakeBox (10,10,10);
-DBRep::Set(char*,B);
-
-See also: **get**
-
-@subsubsection occt_2142243456_96704938132 get
-
-**DrawTrSurf Package:**
-Syntax:
-
-Handle_Geom_Geometry Get(Standard_CString& Name) ;
-
-**DBRep Package:**
-Syntax:
-
-TopoDS_Shape Get(Standard_CString& Name,
-const TopAbs_ShapeEnum Typ = TopAbs_SHAPE,
-const Standard_Boolean Complain
-= Standard_True) ;
-**Example: DrawTrSurf**
-
-Standard_Integer MyCommand
-(Draw_Interpretor& theCommands,
-Standard_Integer argc, char** argv)
-{......
-// Creation of a Geom_Geometry from a Draw geometric
-// name
-Handle (Geom_Geometry) aGeom= DrawTrSurf::Get(argv[1]);
-}
-
-**Example: DBRep**
-
-Standard_Integer MyCommand
-(Draw_Interpretor& theCommands,
-Standard_Integer argc, char** argv)
-{......
-// Creation of a TopoDS_Shape from a Draw topological
-// name
-TopoDS_Solid B = DBRep::Get(argv[1]);
-}
-See also: **set**
-
-@section occt_2142243456_445622066 Graphic Commands
-
-Graphic commands are used to manage the Draw graphic system. Draw provides a 2d and a 3d viewer with up to 30 views. Views are numbered and the index of the view is displayed in the window’s title. Objects are displayed in all 2d views or in all 3d views, depending on their type. 2d objects can only be viewed in 2d views while 3d objects – only in 3d views correspondingly.
-
-@subsection occt_2142243456_4456220661 Axonometric viewer
-
-@subsubsection occt_2142243456_44562206611 view, delete
-
-Syntax: view index type [X Y W H]
-delete [index]
-
-**view **is the basic view creation command: it creates a new view with the given index. If a view with this index already exits, it is deleted. The view is created with default parameters and X Y W H are the position and dimensions of the window on the screen. Default values are 0, 0, 500, 500.
-
-As a rule it is far simpler either to use the procedures **axo**, **top**, **left **or to click on the desired view type in the menu under *Views *in the taskbar..
-
-**delete **deletes a view. If no index is given, all the views are deleted.
-
-Type selects from the following range:
-
- * AXON: Axonometric view
- * PERS: Perspective view
- * +X+Y: View on both axes (i.e. a top view), other codes are -X+Y, +Y-Z etc.
- * -2D- : 2d view
-
-The index, the type, the current zoom are displayed in the window title .
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# this is the content of the mu4 procedure
-proc mu4 {} {
-delete
-view 1 +X+Z 320 20 400 400
-view 2 +X+Y 320 450 400 400
-view 3 +Y+Z 728 20 400 400
-view 4 AXON 728 450 400 400
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-See also: **axo, pers, top, bottom, left, right, front, back, mu4, v2d, av2d, smallview**
-
-@subsubsection occt_2142243456_44562206612 axo, pers, top, ...
-
-Syntax: axo
-pers
-...
-smallview type
-
-All these commands are procedures used to define standard screen layout. They delete all existing views and create new ones. The layout usually complies with the European convention, i.e. a top view is under a front view.
-
- * **axo **creates a large window axonometric view.
- * **pers **creates a large window perspective view.
- * **top**, **bottom**, **left**, **right**, **front**, **back **create a large window axis view
- * **mu4 **creates four small window viewsview: front, left, top and axo.
- * **v2d**: creates a large window 2d view.
- * **av2d **creates two small window views, one 2d and one axo
-**smallview **creates a view at the bottom right of the screen of the given type.
-
-See also: **view**, **delete**
-
-
-@subsubsection occt_2142243456_44562206613 mu, md, 2dmu, 2dmd, zoom, 2dzoom
-
-Syntax: mu [index] value
-2dmu [index] value
-zoom [index] value
-wzoom
-
-**mu **(magnify up) increases the zoom in one or several views by a factor of 10%.
-**md **(magnify down) decreases the zoom by the inverse factor. **2dmu **and **2dmd**
-perform the same on one or all 2d views.
-
-**zoom **and **2dzoom **set the zoom factor to a value specified by you. The current
-zoom factor is always displayed in the window’s title bar. Zoom 20 represents a
-full screen view in a large window; zoom 10, a full screen view in a small one.
-
-**wzoom **(window zoom) allows you to select the area you want to zoom in on with the mouse. You will be prompted to give two of the corners of the area that you want to magnify and the rectangle so defined will occupy the window of the view.
-
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# set a zoom of 2.5
-zoom 2.5
-
-# magnify by 10%
-mu 1
-
-# magnify by 20%
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-See also: **fit**, **2dfit**
-
-
-@subsubsection occt_2142243456_44562206614 pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr
-
-Syntax: pu [index]
-pd [index]
-
-The **p_ **commands are used to pan. **pu **and **pd **pan up and down respectively;**pl **and **pr **pan left and right respectively. Each time the view is displaced by 40 pixels.When no index is given, all views will pan in the direction specified.
-
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# you have selected one anonometric view
-pu
-# or
-pu 1
-
-# you have selected an mu4 view; the object in the third
-# view will pan up
-pu 3
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-See also: **fit**, **2dfit**
-
-
-@subsubsection occt_2142243456_44562206615 fit, 2dfit
-
-Syntax: fit [index]
-2dfit [index]
-
-**fit **computes the best zoom and pans on the content of the view. The content of the view will be centered and fit the whole window.
-
-When fitting all views a unique zoom is computed for all the views. All views are on the same scale.
-
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# fit only view 1
-fit 1
-# fit all 2d views
-2dfit
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-See also: **zoom**, **mu**, **pu**
-
-
-@subsubsection occt_2142243456_44562206616 u, d, l, r
-
-Syntax: u [index]
-d [index]
-l [index]
-r [index]
-
-**u**, **d**, **l**, **r **Rotate the object in view around its axis by five degrees up, down, left or right respectively. This command is restricted to axonometric and perspective views.
-
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# rotate the view up
-u
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-@subsubsection occt_2142243456_44562206617 focal, fu, fd
-
-Syntax: focal [f]
-fu [index]
-fd [index]
-**focal **changes the vantage point in perspective views. A low f value increases the perspective effect; a high one give a perspective similar to that of an axonometric view. The default value is 500.
-
-Use **fu **and **fd **to increase or decrease the focal value by 10%. **fd **makes the eye closer to the object.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-pers
-repeat 10 fd
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-*NOTE*
-*Do not use a negative or null focal value.*
-
-See also: **pers**
-
-
-@subsubsection occt_2142243456_44562206618 color
-
-Syntax: color index name
-
-**color **sets the color to a value. The index of the color is a value between 0 and 15. The name is an X window color name. The list of these can be found in the file rgb.txt in the X library directory.
-
-The default values are 0 White, 1 Red, 2 Green, 3 Blue, 4 Cyan, 5 Gold, 6 Magenta, 7 Marron, 8 Orange, 9 Pink, 10 Salmon, 11 Violet, 12 Yellow, 13 Khaki, 14 Coral.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# change the value of blue
-color 3 ;navy blue;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-<h4>NOTE</h4>
-*The color change will be visible on the next redraw of the*
-*views, for example after fit or mu, etc.*
-
-
-@subsubsection occt_2142243456_44562206619 dtext
-
-Syntax: dtext [x y [z]] string
-
-**dtext **displays a string in all 3d or 2d views. If no coordinates are given, a graphic selection is required. If two coordinates are given, the text is created in a 2d view at the position specified. With 3 coordinates, the text is created in a 3d view.
-
-The coordinates are real space coordinates.
-
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# mark the origins
-dtext 0 0 bebop
-dtext 0 0 0 bebop
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-@subsubsection occt_2142243456_445622066110 hardcopy, hcolor, xwd
-
-Syntax: hardcopy [index]
-hcolor index width gray
-xwd [index] filename
-
-**hardcopy **creates a postcript file called a4.ps in the current directory. This file contains the postscript description of the view index, and will allow you to print the view.
-
-**hcolor **lets you change the aspect of lines in the postscript file. It allows to specify a width and a gray level for one of the 16 colors. **width **is measured in points with default value as 1, **gray **is the gray level from 0 = black to 1 = white with default value as 0. All colors are bound to the default values at the beginning.
-
-**xwd **creates an X window xwd file from an active view. By default, the index is set to1. To visualize anxwd file, use the unix command **xwud**.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# all blue lines (color 3)
-# will be half-width and gray
-hcolor 3 0.5
-
-# make a postscript file and print it
-hardcopy
-lpr a4.ps
-
-# make an xwd file and display it
-xwd theview
-xwud -in theview
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-<h4>NOTE</h4>
-*When more than one view is present, specify the index of the view.*
-*Only use a postscript printer to print postscript files.*
-
-See also: **color**
-
-
-@subsubsection occt_2142243456_445622066111 wclick, pick
-
-Syntax: wclick
-pick index X Y Z b [nowait]
-
-**wclick **defers an event until the mouse button is clicked. The message ;just click; is displayed.
-
-Use the **pick **command to get graphic input. The arguments must be names for variables where the results are stored.
-
- * index: index of the view where the input was made.
- * X,Y,Z: 3d coordinates in real world.
- * b: b is the mouse button 1,2 or 3.
-
-When there is an extra argument, its value is not used and the command does not wait for a click; the value of b may then be 0 if there has not been a click.
-
-This option is useful for tracking the pointer.
-
-*NOTE*
-*The results are stored in Draw numeric variables.*
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# make a circle at mouse location
-pick index x y z b
-circle c x y z 0 0 1 1 0 0 0 30
-
-# make a dynamic circle at mouse location
-# stop when a button is clicked
-# (see the repaint command)
-
-dset b 0
-while {[dval b] == 0} {
-pick index x y z b nowait
-circle c x y z 0 0 1 1 0 0 0 30
-repaint
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-See also: **repaint**
-
-
-Draw provides commands to manage the display of objects. **display**, **donly **are used to display, **erase**, **clear**, **2dclear **to erase. The **autodisplay **command is used to check whether variables are displayed when created.
-
-The variable name ;.; (dot) has a special status in Draw. Any Draw command expecting a Draw object as argument can be passed a dot. The meaning of the dot is the following.
-
- * If the dot is an input argument, a graphic selection will be made. Instead of getting the object from a variable, Draw will ask you to select an object in a view.
- * If the dot is an output argument, an unnamed object will be created. Of course this makes sense only for graphic objects: if you create an unnamed number you will not be able to access it. This feature is used when you want to create objects for display only.
- * If you do not see what you expected while executing loops or sourcing files, use the **repaint **and **dflush **commands.
-
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# OK use dot to dump an object on the screen
-dump .
-
-point . x y z
-
-#Not OK. display points on a curve c
-# with dot no variables are created
-for {set i 0} {$i = 10} {incr i} {
-cvalue c $i/10 x y z
-point . x y z
-}
-
-# point p x y z
-# would have displayed only one point
-# because the precedent variable content is erased
-
-# point p$i x y z
-# is an other solution, creating variables
-# p0, p1, p2, ....
-
-# give a name to a graphic object
-rename . x
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-@subsubsection occt_2142243456_445622066112 autodisplay
-
-Syntax: autodisplay [0/1]
-
-By default, Draw automatically displays any graphic object as soon as it is created. This behavior known as autodisplay can be removed with the command **autodisplay**. Without arguments, **autodisplay **toggles the autodisplay mode. The command always returns the current mode.
-
-When **autodisplay **is off, using the dot return argument is ineffective.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# c is displayed
-circle c 0 0 1 0 5
-
-# toggle the mode
-autodisplay
-== 0
-circle c 0 0 1 0 5
-
-# c is erased, but not displayed
-display c
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-See also: **display**
-
-@subsubsection occt_2142243456_445622066113 display, donly
-
-Syntax: display varname [varname ...]
-donly varname [varname ...]
-
-**display **makes objects visible.
-
-**donly **(*display only*) makes objects visible and erases all other objects. It is very useful to extract one object from a messy screen.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# to see all objects
-foreach var [directory] {display $var}
-
-# to select two objects and erase the other ones
-donly . .
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-See also: **erase**
-
-
-@subsubsection occt_2142243456_445622066114 erase, clear, 2dclear
-
-Syntax: erase [varname varname ...]
-clear
-2dclear
-
-**erase **removes objects from all views. **erase **without arguments erases everything in 2d and 3d.
-
-**clear **erases only 3d objects and **2dclear, **only 2d objects. **erase **without arguments is similar to ; clear; 2dclear;.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# erase eveerything with a name starting with c_
-foreach var [directory c_*] {erase $var}
-
-# clear 2d views
-2d clear
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-See also: **display**
-@subsubsection occt_2142243456_445622066115 repaint, dflush
-
-Syntax: repaint
-dflush
-
-**repaint **forces repainting of views.
-
-**dflush **flushes the graphic buffers.
-
-These commands are useful within loops or in scripts.
-
-When an object is modified or erased, the whole view must be repainted. To avoid doing this too many times, Draw sets up a flag and delays the repaint to the end of the command in which the new prompt is issued. In a script, you may want to display the result of a change immediately. If the flag is raised, **repaint **will repaint the views and clear the flag.
-
-Graphic operations are buffered by Draw (and also by the X system). Usually the buffer is flushed at the end of a command and before graphic selection. If you want to flush the buffer from inside a script, use the **dflush **command.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-# See the example with the pick command
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-See also: **pick**
-
-@subsection occt_2142243456_4456220662 AIS viewer – view commands
-
-
-@subsubsection occt_2142243456_44562206621 vinit
-
-Syntax: vinit
-
-Creates the 3D viewer window
-
-@subsubsection occt_2142243456_44562206622 vhelp
-
-Syntax: vhelp
-
-Displays help in the 3D viewer window. The help consists in a list of hotkeys and their functionalities.
-
-@subsubsection occt_2142243456_44562206623 vtop
-
-Syntax: vtop
-
-Displays top view in the 3D viewer window.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-vinit
-box b 10 10 10
-vdisplay b
-vfit
-vtop
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-@subsubsection occt_2142243456_44562206624 vaxo
-
-Syntax: vaxo
-
-Displays axonometric view in the 3D viewer window.
-**Example**
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
-vinit
-box b 10 10 10
-vdisplay b
-vfit
-vaxo
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-@subsubsection occt_2142243456_44562206625 vsetbg
-
-Syntax: vsetbg imagefile [filltype]
-
-Loads image file as background. **filltype** must be **NONE, CENTERED, TILED or STRETCH**.
-**Example**
-
-vinit
-vsetbg myimage.brep CENTERED
-
-@subsubsection occt_2142243456_44562206626 vclear
-
-Syntax: vclear
-
-Removes all objects from the viewer.
-
-@subsubsection occt_2142243456_44562206627 vrepaint
-
-Syntax: vrepaint
-
-Forcedly redisplays the shape in the 3D viewer window.
-
-@subsubsection occt_2142243456_44562206628 vfit
-
-Syntax: vfit
-
-Automatic zoom/panning. Objects in the view are visualized to occupy the maximum surface.
-
-@subsubsection occt_2142243456_44562206629 vzfit
-
-Syntax: vzfit
-
-Automatic depth panning. Objects in the view are visualized to occupy the maximum 3d space.
-
-
-@subsection occt_2142243456_4456220663 AIS viewer – display commands
-
-@subsubsection occt_2142243456_44562206631 vdisplay
-
-Syntax: vdisplay name1 [name2] … [name n]
-
-Displays named objects.
-**Example**
-
-vinit
-box b 40 40 40 10 10 10
-psphere s 20
-vdisplay s b
-vfit
-
-
-@subsubsection occt_2142243456_44562206632 vdonly
-
-Syntax: vdonly [name1] … [name n]
-
-Displays only selected or named objects. If there are no selected or named objects, nothing is done.
-**Example**
-
-vinit
-box b 40 40 40 10 10 10
-psphere s 20
-vdonly b
-vfit
-@subsubsection occt_2142243456_44562206633 vdisplayall
-
-Syntax: vdisplayall
-
-Displays all created objects.
-**Example**
-
-vinit
-box b 40 40 40 10 10 10
-psphere s 20
-vdisplayall
-vfit
-@subsubsection occt_2142243456_44562206634 verase
-
-Syntax: verase [name1] [name2] … [name n]
-
-Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased.
-**Example**
-
-vinit
-box b1 40 40 40 10 10 10
-box b2 -40 -40 -40 10 10 10
-psphere s 20
-vdisplayall
-vfit
-# erase only first box
-verase b1
-# erase second box and sphere
-verase
-@subsubsection occt_2142243456_44562206635 veraseall
-
-Syntax: veraseall
-
-Erases all objects displayed in the viewer.
-**Example**
-vinit
-box b1 40 40 40 10 10 10
-box b2 -40 -40 -40 10 10 10
-psphere s 20
-vdisplayall
-vfit
-# erase only first box
-verase b1
-# erase second box and sphere
-verseall
-
-@subsubsection occt_2142243456_44562206636 vsetdispmode
-
-Syntax: vsetdispmode [name] mode(0,1,2,3)
-
-Sets display mode for all, selected or named objects.
-**mode** is **0** (**WireFrame**), **1** (**Shading**), **2** (**Quick HideLineremoval**), **3** (**Exact HideLineremoval**).
-**Example**
-
-vinit
-box b 10 10 10
-vdisplay b
-vsetdispmode 1
-vfit
-@subsubsection occt_2142243456_44562206637 vdisplaytype
-
-Syntax: vdisplaytype type
-
-Displays all objects of a given type.
-Possible **type**s are **;Point;, ;Axis;, ;Trihedron;, ;PlaneTrihedron;, ;Line;, ;Circle;, ;Plane;, ;Shape;, ;ConnectedShape;, ;MultiConn.Shape;, ;ConnectedInter.;, ;MultiConn.;, ;Constraint; **and** ;Dimension; **(see **vtypes**).
-
-@subsubsection occt_2142243456_44562206638 verasetype
-
-Syntax: verasetype type
-
-Erases all objects of a given type.
-Possible** type**s are **;Point;, ;Axis;, ;Trihedron;, ;PlaneTrihedron;, ;Line;, ;Circle;, ;Plane;, ;Shape;, ;ConnectedShape;, ;MultiConn.Shape;, ;ConnectedInter.;, ;MultiConn.;, ;Constraint; **and **;Dimension; **(see **vtypes**).
-
-@subsubsection occt_2142243456_44562206639 vtypes
-
-Syntax: vtypes
-
-Makes a list of known types and signatures in AIS.
-
-@subsubsection occt_2142243456_445622066310 vsetcolor
-
-Syntax: vsetcolor [shapename] colorname
-
-Sets color for all, selected or named shapes.
-Possible **colorname**s are **;BLACK;, ;MATRAGRAY;, ;MATRABLUE;, ;ALICEBLUE;, ;ANTIQUEWHITE;, ;ANTIQUEWHITE1;, ;ANTIQUEWHITE2;, ;ANTIQUEWHITE3;, ;ANTIQUEWHITE4;, ;AQUAMARINE1;, ;AQUAMARINE2;, ;AQUAMARINE4;, ;AZURE;, ;AZURE2;, ;AZURE3;, ;AZURE4;, ;BEIGE;, ;BISQUE;, ;BISQUE2;, ;BISQUE3;, ;BISQUE4;, ;BLANCHEDALMOND;, ;BLUE1;, ;BLUE2;, ;BLUE3;, ;BLUE4;, ;BLUEVIOLET;, ;BROWN;, ;BROWN1;, ;BROWN2;, ;BROWN3;, ;BROWN4;, ;BURLYWOOD;, ;BURLYWOOD1;, ;BURLYWOOD2;, ;BURLYWOOD3;, ;BURLYWOOD4;, ;CADETBLUE;, ;CADETBLUE1;, ;CADETBLUE2;, ;CADETBLUE3;, ;CADETBLUE4;, ;CHARTREUSE;, ;CHARTREUSE1;, ;CHARTREUSE2;, ;CHARTREUSE3;, ;CHARTREUSE4;, ;CHOCOLATE;, ;CHOCOLATE1;, ;CHOCOLATE2;, ;CHOCOLATE3;, ;CHOCOLATE4;, ;CORAL;, ;CORAL1;, ;CORAL2;, ;CORAL3;, ;CORAL4;, ;CORNFLOWERBLUE;, ;CORNSILK1;, ;CORNSILK2;, ;CORNSILK3;, ;CORNSILK4;, ;CYAN1;, ;CYAN2;, ;CYAN3;, ;CYAN4;, ;DARKGOLDENROD;, ;DARKGOLDENROD1;, ;DARKGOLDENROD2;, ;DARKGOLDENROD3;, ;DARKGOLDENROD4;, ;DARKGREEN;, ;DARKKHAKI;, ;DARKOLIVEGREEN;, ;DARKOLIVEGREEN1;, ;DARKOLIVEGREEN2;, ;DARKOLIVEGREEN3;, ;DARKOLIVEGREEN4;, ;DARKORANGE;, ;DARKORANGE1;, ;DARKORANGE2;, ;DARKORANGE3;, ;DARKORANGE4;, ;DARKORCHID;, ;DARKORCHID1;, ;DARKORCHID2;, ;DARKORCHID3;, ;DARKORCHID4;, ;DARKSALMON;, ;DARKSEAGREEN;, ;DARKSEAGREEN1;, ;DARKSEAGREEN2;, ;DARKSEAGREEN3;, ;DARKSEAGREEN4;, ;DARKSLATEBLUE;, ;DARKSLATEGRAY1;, ;DARKSLATEGRAY2;, ;DARKSLATEGRAY3;, ;DARKSLATEGRAY4;, ;DARKSLATEGRAY;, ;DARKTURQUOISE;, ;DARKVIOLET;, ;DEEPPINK;, ;DEEPPINK2;, ;DEEPPINK3;, ;DEEPPINK4;, ;DEEPSKYBLUE1;, ;DEEPSKYBLUE2;, ;DEEPSKYBLUE3;, ;DEEPSKYBLUE4;, ;DODGERBLUE1;, ;DODGERBLUE2;, ;DODGERBLUE3;, ;DODGERBLUE4;, ;FIREBRICK;, ;FIREBRICK1;, ;FIREBRICK2;, ;FIREBRICK3;, ;FIREBRICK4;, ;FLORALWHITE;, ;FORESTGREEN;, ;GAINSBORO;, ;GHOSTWHITE;, ;GOLD;, ;GOLD1;, ;GOLD2;, ;GOLD3;, ;GOLD4;, ;GOLDENROD;, ;GOLDENROD1;, ;GOLDENROD2;, ;GOLDENROD3;, ;GOLDENROD4;, ;GRAY;, ;GRAY0;, ;GRAY1;, ;GRAY10;, ;GRAY11;, ;GRAY12;, ;GRAY13;, ;GRAY14;, ;GRAY15;, ;GRAY16;, ;GRAY17;, ;GRAY18;, ;GRAY19;, ;GRAY2;, ;GRAY20;, ;GRAY21;, ;GRAY22;, ;GRAY23;, ;GRAY24;, ;GRAY25;, ;GRAY26;, ;GRAY27;, ;GRAY28;, ;GRAY29;, ;GRAY3;, ;GRAY30;, ;GRAY31;, ;GRAY32;, ;GRAY33;, ;GRAY34;, ;GRAY35;, ;GRAY36;, ;GRAY37;, ;GRAY38;, ;GRAY39;, ;GRAY4;, ;GRAY40;, ;GRAY41;, ;GRAY42;, ;GRAY43;, ;GRAY44;, ;GRAY45;, ;GRAY46;, ;GRAY47;, ;GRAY48;, ;GRAY49;, ;GRAY5;, ;GRAY50;, ;GRAY51;, ;GRAY52;, ;GRAY53;, ;GRAY54;, ;GRAY55;, ;GRAY56;, ;GRAY57;, ;GRAY58;, ;GRAY59;, ;GRAY6;, ;GRAY60;, ;GRAY61;, ;GRAY62;, ;GRAY63;, ;GRAY64;, ;GRAY65;, ;GRAY66;, ;GRAY67;, ;GRAY68;, ;GRAY69;, ;GRAY7;, ;GRAY70;, ;GRAY71;, ;GRAY72;, ;GRAY73;, ;GRAY74;, ;GRAY75;, ;GRAY76;, ;GRAY77;, ;GRAY78;, ;GRAY79;, ;GRAY8;, ;GRAY80;, ;GRAY81;, ;GRAY82;, ;GRAY83;, ;GRAY85;, ;GRAY86;, ;GRAY87;, ;GRAY88;, ;GRAY89;, ;GRAY9;, ;GRAY90;, ;GRAY91;, ;GRAY92;, ;GRAY93;, ;GRAY94;, ;GRAY95;, ;GREEN;, ;GREEN1;, ;GREEN2;, ;GREEN3;, ;GREEN4;, ;GREENYELLOW;, ;GRAY97;, ;GRAY98;, ;GRAY99;, ;HONEYDEW;, ;HONEYDEW2;, ;HONEYDEW3;, ;HONEYDEW4;, ;HOTPINK;, ;HOTPINK1;, ;HOTPINK2;, ;HOTPINK3;, ;HOTPINK4;, ;INDIANRED;, ;INDIANRED1;, ;INDIANRED2;, ;INDIANRED3;, ;INDIANRED4;, ;IVORY;, ;IVORY2;, ;IVORY3;, ;IVORY4;, ;KHAKI;, ;KHAKI1;, ;KHAKI2;, ;KHAKI3;, ;KHAKI4;, ;LAVENDER;, ;LAVENDERBLUSH1;, ;LAVENDERBLUSH2;, ;LAVENDERBLUSH3;, ;LAVENDERBLUSH4;, ;LAWNGREEN;, ;LEMONCHIFFON1;, ;LEMONCHIFFON2;, ;LEMONCHIFFON3;, ;LEMONCHIFFON4;, ;LIGHTBLUE;, ;LIGHTBLUE1;, ;LIGHTBLUE2;, ;LIGHTBLUE3;, ;LIGHTBLUE4;, ;LIGHTCORAL;, ;LIGHTCYAN1;, ;LIGHTCYAN2;, ;LIGHTCYAN3;, ;LIGHTCYAN4;, ;LIGHTGOLDENROD;, ;LIGHTGOLDENROD1;, ;LIGHTGOLDENROD2;, ;LIGHTGOLDENROD3;, ;LIGHTGOLDENROD4;, ;LIGHTGOLDENRODYELLOW;, ;LIGHTGRAY;, ;LIGHTPINK;, ;LIGHTPINK1;, ;LIGHTPINK2;, ;LIGHTPINK3;, ;LIGHTPINK4;, ;LIGHTSALMON1;, ;LIGHTSALMON2;, ;LIGHTSALMON3;, ;LIGHTSALMON4;, ;LIGHTSEAGREEN;, ;LIGHTSKYBLUE;, ;LIGHTSKYBLUE1;, ;LIGHTSKYBLUE2;, ;LIGHTSKYBLUE3;, ;LIGHTSKYBLUE4;, ;LIGHTSLATEBLUE;, ;LIGHTSLATEGRAY;, ;LIGHTSTEELBLUE;, ;LIGHTSTEELBLUE1;, ;LIGHTSTEELBLUE2;, ;LIGHTSTEELBLUE3;, ;LIGHTSTEELBLUE4;, ;LIGHTYELLOW;, ;LIGHTYELLOW2;, ;LIGHTYELLOW3;, ;LIGHTYELLOW4;, ;LIMEGREEN;, ;LINEN;, ;MAGENTA1;, ;MAGENTA2;, ;MAGENTA3;, ;MAGENTA4;, ;MAROON;, ;MAROON1;, ;MAROON2;, ;MAROON3;, ;MAROON4;, ;MEDIUMAQUAMARINE;, ;MEDIUMORCHID;, ;MEDIUMORCHID1;, ;MEDIUMORCHID2;, ;MEDIUMORCHID3;, ;MEDIUMORCHID4;, ;MEDIUMPURPLE;, ;MEDIUMPURPLE1;, ;MEDIUMPURPLE2;, ;MEDIUMPURPLE3;, ;MEDIUMPURPLE4;, ;MEDIUMSEAGREEN;, ;MEDIUMSLATEBLUE;, ;MEDIUMSPRINGGREEN;, ;MEDIUMTURQUOISE;, ;MEDIUMVIOLETRED;, ;MIDNIGHTBLUE;, ;MINTCREAM;, ;MISTYROSE;, ;MISTYROSE2;, ;MISTYROSE3;, ;MISTYROSE4;, ;MOCCASIN;, ;NAVAJOWHITE1;, ;NAVAJOWHITE2;, ;NAVAJOWHITE3;, ;NAVAJOWHITE4;, ;NAVYBLUE;, ;OLDLACE;, ;OLIVEDRAB;, ;OLIVEDRAB1;, ;OLIVEDRAB2;, ;OLIVEDRAB3;, ;OLIVEDRAB4;, ;ORANGE;, ;ORANGE1;, ;ORANGE2;, ;ORANGE3;, ;ORANGE4;, ;ORANGERED;, ;ORANGERED1;, ;ORANGERED2;, ;ORANGERED3;, ;ORANGERED4;, ;ORCHID;, ;ORCHID1;, ;ORCHID2;, ;ORCHID3;, ;ORCHID4;, ;PALEGOLDENROD;, ;PALEGREEN;, ;PALEGREEN1;, ;PALEGREEN2;, ;PALEGREEN3;, ;PALEGREEN4;, ;PALETURQUOISE;, ;PALETURQUOISE1;, ;PALETURQUOISE2;, ;PALETURQUOISE3;, ;PALETURQUOISE4;, ;PALEVIOLETRED;, ;PALEVIOLETRED1;, ;PALEVIOLETRED2;, ;PALEVIOLETRED3;, ;PALEVIOLETRED4;, ;PAPAYAWHIP;, ;PEACHPUFF;, ;PEACHPUFF2;, ;PEACHPUFF3;, ;PEACHPUFF4;, ;PERU;, ;PINK;, ;PINK1;, ;PINK2;, ;PINK3;, ;PINK4;, ;PLUM;, ;PLUM1;, ;PLUM2;, ;PLUM3;, ;PLUM4;, ;POWDERBLUE;, ;PURPLE;, ;PURPLE1;, ;PURPLE2;, ;PURPLE3;, ;PURPLE4;, ;RED;, ;RED1;, ;RED2;, ;RED3;, ;RED4;, ;ROSYBROWN;, ;ROSYBROWN1;, ;ROSYBROWN2;, ;ROSYBROWN3;, ;ROSYBROWN4;, ;ROYALBLUE;, ;ROYALBLUE1;, ;ROYALBLUE2;, ;ROYALBLUE3;, ;ROYALBLUE4;, ;SADDLEBROWN;, ;SALMON;, ;SALMON1;, ;SALMON2;, ;SALMON3;, ;SALMON4;, ;SANDYBROWN;, ;SEAGREEN;, ;SEAGREEN1;, ;SEAGREEN2;, ;SEAGREEN3;, ;SEAGREEN4;, ;SEASHELL;, ;SEASHELL2;, ;SEASHELL3;, ;SEASHELL4;, ;BEET;, ;TEAL;, ;SIENNA;, ;SIENNA1;, ;SIENNA2;, ;SIENNA3;, ;SIENNA4;, ;SKYBLUE;, ;SKYBLUE1;, ;SKYBLUE2;, ;SKYBLUE3;, ;SKYBLUE4;, ;SLATEBLUE;, ;SLATEBLUE1;, ;SLATEBLUE2;, ;SLATEBLUE3;, ;SLATEBLUE4;, ;SLATEGRAY1;, ;SLATEGRAY2;, ;SLATEGRAY3;, ;SLATEGRAY4;, ;SLATEGRAY;, ;SNOW;, ;SNOW2;, ;SNOW3;, ;SNOW4;, ;SPRINGGREEN;, ;SPRINGGREEN2;, ;SPRINGGREEN3;, ;SPRINGGREEN4;, ;STEELBLUE;, ;STEELBLUE1;, ;STEELBLUE2;, ;STEELBLUE3;, ;STEELBLUE4;, ;TAN;, ;TAN1;, ;TAN2;, ;TAN3;, ;TAN4;, ;THISTLE;, ;THISTLE1;, ;THISTLE2;, ;THISTLE3;, ;THISTLE4;, ;TOMATO;, ;TOMATO1;, ;TOMATO2;, ;TOMATO3;, ;TOMATO4;, ;TURQUOISE;, ;TURQUOISE1;, ;TURQUOISE2;, ;TURQUOISE3;, ;TURQUOISE4;, ;VIOLET;, ;VIOLETRED;, ;VIOLETRED1;, ;VIOLETRED2;, ;VIOLETRED3;, ;VIOLETRED4;, ;WHEAT;, ;WHEAT1;, ;WHEAT2;, ;WHEAT3;, ;WHEAT4;, ;WHITE;, ;WHITESMOKE;, ;YELLOW;, ;YELLOW1;, ;YELLOW2;, ;YELLOW3;, ;YELLOW4; and ;YELLOWGREEN;**.
-
-
-
-@subsubsection occt_2142243456_445622066311 vunsetcolor
-
-Syntax: vunsetcolor [shapename]
-
-Sets default color for all, selected or named shapes.
-
-@subsubsection occt_2142243456_445622066312 vsettransparency
-
-Syntax: vsettransparency [shapename] coeficient
-
-Sets transparency for all selected or named shapes. The **Coefficient** may be between 0.0 (opaque) and 1.0 (fully transparent). Warning: at 1.0 the shape becomes invisible.
-**Example**
-
-vinit
-box b 10 10 10
-psphere s 20
-vdisplay b s
-vfit
-vsetdispmode 1
-vsettransparency b 0.5
-
-@subsubsection occt_2142243456_445622066313 vunsettransparency
-
-Syntax: vunsettransparency [shapename]
-
-Sets default transparency (0.0) for all selected or named shapes.
-
-@subsubsection occt_2142243456_445622066314 vsetmaterial
-
-Syntax: vsetmaterial [shapename] materialname
-
-Sets material for all selected or named shapes.
-**materialname** is ***BRASS*, *BRONZE*, *COPPER*, *GOLD*, *PEWTER*, *PLASTER*, *PLASTIC*, *SILVER*, *STEEL*, *STONE*, *SHINY_PLASTIC*, *SATIN*, *METALIZED*, *NEON_GNC*, *CHROME*, *ALUMINIUM*, *OBSIDIAN*, *NEON_PHC*, *JADE*.**
-**Example**
-
-vinit
-psphere s 20
-vdisplay s
-vfit
-vsetdispmode 1
-vsetmaterial s JADE
-
-@subsubsection occt_2142243456_445622066315 vunsetmaterial
-
-Syntax: vunsetmaterial [shapename]
-
-Sets default material for all selected or named shapes.
-
-@subsubsection occt_2142243456_445622066316 vsetwidth
-
-Syntax: vsetwidth [shapename] coeficient
-
-Sets width of the edges for all selected or named shapes.
-The **Coefficient** may be between 0.0 and 10.0.
-**Example**
-
-vinit
-box b 10 10 10
-vdisplay b
-vfit
-vsetwidth b 5
-
-@subsubsection occt_2142243456_445622066317 vunsetwidth
-
-Syntax: vunsetwidth [shapename]
-
-Sets default width of edges (0.0) for all selected or named shapes.
-
-@subsubsection occt_2142243456_445622066318 vsetshading
-
-Syntax: vsetshading shapename [coefficient]
-
-Sets deflection coefficient that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008.
-**Example**
-
-vinit
-psphere s 20
-vdisplay s
-vfit
-vsetdispmode 1
-vsetshading s 0.005
-@subsubsection occt_2142243456_445622066319 vunsetshading
-
-Syntax: vunsetshading [shapename]
-
-Sets default deflection coefficient (0.0008) that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008.
-
-@subsubsection occt_2142243456_445622066320 vsetam
-
-Syntax: vsetam [shapename] mode
-
-Activates selection mode for all selected or named shapes.
-**mode** is **0** for **shape** itself, **1** for **vertices**, **2** for **edges**, **3** for **wires**, **4** for **faces**, **5** for **shells**, **6** for **solids**, **7** for **compounds**.
-**Example**
-
-vinit
-box b 10 10 10
-vdisplay b
-vfit
-vsetam b 2
-@subsubsection occt_2142243456_445622066321 vunsetam
-
-Syntax: vunsetam
-
-Deactivates all selection modes for all shapes.
-
-@subsubsection occt_2142243456_445622066322 vdump
-
-Syntax: vdump filename.{png|xwd|bmp}
-
-Extracts the contents of the viewer window to a png, XWD or BMP file.
-
-@subsubsection occt_2142243456_445622066323 vdir
-
-Syntax: vdir
-
-Displays the list of displayed objects.
-
-@subsubsection occt_2142243456_445622066324 vsub
-
-Syntax: vsub 0/1(on/off)[shapename]
-
-Hilights/unhilights named or selected objects which are displayed at neutral state with subintensity color.
-**Example**
-
-vinit
-box b 10 10 10
-psphere s 20
-vdisplay b s
-vfit
-vsetdispmode 1
-vsub b 1
-
-@subsubsection occt_2142243456_445622066325 vardis
-
-Syntax: vardis
-
-Displays active areas (for each activated sensitive entity, one or several 2D bounding boxes are displayed, depending on the implementation of a particular entity).
-
-@subsubsection occt_2142243456_445622066326 varera
-
-Syntax: varera
-
-Erases active areas.
-
-@subsubsection occt_2142243456_445622066327 vsensdis
-
-Syntax: vsensdis
-
-Displays active entities (sensitive entities of one of the standard types corresponding to active selection modes).
-
-Standard entity types are those defined in Select3D package:
- * sensitive box
- * sensitive face
- * sensitive curve
- * sensitive segment
- * sensitive circle
- * sensitive point
- * sensitive triangulation
- * sensitive triangle
-Custom (application-defined) sensitive entity types are not processed by this command.
-
-@subsubsection occt_2142243456_445622066328 vsensera
-
-Syntax: vsensera
-
-Erases active entities.
-
-@subsubsection occt_2142243456_445622066329 vperf
-
-Syntax: vperf shapename 1/0 (Transformation/Loacation) 1/0 (Primitives sensibles ON/OFF)
-
-Tests the animation of an object along a predefined trajectory.
-**Example**
-
-vinit
-box b 10 10 10
-psphere s 20
-vdisplay b s
-vfit
-vsetdispmode 0
-vperf b 1 1
-@subsubsection occt_2142243456_445622066330 vr
-
-Syntax: vr filename
-
-Reads shape from BREP-format file and displays it in the viewer.
-**Example**
-
-vinit
-vr myshape.brep
-@subsubsection occt_2142243456_445622066330331 vstate
-
-Syntax: vstate [name1] … [name n]
-
-Makes a list of the status (**Displayed** or **Not Displayed**) of some selected or named objects.
-
-
-
-@subsection occt_2142243456_4456220663304 AIS viewer – object commands
-
-@subsubsection occt_2142243456_44562206633041 vtrihedron
-
-Syntax: vtrihedron name [X0] [Y0] [Z0] [Zu] [Zv] [Zw] [Xu] [Xv] [Xw]
-
-Creates a new AIS_Trihedron object. If no argument is set, the default trihedron (0XYZ) is created.
-**Example**
-
-vinit
-vtrihedron tr
-
-@subsubsection occt_2142243456_44562206633042 vplanetri
-
-Syntax: vplanetri name
-
-Creates a plane from a trihedron selection.
-
-
-@subsubsection occt_2142243456_44562206633043 vsize
-
-Syntax: vsize [name] [size]
-
-Changes the size of a named or selected trihedron. If the name is not defined: it affects the selected trihedrons otherwise nothing is done. If the value is not defined, it is set to 100 by default.
-**Example**
-
-vinit
-vtrihedron tr1
-vtrihedron tr2 0 0 0 1 0 0 1 0 0
-vsize tr2 400
-
-@subsubsection occt_2142243456_44562206633044 vaxis
-
-Syntax: vaxis name [Xa Ya Za Xb Yb Zb]
-
-Creates an axis. If the values are not defined, an axis is created by interactive selection of two vertices or one edge
-**Example**
-
-vinit
-vtrihedron tr
-vaxis axe1 0 0 0 1 0 0
-
-@subsubsection occt_2142243456_44562206633045 vaxispara
-
-Syntax: vaxispara nom
-
-Creates an axis by interactive selection of an edge and a vertex.
-
-@subsubsection occt_2142243456_44562206633046 vaxisortho
-
-Syntax: vaxisotrho name
-
-Creates an axis by interactive selection of an edge and a vertex. The axis will be orthogonal to the selected edge.
-
-@subsubsection occt_2142243456_44562206633047 vpoint
-
-Syntax: vpoint name [Xa Ya Za]
-
-Creates a point from coordinates. If the values are not defined, a point is created by interactive selection of a vertice or an edge (in the center of the edge).
-**Example**
-
-vinit
-vpoint p 0 0 0
-
-@subsubsection occt_2142243456_44562206633048 vplane
-
-Syntax: vplane name [AxisName] [PointName]
- vplane name [PointName] [PointName] [PointName]
- vplane name [PlaneName] [PointName]
-
-Creates a plane from named or interactively selected entities.
-**Example**
-
-vinit
-vpoint p1 0 50 0
-vaxis axe1 0 0 0 0 0 1
-vtrihedron tr
-vplane plane1 axe1 p1
-
-@subsubsection occt_2142243456_44562206633049 vplanepara
-
-Syntax: vplanepara name
-
-Creates a plane from interactively selected vertex and face.
-
-@subsubsection occt_2142243456_445622066330410 vplaneortho
-
-Syntax: vplaneortho name
-
-Creates a plane from interactive selected face and coplanar edge.
-
-@subsubsection occt_2142243456_445622066330411 vline
-
-Syntax: vline name [PointName] [PointName]
- vline name [Xa Ya Za Xb Yb Zb]
-
-Creates a line from coordinates, named or interactively selected vertices.
-**Example**
-
-vinit
-vtrihedron tr
-vpoint p1 0 50 0
-vpoint p2 50 0 0
-vline line1 p1 p2
-vline line2 0 0 0 50 0 1
-
-@subsubsection occt_2142243456_445622066330412 vcircle
-
-Syntax: vcircle name [PointName PointName PointName IsFilled]
-vcircle name [PlaneName PointName Radius IsFilled]
-
-Creates a circle from named or interactively selected entities. Parameter IsFilled is defined as 0 or 1.
-**Example**
-
-vinit
-vtrihedron tr
-vpoint p1 0 50 0
-vpoint p2 50 0 0
-vpoint p3 0 0 0
-vcircle circle1 p1 p2 p3 1
-
-
-@subsubsection occt_2142243456_445622066330413 vtri2d
-
-Syntax: vtri2d name
-
-Creates a plane with a 2D trihedron from an interactively selected face.
-
-@subsubsection occt_2142243456_445622066330414 vselmode
-
-Syntax: vselmode [object] mode On/Off
-
-Sets the selection mode for an object. If the object value is not defined, the selection mode is set for all displayed objects.
-Value On is defined as 1 and Off – as 0.
-**Example**
-
-vinit
-vpoint p1 0 0 0
-vpoint p2 50 0 0
-vpoint p3 25 40 0
-vtriangle triangle1 p1 p2 p3
-@subsubsection occt_2142243456_445622066330415 vconnect, vconnectsh
-
-Syntax: vconnect name object Xo Yo Zo Xu Xv Xw Zu Zv Zw
- vconnectsh name shape Xo Yo Zo Xu Xv Xw Zu Zv Zw
-
-Creates and displays an object with input location connected to a named entity.
-The difference between these two commands is that the object created by vconnect does not support the selection modes differrent from 0.
-**Example**
-
-Vinitvinit
-vpoint p1 0 0 0
-vpoint p2 50 0 0
-vsegment segment p1 p2
-restore CrankArm.brep obj
-vdisplay obj
-vconnectsh new obj 100100100 1 0 0 0 0 1
-
-
-
-@subsubsection occt_2142243456_445622066330416 vtriangle
-
-Syntax: vtriangle name PointName PointName PointName
-
-Creates and displays a filled triangle from named points.
-**Example**
-
-vinit
-vpoint p1 0 0 0
-vpoint p2 50 0 0
-vpoint p3 25 40 0
-vtriangle triangle1 p1 p2 p3
-
-@subsubsection occt_2142243456_445622066330417 vsegment
-
-Syntax: vsegment name PointName PointName
-
-Creates and displays a segment from named points.
-**Example**
-
-Vinit
-vpoint p1 0 0 0
-vpoint p2 50 0 0
-vsegment segment p1 p2
-
-
-**MeshVS **(Mesh Visualization Service) component provides flexible means of displaying meshes with associated pre- and post- processor data.
-
-
-
-@subsection occt_2142243456_4456220663305 AIS viewer – Mesh Visualization Service
-
-@subsubsection occt_2142243456_44562206633051 meshfromstl
-
-Syntax: meshfromstl meshname file
-
-Creates a MeshVS_Mesh object based on STL file data. The object will be displayed immediately.
-**Example**
-
-meshfromstl mesh myfile.stl
-
-@subsubsection occt_2142243456_44562206633052 meshdispmode
-
-Syntax: meshdispmode meshname displaymode
-
-Changes the display mode of object **meshname**. The **displaymode** is integer, which can be **1** (for wireframe), **2** (for shading mode) or **3** (for shrink mode).
-**Example**
-
-vinit
-meshfromstl mesh myfile.stl
-meshdispmode mesh 2
-
-@subsubsection occt_2142243456_44562206633053 meshselmode
-
-Syntax: meshselmode meshname selectionmode
-
-Changes the selection mode of object **meshname**. The **selectionmode** is integer OR-combination of mode flags. The basic flags are the following:
-**1** – node selection,
-**2** – 0D elements (not suppored in STL)
-**4** – links (not supported in STL)
-**8** – faces
-**Example**
-
-vinit
-meshfromstl mesh myfile.stl
-meshselmode mesh 1
-
-@subsubsection occt_2142243456_44562206633054 meshshadcolor
-
-Syntax: meshshadcolor meshname red green blue
-
-Changes the face interior color of object **meshname**. The **red**, **green** and **blue** are real values between **0** and **1**.
-**Example**
-
-vinit
-meshfromstl mesh myfile.stl
-meshshadcolormode mesh 0.5 0.5 0.5
-
-@subsubsection occt_2142243456_44562206633055 meshlinkcolor
-
-Syntax: meshlinkcolor meshname red green blue
-
-Changes the color of face borders for object **meshname**. The **red**, **green** and **blue** are real values between **0** and **1**.
-**Example**
-
-vinit
-meshfromstl mesh myfile.stl
-meshlinkcolormode mesh 0.5 0.5 0.5
-
-@subsubsection occt_2142243456_44562206633056 meshmat
-
-Syntax: meshmat meshname material
-
-Changes the material of object **meshname**. **material** is represented with an integer value as follows (equivalent to enumeration Graphic3d_NameOfMaterial):
-**0 – BRASS,**
-**1 – BRONZE,**
-**2 - COPPER,**
-**3 - GOLD,**
-**4 - PEWTER,**
-**5 - PLASTER,**
-**6 - PLASTIC,**
-**7 - SILVER,**
-**8 - STEEL,**
-**9 - STONE,**
-**10 - SHINY_PLASTIC,**
-**11 - SATIN,**
-**12 - METALIZED,**
-**13 - NEON_GNC,**
-**14 - CHROME,**
-**15 - ALUMINIUM,**
-**16 - OBSIDIAN,**
-**17 - NEON_PHC,**
-**18 - JADE,**
-**19 - DEFAULT,**
-**20 - UserDefined**
-**Example**
-
-vinit
-meshfromstl mesh myfile.stl
-meshmat mesh JADE
-
-@subsubsection occt_2142243456_44562206633057 meshshrcoef
-
-Syntax: meshshrcoef meshname shrinkcoefficient
-
-Changes the value of shrink coefficient used in the shrink mode. In the shrink mode the face is shown as a congruent part of a usual face, so that **shrinkcoefficient** controls the value of this part. The **shrinkcoefficient** is a positive real number.
-**Example**
-
-vinit
-meshfromstl mesh myfile.stl
-meshshrcoef mesh 0.05
-
-@subsubsection occt_2142243456_44562206633058 meshshow
-
-Syntax: meshshow meshname
-
-Displays **meshname** in the viewer (if it is erased).
-**Example**
-
-vinit
-meshfromstl mesh myfile.stl
-meshshow mesh
-
-@subsubsection occt_2142243456_44562206633059 meshhide
-
-Syntax: meshhide meshname
-
-Hides **meshname** in the viewer.
-**Example**
-
-vinit
-meshfromstl mesh myfile.stl
-meshhide mesh
-
-@subsubsection occt_2142243456_445622066330510 meshhidesel
-
-Syntax: meshhidesel meshname
-
-Hides only selected entities. The other part of **meshname** remains visible.
-
-@subsubsection occt_2142243456_445622066330511 meshshowsel
-
-Syntax: meshshowsel meshname
-
-Shows only selected entities. The other part of **meshname** becomes invisible.
-
-@subsubsection occt_2142243456_445622066330512 meshshowall
-
-Syntax: meshshowall meshname
-
-Changes the state of all entities to visible for **meshname**.
-
-@subsubsection occt_2142243456_445622066330513 meshdelete
-
-Syntax: meshdelete meshname
-
-Deletes MeshVS_Mesh object **meshname**.
-**Example**
-
-vinit
-meshfromstl mesh myfile.stl
-meshdelete mesh
-
-
-
-
-@subsection occt_2142243456_4456220663306 AIS viewer – 2D viewer – view commands
-
-@subsubsection occt_2142243456_44562206633061 v2dinit
-
-Syntax: v2dinit
-
-**v2dinit **creates the 2D viewer window.
-
-@subsubsection occt_2142243456_44562206633062 v2dsetbg
-
-Syntax: v2dsetbg imagefile [filletype]
-
-**v2dsetbg** loads **imagefile** as background. **filletype** is **NONE**, **CENTERED**, **TILED**, **STRETCH**.
-**Example**
-
-v2dinit
-v2dsetbg myimage.brep CENTERED
-
-@subsubsection occt_2142243456_44562206633063 v2dfit
-
-Syntax: v2dfit
-
-Fits all shapes to the size of the window.
-
-@subsubsection occt_2142243456_44562206633064 v2drepaint
-
-Syntax: v2drepaint
-
-Forcedly repaints all shapes.
-
-@subsubsection occt_2142243456_44562206633065 v2dclear
-
-Syntax: v2dclear
-
-Clears the 2D viewer window
-
-@subsubsection occt_2142243456_44562206633066 v2dtext
-
-Syntax: v2dtext text x y [angle scale fontindex]
-
-Creates a new object with the name **text_i** (i – integer value) and displays **text** at the position** x**, **y.** The text can be displayed at a certain **angle**, on a certain **scale** and with a certain **fontindex**.
-Default values are: **angle=0.0, scale=1.0, fontindex=0**.
-**Example**
-
-v2dinit
-v2dtext *My text* 10 10
-@subsubsection occt_2142243456_44562206633067 v2dsettextcolor
-
-Syntax: v2dsettextcolor text_name colorindex
-
-Changes the color of **text_name** object (**name** must be an integer value).
-**Example**
-
-v2dinit
-v2dtext *My text* 10 10
-# Change color to red
-v2dsettextcolor text_0 3
-@subsubsection occt_2142243456_44562206633068 v2dpick
-
-Syntax: v2dpick
-
-Displays mouse coordinates and color after clicking the mouse button in the 2D viewer window.
-
-
-@subsubsection occt_2142243456_44562206633069 v2dgrid
-
-Syntax: v2dgrid [type x y xstep ystep angle [drawmode]]
- v2dgrid [type x y radiusstep division angle [drawmode]]
-
-Loads a grid in the 2D viewer window.
-**type** is **Rect** or **Circ**.
-**drawmode** is **Lines**, **Points** or **None**.
-**Example**
-
-v2dinit
-v2dgrid Circ 0 0 250 12 0 Lines
-v2drmgrid
-v2dgrid Rect 0 0 200 200 0 Lines
-@subsubsection occt_2142243456_445622066330610 v2rmgrid
-
-Syntax: v2rmgrid
-
-Unloads a grid from the window.
-
-@subsubsection occt_2142243456_445622066330611 v2dpickgrid
-
-Syntax: v2dpickgrid [mouse_x mouse_y [grid_x grid_y]]
-
-Gets coordinates of a grid point near the mouse button click in the 2D viewer window and sets it to **grid_x**, **grid_y** variables.
-
-@subsubsection occt_2142243456_445622066330612 v2dpsout
-
-Syntax: v2dpsout imagefile [scale colorspace]
- [width height [xcenter ycenter]]
-
-Exports **imagefile**. You can set its the scale, width, height and colorspace.
-**colorspace** can be **RGB, BlackAndWhite, GreyScale**.
-
-@subsubsection occt_2142243456_445622066330612613 v2ddir
-
-Syntax: v2ddir
-
-Makes aLlist of the displayed objects.
-
-
-@subsection occt_2142243456_4456220663306127 Ais viewer – 2D viewer – display commands
-
-@subsubsection occt_2142243456_44562206633061271 v2ddisplay
-
-Syntax: v2ddisplay name [projection]
-
-Projection: origin_x origin_y origin_z normal_x normal_y normal_z dx_x dx_y dx_z.
-
-Displays named objects.
-**Example**
-
-v2dinit
-box b 10 10 10
-psphere s 20
-v2ddisplay s
-v2ddisplay b
-v2dfit
-@subsubsection occt_2142243456_44562206633061272 v2ddonly
-
-Syntax: v2ddonly [name1] … [name n]
-
-Displays only selected or named objects. If there are no selected or named objects, nothing is done.
-**Example**
-
-v2dinit
-box b 10 10 10
-psphere s 20
-v2ddisplay b
-v2ddisplay s
-v2ddonly s
-v2dfit
-@subsubsection occt_2142243456_44562206633061273 v2ddisplayall
-
-Syntax: v2ddisplayall
-
-Displays all created objects.
-**Example**
-
-v2dinit
-box b 10 10 10
-psphere s 20
-v2ddisplay b
-v2ddisplay s
-v2ddonly
-v2ddisplayall
-v2dfit
-@subsubsection occt_2142243456_44562206633061274 v2derase
-
-Syntax: v2derase name1 [name2] … [name n]
-
-Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased.
-**Example**
-
-v2dinit
-box b 10 10 10
-psphere s 20
-v2ddisplay b
-v2ddisplay s
-v2derase b
-v2dfit
-@subsubsection occt_2142243456_44562206633061275 v2deraseall
-
-Syntax: v2deraseall
-
-Erases all objects displayed in the viewer.
-**Example**
-
-v2dinit
-box b 10 10 10
-psphere s 20
-v2ddisplay b
-v2ddisplay s
-v2deraseall
-v2dfit
-@subsubsection occt_2142243456_44562206633061276 v2dsetcolor
-
-Syntax: v2dsetcolor [shapename] colorname
-
-Sets color for all, selected or named shapes.
-Values of **colorname** see **vsetcolor**.
-**Example**
-
-v2dinit
-box b 10 10 10
-v2ddisplay b
-v2ddisplay s
-v2dsetcolor b RED
-v2dfit
-@subsubsection occt_2142243456_44562206633061277 v2dunsetcolor
-
-Syntax: v2dunsetcolor [shapename]
-
-Sets default color for all, selected or named shapes.
-**Example**
-
-v2dinit
-box b 10 10 10
-v2ddisplay b
-v2ddisplay s
-v2dsetcolor RED
-v2dunsetcolor b
-v2dfit
-@subsubsection occt_2142243456_44562206633061278 v2dsetbgcolor
-
-Syntax: v2dsetbgcolor colorname
-
-Sets background color.
-See **vsetcolor** for the values of **colorname.**.
-**Example**
-
-v2dinit
-box b 10 10 10
-v2ddisplay b
-v2ddisplay s
-v2dsetbgcolor RED
-v2dfit
-@subsubsection occt_2142243456_44562206633061279 v2dsetwidth
-
-Syntax: v2dsetwidth [shapename] widthenum
-
-Set width of the edges for all, selected or named shapes.
-**widthenum** may be one of: **THIN, MEDIUM, THICK, VERYTHICK**.
-**Example**
-
-v2dinit
-box b 10 10 10
-v2ddisplay b
-v2ddisplay s
-v2dsetwidth b THICK
-v2dfit
-@subsubsection occt_2142243456_445622066330612710 v2dunsetwidth
-
-Syntax: vunsetwidth [shapename]
-
-Sets default width of the edges for all, selected or named shapes.
-**Example**
-
-v2dinit
-box b 10 10 10
-v2ddisplay b
-v2ddisplay s
-v2dsetwidth THICK
-v2dunsetwidth b
-v2dfit
-
-@section occt_2142243456_930384826 OCAF commands
-
-
-This chapter contains a set of commands for Open CASCADE Technology Application Framework (OCAF).
-
-
-@subsection occt_2142243456_9303848261 Application commands
-
-
-@subsubsection occt_2142243456_93038482611 NewDocument
-
-Syntax: NewDocument docname [format]
-
-Creates a new **docname** document with MDTV-Standard or described format.
-**Example**
-
-# Create new document with default (MDTV-Standard) format
-NewDocument D
-
-# Create new document with BinOcaf format
-NewDocument D2 BinOcaf
-
-@subsubsection occt_2142243456_93038482612 IsInSession
-
-Syntax: IsInSession path
-
-**I**Returns **0**, if **path** document is managed by the application session, **1** – otherwise.
-**Example**
-
-IsInSession /myPath/myFile.std
-
-@subsubsection occt_2142243456_93038482613 ListDocuments
-
-Syntax: ListDocuments
-
-Makes a list of documents handled during the session of the application.
-
-
-@subsubsection occt_2142243456_93038482614 Open
-
-Syntax: Open path docname
-
-Retrieves the document of file **docname** in the path **path**. Overwrites the document, if it is already in session.
-**Example**
-
-Open /myPath/myFile.std D
-
-@subsubsection occt_2142243456_93038482615 Close
-
-Syntax: Close docname
-
-Closes **docname** document. The document is no longer handled by the applicative session.
-**Example**
-
-Close D
-
-@subsubsection occt_2142243456_93038482616 Save
-
-Syntax: Save docname
-
-Saves **docname** active document.
-**Example**
-
-Save D
-
-@subsubsection occt_2142243456_93038482617 SaveAs
-
-Syntax: SaveAs docname path
-
-Saves the active document in the file **docname** in the path **path**. Overwrites the file if it already exists.
-**Example**
-
-SaveAs D /myPath/myFile.std
-
-@subsection occt_2142243456_9303848262 Basic commands
-
-
-@subsubsection occt_2142243456_930384826521 Label
-
-Syntax: Label docname entry
-
-Creates the label expressed by **entry** if it does not exist.
-**Example**
-
-Label D 0:2
-
-@subsubsection occt_2142243456_930384826522 NewChild
-
-Syntax: NewChild docname [taggerlabel = Root label]
-
-Finds (or creates) a TagSource attribute located at father label of **taggerlabel** and makes a new child label.
-**Example**
-
-# Create new child of root label
-NewChild D
-
-# Create new child of existing label
-Label D 0:2
-NewChild D 0:2
-
-@subsubsection occt_2142243456_930384826523 Children
-
-Syntax: Children docname label
-
-Returns the list of attributes of **label**.
-**Example**
-
-Children D 0:2
-
-@subsubsection occt_2142243456_930384826524 ForgetAll
-
-Syntax: ForgetAll docname label
-
-Forgets all attributes of the label.
-**Example**
-
-ForgetAll D 0:2
-
-@subsection occt_2142243456_93038482653 Application commands
-
-
-@subsubsection occt_2142243456_930384826531 Main
-
-Syntax: Main docname
-
-Returns the main label of the framework.
-**Example**
-
-Main D
-
-@subsubsection occt_2142243456_930384826532 UndoLimit
-
-Syntax: UndoLimit docname [value=0]
-
-
-Sets the limit on the number of Undo Delta stored. 0 will disable Undo on the document. A negative **value** means that there is no limit. Note that by default Undo is disabled. Enabling it will take effect with the next call to NewCommand. Of course, this limit is the same for Redo
-**Example**
-
-UndoLimit D 100
-
-@subsubsection occt_2142243456_930384826533 Undo
-
-Syntax: Undo docname [value=1]
-
-Undoes **value** steps.
-**Example**
-
-Undo D
-
-@subsubsection occt_2142243456_930384826534 Redo
-
-Syntax: Redo docname [value=1]
-
-Redoes **value** steps.
-**Example**
-
-Redo D
-
-@subsubsection occt_2142243456_930384826535 OpenCommand
-
-Syntax: OpenCommand docname
-
-Opens a new command transaction.
-**Example**
-
-OpenCommand D
-
-@subsubsection occt_2142243456_930384826536 CommitCommand
-
-Syntax: CommitCommand docname
-
-Commits the Command transaction.
-**Example**
-
-CommitCommand D
-
-@subsubsection occt_2142243456_930384826537 NewCommand
-
-Syntax: NewCommand docname
-
-This is a short-cut for Commit and Open transaction.
-**Example**
-
-NewCommand D
-
-@subsubsection occt_2142243456_930384826538 AbortCommand
-
-Syntax: AbortCommand docname
-
-Aborts the Command transaction.
-**Example**
-
-AbortCommand D
-
-@subsubsection occt_2142243456_930384826539 Copy
-
-Syntax: Copy docname entry Xdocname Xentry
-
-Copies the contents of **entry** to **Xentry**. No links are registred.
-**Example**
-
-Copy D1 0:2 D2 0:4
-
-@subsubsection occt_2142243456_9303848265310 UpdateLink
-
-Syntax: UpdateLink docname [entry]
-
-Updates external reference set at **entry**.
-**Example**
-
-UpdateLink D
-
-@subsubsection occt_2142243456_9303848265311 CopyWithLink
-
-Syntax: CopyWithLink docname entry Xdocname Xentry
-
-Aborts the Command transaction.
-Copies the content of **entry** to **Xentry**. The link is registred with an Xlink attribute at ** Xentry** label.
-**Example**
-
-CopyWithLink D1 0:2 D2 0:4
-
-@subsubsection occt_2142243456_9303848265312 UpdateXLinks
-
-Syntax: UpdateXLinks docname entry
-
-Sets modifications on labels impacted by external references to the **entry**. The **document** becomes invalid and must be recomputed
-**Example**
-
-UpdateXLinks D 0:2
-
-@subsubsection occt_2142243456_9303848265313 DumpDocument
-
-Syntax: DumpDocument docname
-
-Displays parameters of **docname** document.
-**Example**
-
-DumpDocument D
-
-@subsection occt_2142243456_93038482654 Data Framework commands
-
-
-@subsubsection occt_2142243456_930384826541 MakeDF
-
-Syntax: MakeDF dfname
-
-Creates a new data framework.
-**Example**
-
-MakeDF D
-
-@subsubsection occt_2142243456_930384826542 ClearDF
-
-Syntax: ClearDF dfname
-
-Clears a data framework.
-**Example**
-
-ClearDF D
-
-@subsubsection occt_2142243456_930384826543 CopyDF
-
-Syntax: CopyDF dfname1 entry1 [dfname2] entry2
-
-Copies a data framework.
-**Example**
-
-CopyDF D 0:2 0:4
-
-@subsubsection occt_2142243456_930384826544 CopyLabel
-
-Syntax: CopyLabel dfname fromlabel tolablel
-
-Copies a label.
-**Example**
-
-CopyLabel D1 0:2 0:4
-
-@subsubsection occt_2142243456_930384826545 MiniDumpDF
-
-Syntax: MiniDumpDF dfname
-
-Makes a mini-dump of a data framework.
-**Example**
-
-MiniDumpDF D
-
-@subsubsection occt_2142243456_930384826546 XDumpDF
-
-Syntax: XDumpDF dfname
-
-Makes an extended dump of a data framework.
-**Example**
-
-XDumpDF D
-
-@subsection occt_2142243456_93038482655 General attributes commands
-
-
-@subsubsection occt_2142243456_930384826551 SetInteger
-
-Syntax: SetInteger dfname entry value
-
-Finds or creates an Integer attribute at **entry** label and sets **value**.
-**Example**
-
-SetInteger D 0:2 100
-
-@subsubsection occt_2142243456_930384826552 GetInteger
-
-Syntax: GetInteger dfname entry [drawname]
-
-Gets a value of an Integer attribute at **entry** label and sets it to **drawname** variable, if it is defined.
-**Example**
-
-GetInteger D 0:2 Int1
-
-@subsubsection occt_2142243456_930384826553 SetReal
-
-Syntax: SetReal dfname entry value
-
-Finds or creates a Real attribute at **entry** label and sets **value**.
-**Example**
-
-SetReal D 0:2 100.
-
-@subsubsection occt_2142243456_930384826554 GetReal
-
-Syntax: GetReal dfname entry [drawname]
-
-Gets a value of a Real attribute at **entry** label and sets it to **drawname** variable, if it is defined.
-**Example**
-
-GetReal D 0:2 Real1
-
-@subsubsection occt_2142243456_930384826555 SetIntArray
-
-Syntax: SetIntArray dfname entry lower upper value1 value2 …
-
-Finds or creates an IntegerArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…**
-**Example**
-
-SetIntArray D 0:2 1 4 100 200 300 400
-
-@subsubsection occt_2142243456_930384826556 GetIntArray
-
-Syntax: GetIntArray dfname entry
-
-Gets a value of an IntegerArray attribute at **entry** label.
-**Example**
-
-GetIntArray D 0:2
-
-@subsubsection occt_2142243456_930384826557 SetRealArray
-
-Syntax: SetRealArray dfname entry lower upper value1 value2 …
-
-Finds or creates a RealArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…**
-**Example**
-
-GetRealArray D 0:2 1 4 100. 200. 300. 400.
-
-@subsubsection occt_2142243456_930384826558 GetRealArray
-
-Syntax: GetRealArray dfname entry
-
-Gets a value of a RealArray attribute at **entry** label.
-**Example**
-
-GetRealArray D 0:2
-
-@subsubsection occt_2142243456_930384826559 SetComment
-
-Syntax: SetComment dfname entry value
-
-Finds or creates a Comment attribute at **entry** label and sets **value**.
-**Example**
-
-SetComment D 0:2 *My comment*
-
-@subsubsection occt_2142243456_9303848265510 GetComment
-
-Syntax: GetComment dfname entry
-
-Gets a value of a Comment attribute at **entry** label.
-**Example**
-
-GetComment D 0:2
-
-@subsubsection occt_2142243456_9303848265511 SetExtStringArray
-
-Syntax: SetExtStringArray dfname entry lower upper value1 value2 …
-
-Finds or creates an ExtStringArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…**
-**Example**
-
-SetExtStringArray D 0:2 1 3 *string1* *string2* *string3*
-
-@subsubsection occt_2142243456_9303848265512 GetExtStringArray
-
-Syntax: GetExtStringArray dfname entry
-
-Gets a value of an ExtStringArray attribute at **entry** label.
-**Example**
-
-GetExtStringArray D 0:2
-
-@subsubsection occt_2142243456_9303848265513 SetName
-
-Syntax: SetName dfname entry value
-
-Finds or creates a Name attribute at **entry** label and set **value**.
-**Example**
-
-SetName D 0:2 *My name*
-
-@subsubsection occt_2142243456_9303848265514 GetName
-
-Syntax: GetName dfname entry
-
-Gets a value of a Name attribute at **entry** label.
-**Example**
-
-GetName D 0:2
-
-@subsubsection occt_2142243456_9303848265515 SetReference
-
-Syntax: SetReference dfname entry reference
-
-Creates a Reference attribute at **entry** label and sets **reference**.
-**Example**
-
-SetReference D 0:2 0:4
-
-@subsubsection occt_2142243456_9303848265516 GetReference
-
-Syntax: GetReference dfname entry
-
-Gets a value of a Reference attribute at **entry** label.
-**Example**
-
-GetReference D 0:2
-
-@subsubsection occt_2142243456_9303848265517 SetUAttribute
-
-Syntax: SetUAttribute dfname entry localGUID
-
-Creates a UAttribute attribute at **entry** label with **localGUID**.
-**Example**
-
-set localGUID *c73bd076-22ee-11d2-acde-080009dc4422*
-SetUAttribute D 0:2 ${localGUID}
-
-@subsubsection occt_2142243456_9303848265518 GetUAttribute
-
-Syntax: GetUAttribute dfname entry loacalGUID
-
-Finds a UAttribute at **entry** label with **localGUID**.
-**Example**
-
-set localGUID *c73bd076-22ee-11d2-acde-080009dc4422*
-GetUAttribute D 0:2 ${localGUID}
-
-@subsubsection occt_2142243456_9303848265519 SetFunction
-
-Syntax: SetFunction dfname entry ID failure
-
-Finds or creates a Function attribute at **entry** label with driver ID and **failure** index.
-**Example**
-
-set ID *c73bd076-22ee-11d2-acde-080009dc4422*
-SetFunction D 0:2 ${ID} 1
-
-@subsubsection occt_2142243456_9303848265520 GetFunction
-
-Syntax: GetFunction dfname entry ID failure
-
-Finds a Function attribute at **entry** label and sets driver ID to **ID** variable and failure index to **failure** variable.
-**Example**
-
-GetFunction D 0:2 ID failure
-
-@subsubsection occt_2142243456_9303848265521 NewShape
-
-Syntax: NewShape dfname entry [shape]
-
-
-Finds or creates a Shape attribute at **entry** label. Creates or updates the associated NamedShape attribute by **shape** if **shape** is defined.
-**Example**
-
-box b 10 10 10
-NewShape D 0:2 b
-
-@subsubsection occt_2142243456_9303848265522 SetShape
-
-Syntax: SetShape dfname entry shape
-
-Creates or updates a NamedShape attribute at **entry** label by **shape**.
-**Example**
-
-box b 10 10 10
-SetShape D 0:2 b
-
-@subsubsection occt_2142243456_9303848265523 GetShape
-
-Syntax: GetShape2 dfname entry shape
-
-Sets a shape from NamedShape attribute associated with **entry** label to **shape** draw variable.
-**Example**
-
-GetShape2 D 0:2 b
-
-@subsection occt_2142243456_93038482656 Geometric attributes commands
-
-
-@subsubsection occt_2142243456_930384826561 SetPoint
-
-Syntax: SetPoint dfname entry point
-
-Finds or creates a Point attribute at **entry** label and sets **point** as generated in the associated NamedShape attribute.
-**Example**
-
-point p 10 10 10
-SetPoint D 0:2 p
-
-@subsubsection occt_2142243456_930384826562 GetPoint
-
-Syntax: GetPoint dfname entry [drawname]
-
-Gets a vertex from NamedShape attribute at **entry** label and sets it to **drawname** variable, if it is defined.
-**Example**
-
-GetPoint D 0:2 p
-
-@subsubsection occt_2142243456_930384826563 SetAxis
-
-Syntax: SetAxis dfname entry axis
-
-Finds or creates an Axis attribute at **entry** label and sets **axis** as generated in the associated NamedShape attribute.
-**Example**
-
-line l 10 20 30 100 200 300
-SetAxis D 0:2 l
-
-@subsubsection occt_2142243456_930384826564 GetAxis
-
-Syntax: GetAxis dfname entry [drawname]
-
-Gets a line from NamedShape attribute at **entry** label and sets it to **drawname** variable, if it is defined.
-**Example**
-
-GetAxis D 0:2 l
-
-@subsubsection occt_2142243456_930384826565 SetPlane
-
-Syntax: SetPlane dfname entry plane
-
-Finds or creates a Plane attribute at **entry** label and sets **plane** as generated in the associated NamedShape attribute.
-**Example**
-
-plane pl 10 20 30 –1 0 0
-SetPlane D 0:2 pl
-
-@subsubsection occt_2142243456_930384826566 GetPlane
-
-Syntax: GetPlane dfname entry [drawname]
-
-Gets a plane from NamedShape attribute at **entry** label and sets it to **drawname** variable, if it is defined.
-**Example**
-
-GetPlane D 0:2 pl
-
-@subsubsection occt_2142243456_930384826567 SetGeometry
-
-Syntax: SetGeometry dfname entry [type] [shape]
-
-
-Creates a Geometry attribute at **entry** label and sets **type** and **shape** as generated in the associated NamedShape attribute if they are defined. **type** must be one of the following: **any/pnt/lin/cir/ell/spl/pln/cyl**.
-**Example**
-
-point p 10 10 10
-SetGeometry D 0:2 pnt p
-
-@subsubsection occt_2142243456_930384826568 GetGeometryType
-
-Syntax: GetGeometryType dfname entry
-
-Gets a geometry type from Geometry attribute at **entry** label.
-**Example**
-
-GetGeometryType D 0:2
-
-@subsubsection occt_2142243456_930384826569 SetConstraint
-
-Syntax: SetConstraint dfname entry keyword geometrie [geometrie …]
- SetConstraint dfname entry *plane* geometrie
- SetConstraint dfname entry *value* value
-
-1. Creates a Constraint attribute at **entry** label and sets **keyword** constraint between geometry(ies).
-**keyword** must be one of the following:
-**rad/dia/minr/majr/tan/par/perp/concentric/equal/dist/angle/eqrad/symm/midp/ eqdist/fix/rigid**
-or
-**from/axis/mate/alignf/aligna/axesa/facesa/round/offset**
-
-2. Sets plane for the existing constraint.
-
-3. Sets value for the existing constraint.
-**Example**
-
-SetConstraint D 0:2 *value* 5
-
-@subsubsection occt_2142243456_9303848265610 GetConstraint
-
-Syntax: GetConstraint dfname entry
-
-Dumps a Constraint attribute at **entry** label
-**Example**
-
-GetConstraint D 0:2
-
-@subsubsection occt_2142243456_9303848265611 SetVariable
-
-Syntax: SetVariable dfname entry isconstant(0/1) units
-
-Creates a Variable attribute at **entry** label and sets **isconstant** flag and **units** as a string.
-**Example**
-
-SetVariable D 0:2 1 *mm*
-
-@subsubsection occt_2142243456_9303848265612 GetVariable
-
-Syntax: GetVariable dfname entry isconstant units
-
-Gets an **isconstant** flag and **units** of a Variable attribute at **entry** label.
-**Example**
-
-GetVariable D 0:2 isconstant units
-puts *IsConstant=${isconstant}*
-puts *Units=${units}*
-
-
-@subsection occt_2142243456_93038482657 Tree attributes commands
-
-
-@subsubsection occt_2142243456_930384826571 RootNode
-
-Syntax: RootNode dfname treenodeentry [ID]
-
-Returns ultimate father of TreeNode attribute identified by its **treenodeentry** and its **ID** (or default ID, if **ID** is not defined).
-
-
-@subsubsection occt_2142243456_930384826572 SetNode
-
-Syntax: SetNode dfname treenodeentry [ID]
-
-Creates a TreeNode attribute on the **treenodeentry** label with its tree **ID** (or assigns a default ID, if the **ID** is not defined).
-
-
-@subsubsection occt_2142243456_930384826573 AppendNode
-
-Syntax: AppendNode dfname fatherentry childentry [fatherID]
-
-
-Inserts a TreeNode attribute with its tree **fatherID** (or default ID, if **fatherID** is not defined) on **childentry** as last child of **fatherentry**.
-
-
-
-
-@subsubsection occt_2142243456_930384826574 PrependNode
-
-Syntax: PrependNode dfname fatherentry childentry [fatherID]
-
-
-Inserts a TreeNode attribute with its tree **fatherID** (or default ID, if **fatherID** is not defined) on **childentry** as first child of **fatherentry**.
-
-
-@subsubsection occt_2142243456_930384826575 InsertNodeBefore
-
-Syntax: InsertNodeBefore dfname treenodeentry beforetreenode [ID]
-
-Inserts a TreeNode attribute with tree **ID** (or default ID, if **ID** is not defined) **beforetreenode** before **treenodeentry**.
-
-
-@subsubsection occt_2142243456_930384826576 InsertNodeAfter
-
-Syntax: InsertNodeAfter dfname treenodeentry aftertreenode [ID]
-
-Inserts a TreeNode attribute with tree **ID** (or default ID, if **ID** is not defined) **aftertreenode** after **treenodeentry**.
-
-
-@subsubsection occt_2142243456_930384826577 DetachNode
-
-Syntax: DetachNode dfname treenodeentry [ID]
-
-Removes a TreeNode attribute with tree **ID** (or default ID, if **ID** is not defined) from **treenodeentry**.
-
-
-@subsubsection occt_2142243456_930384826578 ChildNodeIterate
-
-Syntax: ChildNodeIterate dfname treenodeentry alllevels(0/1) [ID]
-
-
-Iterates on the tree of TreeNode attributes with tree **ID** (or default ID, if **ID** is not defined). If **alllevels** is set to **1** it explores not only the first, but all the sub Step levels.
-**Example**
-
-Label D 0:2
-Label D 0:3
-Label D 0:4
-Label D 0:5
-Label D 0:6
-Label D 0:7
-Label D 0:8
-Label D 0:9
-
-# Set root node
-SetNode D 0:2
-
-AppendNode D 0:2 0:4
-AppendNode D 0:2 0:5
-PrependNode D 0:4 0:3
-PrependNode D 0:4 0:8
-PrependNode D 0:4 0:9
-
-InsertNodeBefore D 0:5 0:6
-InsertNodeAfter D 0:4 0:7
-
-DetachNode D 0:8
-
-
-# List all levels
-ChildNodeIterate D 0:2 1
-
-==0:4
-==0:9
-==0:3
-==0:7
-==0:6
-==0:5
-
-
-# List only first levels
-ChildNodeIterate D 0:2 1
-
-==0:4
-==0:7
-==0:6
-==0:5
-
-@subsubsection occt_2142243456_930384826579 InitChildNodeIterator
-
-Syntax: InitChildNodeIterator dfname treenodeentry alllevels(0/1) [ID]
-
-
-Initializes the iteration on the tree of TreeNode attributes with tree **ID** (or default ID, if **ID** is not defined). If **alllevels** is set to **1** it explores not only the first, but also all sub Step levels.
-**Example**
-
-InitChildNodeIterate D 0:5 1
-set aChildNumber 0
-for {set i 1} {$i 100} {incr i} {
- if {[ChildNodeMore] == *TRUE*} {
- puts *Tree node = [ChildNodeValue]*
- incr aChildNumber
- ChildNodeNext
- }
-}
-puts *aChildNumber=$aChildNumber*
-
-@subsubsection occt_2142243456_9303848265710 ChildNodeMore
-
-Syntax: ChildNodeMore
-
-Returns TRUE if there is a current item in the iteration.
-
-
-@subsubsection occt_2142243456_9303848265711 ChildNodeNext
-
-Syntax: ChildNodeNext
-
-Moves to the next Item.
-
-
-@subsubsection occt_2142243456_9303848265712 ChildNodeValue
-
-Syntax: ChildNodeValue
-
-Returns the current treenode of ChildNodeIterator.
-
-
-@subsubsection occt_2142243456_9303848265713 ChildNodeNextBrother
-
-Syntax: ChildNodeNextBrother
-
-Moves to the next Brother. If there is none, goes up. This method is interesting only with ;allLevels; behavior.
-
-
-@subsection occt_2142243456_93038482658 Standard presentation commands
-
-
-@subsubsection occt_2142243456_930384826581 AISInitViewer
-
-Syntax: AISInitViewer docname
-
-Creates and sets AISViewer attribute at root label, creates AIS viewer window.
-**Example**
-
-AISInitViewer D
-
-@subsubsection occt_2142243456_930384826582 AISRepaint
-
-Syntax: AISRepaint docname
-
-Updates the AIS viewer window.
-**Example**
-
-AISRepaint D
-
-@subsubsection occt_2142243456_930384826583 AISDisplay
-
-Syntax: AISDisplay docname entry [not_update]
-
-
-Displays a presantation of AISobject from **entry** label in AIS viewer. If **not_update** is not defined then AISobject is recomputed and all visualization settings are applied.
-**Example**
-
-AISDisplay D 0:5
-
-@subsubsection occt_2142243456_930384826584 AISUpdate
-
-Syntax: AISUpdate docname entry
-
-Recomputes a presantation of AISobject from **entry** label and applies the visualization setting in AIS viewer.
-**Example**
-
-AISUpdate D 0:5
-
-@subsubsection occt_2142243456_930384826585 AISErase
-
-Syntax: AISErase docname entry
-
-Erases AISobject of **entry** label in AIS viewer.
-**Example**
-
-AISErase D 0:5
-
-@subsubsection occt_2142243456_930384826586 AISRemove
-
-Syntax: AISRemove docname entry
-
-Erases AISobject of **entry** label in AIS viewer, then AISobject is removed from AIS_InteractiveContext.
-**Example**
-
-AISRemove D 0:5
-
-@subsubsection occt_2142243456_930384826587 AISSet
-
-Syntax: AISSet docname entry ID
-
-
-Creates AISPresentation attribute at **entry** label and sets as driver ID. ID must be one of the following: **A** (axis), **C** (constraint), **NS** (namedshape), **G** (geometry), **PL** (plane), **PT** (point).
-**Example**
-
-AISSet D 0:5 NS
-
-@subsubsection occt_2142243456_930384826588 AISDriver
-
-Syntax: AISDriver docname entry [ID]
-
-
-Returns DriverGUID stored in AISPresentation attribute of an **entry** label or sets a new one. ID must be one of the following: **A** (axis), **C** (constraint), **NS** (namedshape), **G** (geometry), **PL** (plane), **PT** (point).
-**Example**
-
-# Get Driver GUID
-AISDriver D 0:5
-
-@subsubsection occt_2142243456_930384826589 AISUnset
-
-Syntax: AISUnset docname entry
-
-Deletes AISPresentation attribute (if it exists) of an **entry** label.
-**Example**
-
-AISUnset D 0:5
-
-@subsubsection occt_2142243456_9303848265810 AISTransparency
-
-Syntax: AISTransparency docname entry [transparency]
-
-Sets (if **transparency** is defined) or gets the value of transparency for AISPresentation attribute of an **entry** label.
-**Example**
-
-AISTransparency D 0:5 0.5
-
-@subsubsection occt_2142243456_9303848265811 AISHasOwnTransparency
-
-Syntax: AISHasOwnTransparency docname entry
-
-Tests AISPresentation attribute of an **entry** label by own transparency.
-**Example**
-
-AISHasOwnTransparency D 0:5
-
-@subsubsection occt_2142243456_9303848265812 AISMaterial
-
-Syntax: AISMaterial docname entry [material]
-
-
-Sets (if **material** is defined) or gets the value of transparency for AISPresentation attribute of an **entry** label. **material** is integer from 0 to 20 (see **meshmat**).
-**Example**
-
-AISMaterial D 0:5 5
-
-@subsubsection occt_2142243456_9303848265813 AISHasOwnMaterial
-
-Syntax: AISHasOwnMaterial docname entry
-
-Tests AISPresentation attribute of an **entry** label by own material.
-**Example**
-
-AISHasOwnMaterial D 0:5
-
-@subsubsection occt_2142243456_9303848265814 AISColor
-
-Syntax: AISColor docname entry [color]
-
-Sets (if **color** is defined) or gets value of color for AISPresentation attribute of an **entry** label. **color** is integer from 0 to 516 (see color names in **vsetcolor**).
-**Example**
-
-AISColor D 0:5 25
-
-@subsubsection occt_2142243456_9303848265815 AISHasOwnColor
-
-Syntax: AISHasOwnColor docname entry
-
-Tests AISPresentation attribute of an **entry** label by own color.
-**Example**
-
-AISHasOwnColor D 0:5
-
-
-
-@section occt_2142243456_1101404852 Geometry commands
-
-
-
-
-@subsection occt_2142243456_110140485261 Overview
-
-Draw provides a set of commands to test geometry libraries. These commands are found in the TGEOMETRY executable, or in any Draw executable which includes GeometryTest commands.
-
-In the context of Geometry, Draw includes the following types of variable:
-
- * 2d and 3d points
- * The 2d curve, which corresponds to *Curve *in *Geom2d*.
- * The 3d curve and surface, which correspond to *Curve *and *Surface *in *Geom *<a href="#_ftn2">[2]</a>.
-Draw geometric variables never share data; the **copy **command will always make a complete copy of the content of the variable.
-
-The following topics are covered in the nine sections of this chapter:
-
- * **Curve creation **deals with the various types of curves and how to create them.
- * **Surface creation **deals with the different types of surfaces and how to create them.
- * **Curve and surface modification **deals with the commands used to modify the definition of curves and surfaces, most of which concern modifications to bezier and bspline curves.
- * **Geometric transformations **covers translation, rotation, mirror image and point scaling transformations.
- * **Curve and Surface Analysis **deals with the commands used to compute points, derivatives and curvatures.
- * **Intersections **presents intersections of surfaces and curves.
- * **Approximations **deals with creating curves and surfaces from a set of points.
- * **Constraints **concerns construction of 2d circles and lines by constraints such as tangency.
- * **Display **describes commands to control the display of curves and surfaces.
-
-Where possible, the commands have been made broad in application, i.e. they apply to 2d curves, 3d curves and surfaces. For instance, the **circle **command may create a 2d or a 3d circle depending on the number of arguments given.
-
-Likewise, the **translate **command will process points, curves or surfaces, depending on argument type. You may not always find the specific command you are looking for in the section where you expect it to be. In that case, look in another section. The **trim **command, for example, is described in the surface section. It can, nonetheless, be used with curves as well.
-
-
-
-@subsection occt_2142243456_110140485262 Curve creation
-
-This section deals with both points and curves. Types of curves are:
-
- * Analytical curves such as lines, circles, ellipses, parabolas, and hyperbolas.
- * Polar curves such as bezier curves and bspline curves.
- * Trimmed curves and offset curves made from other curves with the **trim **and **offset **commands. Because they are used on both curves and surfaces, the **trim **and **offset **commands are described in the *surface creation *section.
- * NURBS can be created from other curves using **convert **in the *Surface Creation *section.
- * Curves can be created from the isoparametric lines of surfaces by the **uiso **and **viso **commands.
- * 3d curves can be created from 2d curves and vice versa using the **to3d **and **to2d **commands. The **project **command computes a 2d curve on a 3d surface.
-
-Curves are displayed with an arrow showing the last parameter.
-
-
-@subsubsection occt_2142243456_1101404852621 point
-
-Syntax: point name x y [z]
-
-**point **creates a 2d or 3d point, depending on the number of arguments.
-<h5>Example</h5>
-
-# 2d point
-point p1 1 2
-
-# 3d point
-point p2 10 20 -5
-
-
-@subsubsection occt_2142243456_1101404852622 line
-
-Syntax: line name x y [z] dx dy [dz]
-
-**line **creates a 2d or 3d line. x y z are the coordinates of the line’s point of origin; dx, dy, dz give the direction vector.
-
-A 2d line will be represented asl x y dx dy, and a 3d line asl x y z dx dy dz. A line is parameterized along its length starting from the point of origin along the direction vector. The direction vector is normalized and must not be null. Lines are infinite, even though their representation is not.
-**Example**
-
-# a 2d line at 45 degrees of the X axis
-line l 2 0 1 1
-
-# a 3d line through the point 10 0 0 and parallel to Z
-line l 10 0 0 0 0 1
-
-
-@subsubsection occt_2142243456_1101404852623 circle
-
-Syntax: circle name x y [z [dx dy dz]] [ux uy [uz]] radius
-
-**circle **creates a 2d or a 3d circle.
-
-In 2d, x, y are the coordinates of the center and ux, uy define the vector towards the point of origin of the parameters. By default, this direction is (1,0). The X Axis of the local coordinate system defines the origin of the parameters of the circle. Use another vector than the x axis to change the origin of parameters.
-
-In 3d, x, y, z are the coordinates of the center; dx, dy, dz give the vector normal to the plane of the circle. By default, this vector is (0,0,1) i.e. the Z axis (it must not be null). ux, uy, uz is the direction of the origin; if not given, a default direction will be computed. This vector must neither be null nor parallel to dx, dy, dz.
-
-The circle is parameterized by the angle in [0,2*pi] starting from the origin and. Note that the specification of origin direction and plane is the same for all analytical curves and surfaces.
-
-**Example**
-
-# A 2d circle of radius 5 centered at 10,-2
-circle c1 10 -2 5
-
-# another 2d circle with a user defined origin
-# the point of parameter 0 on this circle will be
-# 1+sqrt(2),1+sqrt(2)
-circle c2 1 1 1 1 2
-
-# a 3d circle, center 10 20 -5, axis Z, radius 17
-circle c3 10 20 -5 17
-
-# same 3d circle with axis Y
-circle c4 10 20 -5 0 1 0 17
-
-# full 3d circle, axis X, origin on Z
-circle c5 10 20 -5 1 0 0 0 0 1 17
-
-
-@subsubsection occt_2142243456_1101404852624 ellipse
-
-Syntax: ellipse name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius **ellipse **creates a 2d or 3d ellipse. In a 2d ellipse, the first two arguments define the center; in a 3d ellipse, the first three. The axis system is given by *firstradius*, the major radius, and *secondradius*, the minor radius. The parameter range of the ellipse is [0,2.*pi] starting from the X axis and going towards the Y axis. The Draw ellipse is parameterized by an angle:
-
-P(u) = O + firstradius*cos(u)*Xdir + secondradius*sin(u)*Ydir
-
-where:
-
- * P is the point of parameter u,
- * O, Xdir and Ydir are respectively the origin, *X Direction* and *Y Direction* of its local coordinate system.
-<h5>Example</h5>
-
-# default 2d ellipse
-ellipse e1 10 5 20 10
-
-# 2d ellipse at angle 60 degree
-ellipse e2 0 0 1 2 30 5
-
-# 3d ellipse, in the XY plane
-ellipse e3 0 0 0 25 5
-
-# 3d ellipse in the X,Z plane with axis 1, 0 ,1
-ellipse e4 0 0 0 0 1 0 1 0 1 25 5
-
-See also: **circle**
-@subsubsection occt_2142243456_1101404852625 hyperbola
-
-Syntax: hyperbola name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius
-
-**hyperbola **creates a 2d or 3d conic. The first arguments define the center. The axis system is given by *firstradius*, the major radius, and *secondradius*, the minor radius. Note that the hyperbola has only one branch, that in the X direction.
-
-The Draw hyperbola is parameterized as follows:
-
-P(U) = O + firstradius*Cosh(U)*XDir + secondradius*Sinh(U)*YDir
-
-where:
-
- * P is the point of parameter U,
- * O, XDir and YDir are respectively the origin, *X Direction* and *Y
-
-Direction* of its local coordinate system.
-**Example**
-
-# default 2d hyperbola, with asymptotes 1,1 -1,1
-hyperbola h1 0 0 30 30
-
-# 2d hyperbola at angle 60 degrees
-hyperbola h2 0 0 1 2 20 20
-
-# 3d hyperbola, in the XY plane
-hyperbola h3 0 0 0 50 50
-
-See also: **circle**
-
-
-@subsubsection occt_2142243456_1101404852626 parabola
-
-Syntax: parabola name x y [z [dx dy dz]] [ux uy [uz]] FocalLength
-
-**parabola **creates a 2d or 3d parabola. in the axis system defined by the first arguments.The origin is the apex of the parabola.
-
-The Geom_Parabola parabola is parameterized as follows:
-
-P(u) = O + u*u/(4.*F)*XDir + u*YDir
-
-where:
- * P is the point of parameter u,
- * O, XDir and YDir are respectively the origin, *X Direction* and *Y Direction* of its local coordinate system,
- * F is the focal length of the parabola.
-**Example**
-
-# 2d parabola
-parabola p1 0 0 50
-
-# 2d parabola with convexity +Y
-parabola p2 0 0 0 1 50
-
-# 3d parabola in the Y-Z plane, convexity +Z
-parabola p3 0 0 0 1 0 0 0 0 1 50
-
-See also: **circle**
-
-
-@subsubsection occt_2142243456_1101404852627 beziercurve, dbeziercurve
-
-Syntax: beziercurve name nbpole pole, [weight]
-2dbeziercurve name nbpole pole, [weight]
-
-**beziercurve **creates a 3d rational or non-rational Bezier curve. Give the number of poles (control points,) and the coordinates of the poles (x1 y1 z1 [w1] x2 y2 z2 [w2]). The degree will be nbpoles-1. To create a rational curve, give weights with the poles. You must give weights for all poles or for none. If the weights of all the poles are equal, the curve is polynomial, and therefore non-rational.
-**Example**
-
-# a rational 2d bezier curve (arc of circle)
-2dbeziercurve ci 3 0 0 1 10 0 sqrt(2.)/2. 10 10 1
-
-# a 3d bezier curve, not rational
-beziercurve cc 4 0 0 0 10 0 0 10 0 10 10 10 10
-
-
-@subsubsection occt_2142243456_1101404852628 bsplinecurve, dbsplinecurve, pbsplinecurve, dpbsplinecurve
-
-Syntax: bsplinecurve name degree nbknots knot, umult pole, weight 2dbsplinecurve name degree nbknots knot, umult pole, weight pbsplinecurve name degree nbknots knot, umult pole, weight(periodic)
-2dpbsplinecurve name degree nbknots knot, umult pole, weight (periodic)
-
-**bsplinecurve **creates 2d or 3d bspline curves; the **pbsplinecurve **and **2dpbsplinecurve **commands create periodic bspline curves.
-
-A bspline curve is defined by its degree, its periodic or non-periodic nature, a table of knots and a table of poles (i.e. control points). Consequently, specify the degree, the number of knots, and for each knot, the multiplicity, for each pole, the weight. In the syntax above, the commas link the adjacent arguments which they fall between: knot and multiplicities, pole and weight.
-
-The table of knots is an increasing sequence of reals without repetition.
-Multiplicities must be lower or equal to the degree of the curve. For non-periodic curves, the first and last multiplicities can be equal to degree+1. For a periodic curve, the first and last multiplicities must be equal.
-
-The poles must be given with their weights, use weights of 1 for a non rational curve, the number of poles must be:
-
- * For a non periodic curve: Sum of multiplicities - degree + 1
- * For a periodic curve: Sum of multiplicities - last multiplicity
-**Example**
-
-# a bspline curve with 4 poles and 3 knots
-bsplinecurve bc 2 3 0 3 1 1 2 3 \
-10 0 7 1 7 0 7 1 3 0 8 1 0 0 7 1
-# a 2d periodic circle (parameter from 0 to 2*pi !!)
-dset h sqrt(3)/2
-2dpbsplinecurve c 2 \
-4 0 2 pi/1.5 2 pi/0.75 2 2*pi 2 \
-0 -h/3 1 \
-0.5 -h/3 0.5 \
-0.25 h/6 1 \
-0 2*h/3 0.5 \
--0.25 h/6 1 \
--0.5 -h/3 0.5 \
-0 -h/3 1
-
-<h4>NOTE</h4>
-*You can create the **NURBS **subset of bspline curves and*
-*surfaces by trimming analytical curves and surfaces and*
-*executing the command *convert*; see below.*
-
-
-@subsubsection occt_2142243456_1101404852629 uiso, viso
-
-Syntax: uiso name surface u
-viso name surface u
-
-Use these commands to create a U or V isoparametric curve from a surface.
-**Example**
-
-# create a cylinder and extract iso curves
-
-cylinder c 10
-uiso c1 c pi/6
-viso c2 c
-
-*NOTE*
-*Cannot be done from offset surfaces.*
-
-
-@subsubsection occt_2142243456_11014048526210 tod, tod
-
-Syntax: to3d name curve2d [plane]
-to2d name curve3d [plane]
-
-The **to3d **and **to2d **commands are used to create respectively a 3d curve from a 2d curve and a 2d curve from a 3d curve. The transformation uses a planar surface to define the XY plane in 3d (by default this plane is the default OXYplane). **to3d **always gives a correct result, but as **to2d **is not a projection, it may surprise you. It is always correct if the curve is planar and parallel to the plane of projection. The points defining the curve are projected on the plane. A circle, however, will remain a circle and will not be changed to an ellipse.
-**Example**
-
-# the following commands
-circle c 0 0 5
-plane p -2 1 0 1 2 3
-to3d c c p
-
-# will create the same circle as
-circle c -2 1 0 1 2 3 5
-
-See also: **project**
-
-
-@subsubsection occt_2142243456_11014048526211 project
-
-Syntax: project name curve3d surface
-
-**project **computes a 2d curve in the parametric space of a surface corresponding to a 3d curve. This can only be used on analytical surfaces.
-**Example**
-
-# intersect a cylinder and a plane
-# and project the resulting ellipse on the cylinder
-# this will create a 2d sinusoid-like bspline
-cylinder c 5
-plane p 0 0 0 0 1 1
-intersect i c p
-project i2d i c
-
-@subsection occt_2142243456_110140485263 Surface creation
-
-Types of surfaces are:
-
- * Analytical surfaces: plane, cylinder, cone, sphere, torus.
- * Polar surfaces: bezier surfaces, bspline surfaces
- * Trimmed and Offset surfaces; see **trim**, **trimu**, **trimv**, **offset**.
- * Surfaces produced by Revolution and Extrusion, created from curves with the **revsurf **and **extsurf**.
- * NURBS surfaces.
-
-Surfaces are displayed with isoparametric lines. To show the parameterization, a small parametric line with a length 1/10 of V is displayed at 1/10 of U.
-
-
-@subsubsection occt_2142243456_1101404852631 plane
-
-Syntax: plane name [x y z [dx dy dz [ux uy uz]]]
-
-Uses this command to create an infinite plane. A plane is the same as a 3d coordinate system, x,y,z is the origin, dx, dy, dz is the Z direction and ux, uy, uz is the X direction. The plane is perpendicular to Z and X is the U parameter. dx,dy,dz and ux,uy,uz must not be null and not colinear. ux,uy,uz will be modified to be orthogonal to dx,dy,dz. There are default values for the coordinate system. If no arguments are given, the global system (0,0,0), (0,0,1), (1,0,0). If only the origin is given, the axes are those given by default(0,0,1), (1,0,0). If the origin and the Z axis are given, the X axis is generated perpendicular to the Z axis. Note that this definition will be used for all analytical surfaces.
-**Example**
-
-# a plane through the point 10,0,0 perpendicular to X
-# with U direction on Y
-plane p1 10 0 0 1 0 0 0 1 0
-
-# an horixontal plane with origin 10, -20, -5
-plane p2 10 -20 -5
-
-
-@subsubsection occt_2142243456_1101404852632 cylinder
-
-Syntax: cylinder name [x y z [dx dy dz [ux uy uz]]] radius
-
-A cylinder is defined by a coordinate system, and a radius. The surface generated is an infinite cylinder with the Z axis as the axis. The U parameter is the angle starting from X going in the Y direction.
-See also: **plane**
-**Example**
-
-# a cylinder on the default Z axis, radius 10
-cylinder c1 10
-
-# a cylinder, also along the Z axis but with origin 5,
-10, -3
-cylinder c2 5 10 -3 10
-
-# a cylinder through the origin and on a diagonal
-# with longitude pi/3 and latitude pi/4 (euler angles)
-dset lo pi/3. la pi/4.
-cylinder c3 0 0 0 cos(la)*cos(lo) cos(la)*sin(lo)
-sin(la) 10
-
-
-@subsubsection occt_2142243456_1101404852633 cone
-
-Syntax: cone name [x y z [dx dy dz [ux uy uz]]] semi-angle radius
-
-Creates a cone in the infinite coordinate system along the Z-axis. The radius is that of the circle at the intersection of the cone and the XY plane. The semi-angle is the angle formed by the cone relative to the axis; it should be between –90 and 90. If the radius is 0, the vertex is the origin.
-See also: **plane**
-**Example**
-
-# a cone at 45 degrees at the origin on Z
-cone c1 45 0
-
-# a cone on axis Z with radius r1 at z1 and r2 at z2
-cone c2 0 0 z1 180.*atan2(r2-r1,z2-z1)/pi r1
-
-@subsubsection occt_2142243456_1101404852634 sphere
-
-Syntax: sphere name [x y z [dx dy dz [ux uy uz]]] radius
-
-Creates a sphere in the local coordinate system defined in the **plane **command. The sphere is centered at the origin. To parameterize the sphere, u is the angle from X to Y, between o and 2*pi. v is the angle in the half-circle at angle u in the plane containing the Z axis. v is between -pi/2 and pi/2. The poles are the points Z = +/- radius; their parameters are u,+/-pi/2 for any u in 0,2*pi.
-**Example**
-# a sphere at the origin
-sphere s1 10
-# a sphere at 10 10 10, with poles on the axis 1,1,1
-sphere s2 10 10 10 1 1 1 10
-
-See also: **plane**
-
-
-@subsubsection occt_2142243456_1101404852635 torus
-
-Syntax: torus name [x y z [dx dy dz [ux uy uz]]] major minor
-
-Creates a torus in the local coordinate system with the given major and minor radii. Z is the axis for the major radius. The major radius may be lower in value than the minor radius.
-
-To parameterize a torus, u is the angle from X to Y; v is the angle in the plane at angle u from the XY plane to Z. u and v are in 0,2*pi.
-**Example**
-
-# a torus at the origin
-torus t1 20 5
-
-# a torus in another coordinate system
-torus t2 10 5 -2 2 1 0 20 5
-
-See also: **plane**
-
-
-@subsubsection occt_2142243456_1101404852636 beziersurf
-
-Syntax: beziersurf name nbupoles nbvolpes pole, [weight]
-
-Use this command to create a bezier surface, rational or non-rational. First give the numbers of poles in the u and v directions.
-
-Then give the poles in the following order: pole(1, 1), pole(nbupoles, 1), pole(1, nbvpoles) and pole(nbupoles, nbvpoles).
-
-Weights may be omitted, but if you give one weight you must give all of them.
-**Example**
-
-# a non-rational degree 2,3 surface
-beziersurf s 3 4 \
-0 0 0 10 0 5 20 0 0 \
-0 10 2 10 10 3 20 10 2 \
-0 20 10 10 20 20 20 20 10 \
-0 30 0 10 30 0 20 30 0
-
-See also: **beziercurve**
-
-@subsubsection occt_2142243456_1101404852637 bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf
-
-Syntax: bsplinesurf name udegree nbuknots uknot umult ... nbvknot vknot
-vmult ... x y z w ...
-upbsplinesurf ...
-vpbsplinesurf ...
-uvpbsplinesurf ...
-
-**bsplinesurf **generates bspline surfaces. **upbsplinesurf **creates a bspline surface periodic in u; **vpbsplinesurf **creates one periodic in v; and **uvpbsplinesurf **creates one periodic in uv.
-
-The syntax is similar to the **bsplinecurve **command. First give the degree in u and the knots in u with their multiplicities, then do the same in v. The poles follow. The number of poles is the product of the number in u and the number in v. See **bsplinecurve **to compute the number of poles, the poles are first given in U as in the beziersurf command. You must give weights if the surface is rational.
-**Example**
-
-# create a bspline surface of degree 1 2
-# with two knots in U and three in V
-bsplinesurf s \
-1 2 0 2 1 2 \
-2 3 0 3 1 1 2 3 \
-0 0 0 1 10 0 5 1 \
-0 10 2 1 10 10 3 1 \
-0 20 10 1 10 20 20 1 \
-0 30 0 1 10 30 0 1
-
-See also: **bsplinecurve**, **beziersurf**, **convert**
-
-
-@subsubsection occt_2142243456_1101404852638 trim, trimu, trimv
-
-Syntax: trim newname name [u1 u2 [v1 v2]]
-trimu newname name
-trimv newname name
-
-The **trim **commands create trimmed curves or trimmed surfaces. Note that trimmed curves and surfaces are classes of the *Geom *package. The **trim **command creates either a new trimmed curve from a curve or a new trimmed surface in u and v from a surface. **trimu **creates a u-trimmed surface, and **trimv **a v-trimmed surface. After an initial trim, a second execution with no parameters given recreates the basis curve. The curves can be either 2d or 3d. If the trimming parameters decrease and if the curve or surface is not periodic, the direction is reversed.
-<h4>NOTE</h4>
-*Note that a trimmed curve or surface contains a copy of the*
-*basis geometry: modifying that will not modify the trimmed*
-*geometry. Trimming trimmed geometry will not create*
-*multiple levels of trimming. The basis geometry will be used.*
-**Example**
-
-# create a 3d circle
-circle c 0 0 0 10
-
-# trim it, use the same variable, the original is
-deleted
-trim c c 0 pi/2
-
-# the original can be recovered!
-trim orc c
-
-# trim again
-trim c c pi/4 pi/2
-
-# the original is not the trimmed curve but the basis
-trim orc c
-
-# as the circle is periodic, the two following commands
-are identical
-trim cc c pi/2 0
-trim cc c pi/2 2*pi
-
-# trim an infinite cylinder
-cylinder cy 10
-trimv cy cy 0 50
-
-See also: **reverse**
-
-
-@subsubsection occt_2142243456_1101404852639 offset
-
-Syntax: offset name basename distance [dx dy dz]
-
-Creates offset curves or surfaces at a given distance from a basis curve or surface. Offset curves and surfaces are classes from the *Geom *package.
-
-The curve can be a 2d or a 3d curve. To compute the offsets for a 3d curve, you must also give a vector dx,dy,dz. For a planar curve, this vector is usually the normal to the plane containing the curve.
-
-The offset curve or surface copies the basic geometry, which can be modified later.
-**Example**
-
-# graphic demonstration that the outline of a torus
-# is the offset of an ellipse
-smallview +X+Y
-dset angle pi/6
-torus t 0 0 0 0 cos(angle) sin(angle) 50 20
-fit
-ellipse e 0 0 0 50 50*sin(angle)
-# note that the distance can be negative
-offset l1 e 20 0 0 1
-@subsubsection occt_2142243456_11014048526310 revsurf
-
-Syntax: revsurf name curvename x y z dx dy dz
-
-Creates a surface of revolution from a 3d curve. A surface of revolution or revolved surface is obtained by rotating a curve (called the *meridian*) through a complete revolution about an axis (referred to as the *axis of revolution*). The curve and the axis must be in the same plane (the *reference plane* of the surface). Give the point of origin x,y,z and the vector dx,dy,dz to define the axis of revolution. To parameterize a surface of revolution: u is the angle of rotation around the axis. Its origin is given by the position of the meridian on the surface. v is the parameter of the meridian.
-**Example**
-
-# another way of creating a torus like surface
-circle c 50 0 0 20
-revsurf s c 0 0 0 0 1 0
-
-
-@subsubsection occt_2142243456_11014048526311 extsurf
-
-Syntax: extsurf newname curvename dx dy dz
-
-Use the **extsurf **command to create a surface of linear extrusion from a 3d curve. The basis curve is swept in a given direction,the *direction of extrusion* defined by a vector. In the syntax, dx,dy,dz gives the direction of extrusion. To parameterize a surface of extrusion: u is the parameter along the extruded curve; the v parameter is along the direction of extrusion.
-**Example**
-
-# an elliptic cylinder
-ellipse e 0 0 0 10 5
-extsurf s e 0 0 1
-# to make it finite
-trimv s s 0 10
-
-
-@subsubsection occt_2142243456_11014048526312 convert
-
-Syntax: convert newname name
-
-**convert **creates a 2d or 3d NURBS curve or a NURBS surface from any 2d curve, 3d curve or surface. In other words, conics, beziers and bsplines are turned into NURBS. Offsets are not processed.
-**Example**
-
-# turn a 2d arc of a circle into a 2d NURBS
-circle c 0 0 5
-trim c c 0 pi/3
-convert c1 c
-
-# an easy way to make a planar bspline surface
-plane p
-trim p p -1 1 -1 1
-convert p1 p
-
-<h4>NOTE</h4>
-*Offset curves and surfaces are not treated by this command.*
-
-
-
-@subsection occt_2142243456_110140485264 Curve and surface modifications
-
-Draw provides commands to modify curves and surfaces, some of them are general, others restricted to bezier curves or bsplines.
-
-General modifications:
-
- * Reversing the parametrization: **reverse**, **ureverse**, **vreverse**
-
-Modifications for both bezier curves and bsplines:
-
- * Exchanging U and V on a surface: **exchuv**
- * Segmentation: **segment**, **segsur**
- * Increasing the degree: **incdeg**, **incudeg**, **incvdeg**
- * Moving poles: **cmovep**, **movep**, **movecolp**, **moverowp**
-
-Modifications for bezier curves:
-
- * Adding and removing poles: **insertpole**, **rempole**, **remcolpole**, **remrowpole**
-
-Modifications for bspline:
-
- * Inserting and removing knots: **insertknot**, **remknot**, **insertuknot**, **remuknot**, **insetvknot**, **remvknot**
- * Modifying periodic curves and surfaces: **setperiodic**, **setnotperiodic**, **setorigin**, **setuperiodic**, **setunotperiodic**, **setuorigin**, **setvperiodic**, **setvnotperiodic**, **setvorigin**
-
-
-
-
-
-@subsubsection occt_2142243456_1101404852641 reverse, ureverse, vreverse
-
-
-Syntax: reverse curvename
-ureverse surfacename
-vreverse surfacename
-
-The **reverse **command reverses the parameterization and inverses the orientation of a 2d or 3d curve. Note that the geometry is modified. To keep the curve or the surface, you must copy it before modification.
-
-**ureverse **or **vreverse **reverse the u or v parameter of a surface. Note that the new parameters of the curve may change according to the type of curve. For instance, they will change sign on a line or stay 0,1 on a bezier.
-
-Reversing a parameter on an analytical surface may create an indirect coordinate system.
-**Example**
-
-# reverse a trimmed 2d circle
-circle c 0 0 5
-trim c c pi/4 pi/2
-reverse c
-
-# dumping c will show that it is now trimmed between
-# 3*pi/2 and 7*pi/4 i.e. 2*pi-pi/2 and 2*pi-pi/4
-
-
-@subsubsection occt_2142243456_1101404852642 exchuv
-
-Syntax: exchuv surfacename
-
-For a bezier or bspline surface this command exchanges the u and v parameters.
-**Example**
-
-# exchanging u and v on a spline (made from a cylinder)
-cylinder c 5
-trimv c c 0 10
-convert c1 c
-exchuv c1
-
-
-@subsubsection occt_2142243456_1101404852643 segment, segsur
-
-Syntax: segment curve Ufirst Ulast
-segsur surface Ufirst Ulast Vfirst Vlast
-
-**segment **and **segsur **segment a bezier curve and a bspline curve or surface respectively. These commands modify the curve to restrict it between the new parameters: the starting point of the modified curve, Ufirst, and the end point, Ulast. Ufirst is less than Ulast.
-
-This command must not be confused with **trim **which creates new geometry.
-
-**Example**
-
-# segment a bezier curve in half
-beziercurve c 3 0 0 0 10 0 0 10 10 0
-segment c ufirst ulast
-
-
-@subsubsection occt_2142243456_1101404852644 iincudeg, incvdeg
-
-Syntax: incudeg surfacename newdegree
-incvdeg surfacename newdegree
-
-**incudeg **and **incvdeg **increase the degree in the U or V parameter of a bezier or bspline surface.
-**Example**
-
-# make a planar bspline and increase the degree to 2 3
-plane p
-trim p p -1 1 -1 1
-convert p1 p
-incudeg p1 2
-incvdeg p1 3
-
-<h4>NOTE</h4>
-*The geometry is modified.*
-
-
-@subsubsection occt_2142243456_1101404852645 cmovep, movep, movecolp, moverowp
-
-Syntax: cmovep curve index dx dy [dz]
-movep surface uindex vindex dx dy dz
-movecolp surface uindex dx dy dz
-moverowp surface vindex dx dy dz
-
-**move **methods translate poles of a bezier curve, a bspline curve or a bspline surface. **cmovep **and **movep **translate one pole with a given index.
-
-**movecolp **and **moverowp **translate a whole column (expressed by the uindex) or row (expressed by the vindex) of poles.
-**Example**
-
-# start with a plane
-# transform to bspline, raise degree and add relief
-plane p
-trim p p -10 10 -10 10
-convert p1 p
-incud p1 2
-incvd p1 2
-movecolp p1 2 0 0 5
-moverowp p1 2 0 0 5
-movep p1 2 2 0 0 5
-
-
-@subsubsection occt_2142243456_1101404852646 insertpole, rempole, remcolpole, remrowpole
-
-Syntax: insertpole curvename index x y [z] [weight]
-rempole curvename index
-remcolpole surfacename index
-remrowpole surfacename index
-
-**insertpole **inserts a new pole into a 2d or 3d bezier curve. You may add a weight for the pole. The default value for the weight is 1. The pole is added at the position after that of the index pole. Use an index 0 to insert the new pole before the first one already existing in your drawing.
-
-**rempole **removes a pole from a 2d or 3d bezier curve. Leave at least two poles in the curves.
-
-**remcolpole **and **remrowpole **remove a column or a row of poles from a bezier surface. A column is in the v direction and a row in the u direction The resulting degree must be at least 1; i.e there will be two rows and two columns left.
-**Example**
-
-# start with a segment, insert a pole at end
-# then remove the central pole
-beziercurve c 2 0 0 0 10 0 0
-insertpole c 2 10 10 0
-rempole c 2
-
-
-@subsubsection occt_2142243456_1101404852647 insertknot, insertuknot, insertvknot
-
-Syntax: insertknot name knot [mult = 1] [knot mult ...]
-insertuknot surfacename knot mult
-insertvknot surfacename knot mult
-
-**insertknot **inserts knots in the knot sequence of a bspline curve. You must give a knot value and a target multiplicity. The default multiplicity is 1. If there is already a knot with the given value and a multiplicity lower than the target one, its multiplicity will be raised. **insertuknot **and **insertvknot **insert knots in a surface.
-
-
-
-
-**Example**
-
-# create a cylindrical surface and insert a knot
-cylinder c 10
-trim c c 0 pi/2 0 10
-convert c1 c
-insertuknot c1 pi/4 1
-
-@subsubsection occt_2142243456_1101404852648 remknot, remuknot, remvknot
-
-Syntax: remknot index [mult] [tol]
-remuknot index [mult] [tol]
-remvknot index [mult] [tol]
-
-**remknot **removes a knot from the knot sequence of a curve or a surface. Give the index of the knot and optionally, the target multiplicity. If the target multiplicity is not 0, the multiplicity of the knot will be lowered. As the curve may be modified, you are allowed to set a tolerance to control the process. If the tolerance is low, the knot will only be removed if the curve will not be modified.
-
-By default, if no tolerance is given, the knot will always be removed.
-**Example**
-
-# bspline circle, remove a knot
-circle c 0 0 5
-convert c1 c
-incd c1 5
-remknot c1 2
-
-*NOTE*
-*Curves or Surfaces may be modified.*
-
-
-@subsubsection occt_2142243456_1101404852649 setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic
-
-Syntax: setperiodic curve
-setnotperiodic curve
-setuperiodic surface
-setunotperiodic surface
-setvperiodic surface
-setvnotperiodic surface
-
-**setperiodic **turns a bspline curve into a periodic bspline curve; the knot vector stays the same and excess poles are truncated. The curve may be modified if it has not been closed. **setnotperiodic **removes the periodicity of a periodic curve. The pole table mau be modified. Note that knots are added at the beginning and the end of the knot vector and the multiplicities are knots set to degree+1 at the start and the end.
-
-**setuperiodic **and **setvperiodic **make the u or the v parameter of bspline surfaces periodic; **setunotperiodic**, and **setvnotperiodic **remove periodicity from the u or the v parameter of bspline surfaces.
-**Example**
-
-# a circle deperiodicized
-circle c 0 0 5
-convert c1 c
-setnotperiodic c1
-@subsubsection occt_2142243456_11014048526410 setorigin, setuorigin, setvorigin
-
-Syntax: setorigin curvename index
-setuorigin surfacename index
-setuorigin surfacename index
-
-These commands change the origin of the parameters on periodic curves or surfaces. The new origin must be an existing knot. To set an origin other than an existing knot, you must first insert one with the **insertknot **command.
-**Example**
-
-# a torus with new U and V origins
-torus t 20 5
-convert t1 t
-setuorigin t1 2
-setvorigin t1 2
-
-
-@subsection occt_2142243456_110140485265 Transformations
-
-Draw provides commands to apply linear transformations to geometric objects: they include translation, rotation, mirroring and scaling.
-
-@subsubsection occt_2142243456_1101404852651 translate, dtranslate
-
-Syntax: translate name [names ...] dx dy dz
-2dtranslate name [names ...] dx dy
-
-The **Translate **command translates 3d points, curves and surfaces along a vector dx,dy,dz. You can translate more than one object with the same command.
-
-For 2d points or curves, use the **2dtranslate **command.
-**Example**
-
-# 3d tranlation
-point p 10 20 30
-circle c 10 20 30 5
-torus t 10 20 30 5 2
-translate p c t 0 0 15
-*NOTE*
-*Objects are modified by this command.*
-
-@subsubsection occt_2142243456_1101404852652 rotate, drotate
-
-Syntax: rotate name [name ...] x y z dx dy dz angle
-2drotate name [name ...] x y angle
-The **rotate **command rotates a 3d point curve or surface. You must give an axis of rotation with a point x,y,z, a vector dx,dy,dz, and an angle in degrees.
-
-For a 2d rotation, you need only give the center point and the angle. In 2d or 3d, the angle can be negative.
-**Example**
-
-# make a helix of circles. create a scripte file with
-this code and execute it using **source**.
-circle c0 10 0 0 3
-for {set i 1} {$i = 10} {incr i} {
-copy c[expr $i-1] c$i
-translate c$i 0 0 3
-rotate c$i 0 0 0 0 0 1 36
-}
-
-@subsubsection occt_2142243456_1101404852653 pmirror, lmirror, smirror, dpmirror, dlmirror
-
-Syntax: pmirror name [names ...] x y z
-lmirror name [names ...] x y z dx dy dz
-smirror name [names ...] x y z dx dy dz
-2dpmirror name [names ...] x y
-2dlmirror name [names ...] x y dx dy
-
-The mirror commands perform a mirror transformation of 2d or 3d geometry.
-
-**pmirror **is the point mirror, mirroring 3d curves and surfaces about a point of symmetry. **lmirror **is the line mirror commamd, mirroring 3d curves and surfaces about an axis of symmetry. **smirror **is the surface mirror, mirroring 3d curves and surfaces about a plane of symmetry. In the last case, the plane of symmetry is perpendicular to dx,dy,dz.
-
-In 2d, only **2dpmirror**, point symmetry mirroring, and **2dlmirror**, axis symmetry mirroring, are available.
-**Example**
-
-# build 3 images of a torus
-torus t 10 10 10 1 2 3 5 1
-copy t t1
-pmirror t1 0 0 0
-copy t t2
-lmirror t2 0 0 0 1 0 0
-copy t t3
-smirror t3 0 0 0 1 0 0
-
-@subsubsection occt_2142243456_1101404852654 pscale, dpscale
-
-Syntax: pscale name [name ...] x y z s
-2dpscale name [name ...] x y s
-The **pscale **and **2dpscale **commands transform an object by point scaling. You must give the center and the scaling factor. Because other scalings modify the type of the object, they are not provided. For example, a sphere may be transformed into an ellipsoid. Using a scaling factor of -1 is similar to using **pmirror**.
-**Example**
-
-# double the size of a sphere
-sphere s 0 0 0 10
-pscale s 0 0 0 2
-
-@subsection occt_2142243456_110140485266 Curve and surface analysis
-
-**Draw **provides methods to compute information about curves and surfaces:
-
- * **coord **to find the coordinates of a point.
- * **cvalue **and **2dcvalue **to compute points and derivatives on curves.
- * **svalue **to compute points and derivatives on a surface.
- * **localprop **and **minmaxcurandif **to compute the curvature on a curve.
- * **parameters **to compute (u,v) values for a point on a surface.
- * **proj **and **2dproj **to project a point on a curve or a surface.
- * **surface_radius **to compute the curvature on a surface.
-
-@subsubsection occt_2142243456_1101404852661 coord
-
-Syntax: coord P x y [z]
-
-The **coord **command will set the coordinates of the point P. x, y (and optionally z)
-**Example**
-
-# translate a point
-point p 10 5 5
-translate p 5 0 0
-coord p x y z
-# x value is 15
-See also: **point**
-@subsubsection occt_2142243456_1101404852662 cvalue, dcvalue
-
-Syntax: cvalue curve U x y z [d1x d1y d1z [d2x d2y d2z]]
-2dcvalue curve U x y [d1x d1y [d2x d2y]]
-
-For a curve at a given parameter, and depending on the number of arguments, **cvalue **computes: the coordinates in x,y,z, the first derivative in d1x,d1y,d1z and the second derivative in d2x,d2y,d2z.
-<h5>Example</h5>
-
-# on a bezier curve at parameter 0
-# the point is the first pole
-# the derivative is the vector first to second pole
-# multiplied by the degree
-# the second derivative is the difference
-# first to second pole, second to third pole
-# multipied by degree * degree-1
-2dbeziercurve c 4 0 0 1 1 2 1 3 0
-2dcvalue c 0 x y d1x d1y d2x d2y
-
-# values of x y d1x d1y d2x d2y
-# are 0 0 3 3 0 -6
-
-
-@subsubsection occt_2142243456_1101404852663 svalue
-
-Syntax: svalue surfname U v x y z [dux duy duz dvx dvy dvz [d2ux d2uy d2uz d2vx d2vy d2vz d2uvx d2uvy d2uvz]]
-
-**svalue **computes points and derivatives on a surface for a pair of parameter values. The result depends on the number of arguments. You can compute first and second derivatives.
-**Example**
-
-# display points on a sphere
-sphere s 10
-for {dset t 0} {[dval t] = 1} {dset t t+0.01} {
-svalue s t*2*pi t*pi-pi/2 x y z
-point . x y z
-}
-
-
-@subsubsection occt_2142243456_1101404852664 localprop, minmaxcurandinf
-
-Syntax: localprop curvename U
-minmaxcurandinf curve
-
-The **localprop **command computes the curvature of a curve.
-**minmaxcurandinf **computes and prints the parameters of the points where the curvature is minimum and maximum on a 2d curve.
-**Example**
-
-# show curvature at the center of a bezier curve
-beziercurve c 3 0 0 0 10 2 0 20 0 0
-localprop c 0.5
-== Curvature : 0.02
-
-See also: **surface_radius**
-
-
-@subsubsection occt_2142243456_1101404852665 parameters
-
-Syntax: parameters surf/curve x y z U [V]
-
-The **parameters **command returns the parameters on the surface of the 3d point x,y,z in variables u and v . This command may only be used on analytical surfaces: plane, cylinder, cone, sphere and torus.
-**Example**
-
-# Compute parameters on a plane
-plane p 0 0 10 1 1 0
-parameters p 5 5 5 u v
-# the values of u and v are : 0 5
-
-
-@subsubsection occt_2142243456_1101404852666 proj, dproj
-
-Syntax: proj name x y z
-2dproj name xy
-
-Use **proj **to project a point on a 3d curve or a surface and **2dproj **for a 2d curve.
-
-The command will compute and display all points in the projection. The lines joining the point to the projections are created with the names ext_1, ext_2, ...
-**Example**
-
-# project point on a torus
-torus t 20 5
-proj t 30 10 7
-== ext_1 ext_2 ext_3 ext_4
-
-
-@subsubsection occt_2142243456_1101404852667 surface_radius
-
-Syntax: surface_radius surface u v [c1 c2]
-
-The **surface_radius **command computes the main curvatures of a surface at parameters (u,v). If there are extra arguments, their curvatures are stored in variables c1 and c2.
-**Example**
-
-# computes curvatures of a cylinder
-cylinder c 5
-surface_radius c pi 3 c1 c2
-== Min Radius of Curvature : -5
-== Min Radius of Curvature : infinite
-
-
-
-@subsection occt_2142243456_110140485267 Intersections
-
-The **intersect **command computes intersections of surfaces; the **2dintersect **command, intersections of 2d curves.
-
-
-@subsubsection occt_2142243456_1101404852671 intersect
-
-Syntax: intersect name surface1 surface2
-
-The **intersect **command intersects two surfaces. If there is one intersection curve it will be named ;name;, if there are more than one they will be named ;name_1;, ;name_2;, ...
-**Example**
-
-# create an ellipse
-cone c 45 0
-plane p 0 0 40 0 1 5
-intersect e c p
-
-
-@subsubsection occt_2142243456_1101404852672 dintersect
-
-Syntax: 2dintersect curve1 curve2
-
-**2dintersect **displays the intersection points between two 2d curves.
-**Example**
-
-# intersect two 2d ellipses
-ellipse e1 0 0 5 2
-ellipse e2 0 0 0 1 5 2
-2dintersect e1 e2
-@subsection occt_2142243456_110140485268 Approximations
-
-Draw provides command to create curves and surfaces by approximation.
-
-**2dapprox **fits a curve through 2d points, **appro **fits a curve through 3d points, **surfapp **and **grilapp **fits a surface through 3d points, **2dinterpolate **may be used to interpolate a curve.
-
-@subsubsection occt_2142243456_1101404852681 appro, dapprox
-
-Syntax: appro result nbpoint [curve]
-2dapprox result nbpoint [curve / x1 y1 x2 y2]
-
-These commands fit a curve through a set of points. First give the number of points, then choose one of the three ways available to get the points. If you have no arguments, click on the points. If you have a curve argument or a list of points, the command launches computation of the points on the curve.
-**Example**
-
-# pick points and they will be fitted
-2dapprox c 10
-
-
-@subsubsection occt_2142243456_1101404852682 surfapp, grilapp
-
-
-Syntax: surfapp name nbupoints nbvpoints x y z ....
-grilapp name nbupoints nbvpoints xo dx yo dy z11 z12 ...
-
-**surfapp **fits a surface through an array of u and v points, nbupoints*nbvpoints.
-
-**grilapp **has the same function, but the x,y coordinates of the points are on a grid starting at x0,y0 with steps dx,dy.
-**Example**
-
-# a surface using the same data as in the beziersurf
-example sect 4.4
-surfapp s 3 4 \
-0 0 0 10 0 5 20 0 0 \
-0 10 2 10 10 3 20 10 2 \
-0 20 10 10 20 20 20 20 10 \
-0 30 0 10 30 0 20 30 0
-
-
-
-
-
-@subsection occt_2142243456_110140485269 Constraints
-
-The **cirtang **command is used to construct 2d circles tangent to curves and **lintan **to construct 2d lines tangent to curves.
-
-
-@subsubsection occt_2142243456_1101404852691 cirtang
-
-Syntax: cirtang cname curve/point/radius curve/point/radius curve/point/radius
-
-The **cirtang **command will build all circles satisfying the three constraints which are either a curve (the circle must be tangent to that curve), a point (the circle must pass through that point), or a radius for the circle. Only one constraint can be a radius. The solutions will be stored in variables *name_1*, *name_2*, etc.
-**Example**
-
-# a point, a line and a radius. 2 solutions
-point p 0 0
-line 1 10 0 -1 1
-cirtang c p 1 4
-== c_1 c_2
-
-
-@subsubsection occt_2142243456_1101404852692 lintan
-
-Syntax: lintan name curve curve [angle]
-
-The **lintan **command will build all 2d lines tangent to two curves. If a third angle argument is given the second curve must be a line and **lintan **will build all lines tangent to the first curve and forming the given angle with the line. The angle is given in degrees. The solutions are named name_1, name_2, etc.
-**Example**
-
-# lines tangent to 2 circles, 4 solutions
-circle c1 -10 0 10
-circle c2 10 0 5
-lintan l c1 c2
-
-# lines at 15 degrees tangent to a circle and a line, 2
-solutions: l1_1 l1_2
-circle c1 -10 0 1
-line l 2 0 1 1
-lintan l1 c1 l 15
-
-
-
-
-@subsection occt_2142243456_1101404852610 Display
-
-Draw provides commands to control the display of geometric objects. Some display parameters are used for all objects, others are valid for surfaces only, some for bezier and bspline only, and others for bspline only.
-
-On curves and surfaces, you can control the mode of representation with the **dmode **command. You can control the parameters for the mode with the **defle **command and the **discr **command, which control deflection and discretization respectively.
-
-On surfaces, you can control the number of isoparametric curves displayed on the surface with the **nbiso **commands.
-
-On bezier and bspline curve and surface you can toggle the display of the control points with the **clpoles **and **shpoles **commands.
-
-On bspline curves and surfaces you can toggle the display of the knots with the **shknots **and **clknots **commands.
-
-
-@subsubsection occt_2142243456_11014048526101 dmod, discr, defle
-
-Syntax: dmode name [name ...] u/d
-discr name [name ...] nbintervals
-defle name [name ...] deflection
-
-**dmode **allows you to choose the display mode for a curve or a surface.
-
-In mode ;u;, or *uniform deflection*, the points are computed to keep the polygon at a distance lower than the deflection of the geometry. The deflection is set with the **defle **command. This mode involves intensive use of computational power.
-
-In ;d;, or discretization mode, a fixed number of points is computed. This number is set with the **discr **command. This is the default mode. On a bspline, the fixed number of points is computed for each span of the curve. (A span is the interval between two knots).
-
-If the curve or the isolines seem to present too many angles, you can either increase the discretization or lower the deflection, depending on the mode. This will increase the number of points.
-**Example**
-
-# increment the number of points on a big circle
-circle c 0 0 50 50
-discr 100
-
-# change the mode
-dmode c u
-
-
-@subsubsection occt_2142243456_11014048526102 nbiso
-
-Syntax: nbiso name [names...] nuiso nviso
-
-**nbiso **changes the number of isoparametric curves displayed on a surface in the U and V directions. On a bspline surface, isoparametric curves are displayed by default at knot values. Use **nbiso **to turn this feature off.
-**Example**
-
-# display 35 meridians and 15 parallels on a spere
-sphere s 20
-nbiso s 35 15
-
-
-@subsubsection occt_2142243456_11014048526103 clpoles, shpoles
-
-Syntax: clpoles name
-shpoles name
-
-On bezier and bspline curves and surfaces, the control polygon is displayed by default: **clpoles **erases it and **shpoles **restores it.
-**Example**
-
-# make a bezier curve and erase the poles
-beziercurve c 3 0 0 0 10 0 0 10 10 0
-clpoles c
-
-
-@subsubsection occt_2142243456_11014048526104 clknots, shknots
-
-Syntax: clknots name
-shknots name
-
-By default, knots on a bspline curve or surface are displayed with markers at the points with parametric value equal to the knots. **clknots **removes them and **shknots **restores them.
-**Example**
-
-# hide the knots on a bspline curve
-bsplinecurve bc 2 3 0 3 1 1 2 3 \
-10 0 7 1 7 0 7 1 3 0 8 1 0 0 7 1
-clknots bc
-@section occt_2142243456_1869436669 Topology commands
-
-
-
-
-
-
-
-Draw provides a set of commands to test OCCT Topology libraries. The Draw commands are found in the DRAWEXE executable or in any executable including the BRepTest commands.
-
-Topology defines the relationship between simple geometric entities, which can thus be linked together to represent complex shapes. The type of variable used by Topology in Draw is the shape variable.
-
-The different topological shapes<a href="#_ftn3">[3]</a> include:
-
- * COMPOUND: A group of any type of topological object.
- * COMPSOLID: A set of solids connected by their faces. This expands the notions of WIRE and SHELL to solids.
- * SOLID: A part of space limited by shells. It is three dimensional.
- * SHELL: A set of faces connected by their edges. A shell can be open or closed.
- * FACE: In 2d, a plane; in 3d, part of a surface. Its geometry is constrained (trimmed) by contours. It is two dimensional.
- * WIRE: A set of edges connected by their vertices. It can be open or closed depending on whether the edges are linked or not.
- * EDGE: A topological element corresponding to a restrained curve. An edge is generally limited by vertices. It has one dimension.
- * VERTEX: A topological element corresponding to a point. It has a zero dimension.
-
-Shapes are usually shared. **copy **will create a new shape which shares its representation with the original. Nonetheless, two shapes sharing the same topology can be moved independently (see the section on **transformation**).
-
-The following topics are covered in the eight sections of this chapter:
-
- * Basic shape commands to handle the structure of shapes and control the display.
- * Curve and surface topology, or methods to create topology from geometry and vice versa.
- * Primitive construction commands: box, cylinder, wedge etc.
- * Sweeping of shapes.
- * Transformations of shapes: translation, copy, etc.
- * Topological operations, or booleans.
- * Drafting and blending.
- * Analysis of shapes.
-
-
-
-@subsection occt_2142243456_186943666971 Basic topology
-
-The set of basic commands allows simple operations on shapes, or step-by-step construction of objects. These commands are useful for analysis of shape structure and include:
-
- * **isos **and **discretisation **to control display of shape faces by isoparametric curves .
- * **orientation**, **complement **and **invert **to modify topological attributes such as orientation.
- * **explode**, **exwire **and **nbshapes **to analyze the structure of a shape.
- * **emptycopy**, **add**, **compound **to create shapes by stepwise construction.
-
-In Draw, shapes are displayed using isoparametric curves. There is color coding for the edges:
-
- * a red edge is an isolated edge, which belongs to no faces.
- * a green edge is a free boundary edge, which belongs to one face,
- * a yellow edge is a shared edge, which belongs to at least two faces.
-
-
-@subsubsection occt_2142243456_1869436669711 isos, discretisation
-
-Syntax: isos [name ...][nbisos]
-discretisation nbpoints
-**isos **determines or changes the number of isoparametric curves on shapes.
-
-The same number is used for the u and v directions. With no arguments, **isos **prints the current default value. To determine, the number of isos for a shape, give it name as the first argument.
-
-**discretisation **changes the default number of points used to display the curves. The default value is 30.
-**Example**
-
-# Display only the edges (the wireframe)
-isos 0
-
-<h4>NOTE</h4>
-Don’t confuse *isos* and *discretisation* with the geometric
-*commands *nbisos* and *discr*.*
-
-
-@subsubsection occt_2142243456_1869436669712 orientation, complement, invert, normals, range
-
-Syntax: orientation name [name ...] F/R/E/I
-complement name [name ...]
-invert name
-normals s (length = 10), disp normals
-range name value value
-
-**orientation **assigns the orientation of shapes - simple and complex - to one of the following four values: FORWARD, REVERSED, INTERNAL, EXTERNAL.
-
-**complement **changes the current orientation of shapes to its complement, FORWARD - REVERSED, INTERNAL - EXTERNAL.
-
-**invert **creates a new shape which is a copy of the original with the orientation all subshapes reversed. For example, it may be useful to reverse the normals of a solid.
-
-**normals **returns the assignment of colors to orientation values.
-
-**range **defines the length of a selected edge by defining the values of a starting point and an end point.
-**Example**
-
-# invert normals of a box
-box b 10 20 30
-normals b 5
-invert b
-normals b 5
-
-# to assign a value to an edge
-box b1 10 20 30
-# to define the box as edges
-explode b1 e
-b_1 b_2 b_3 b_4 b_5 b_6 b_7 b_8 b_9 b_10 b_11 b_12
-# to define as an edge
-makedge e 1
-# to define the length of the edge as starting from 0
-and finishing at 1
-range e 0 1
-
-
-@subsubsection occt_2142243456_1869436669713 explode, exwire, nbshapes
-
-Syntax: explode name [C/So/Sh/F/W/E/V]
-exwire name
-nbshapes name
-
-**explode **extracts subshapes from an entity. The subshapes will be named *name_1*, *name_2*, ... Note that they are not copied but shared with the original.
-
-With name only, **explode **will extract the first sublevel of shapes: the shells of a solid or the edges of a wire, for example. With one argument, **explode **will extract all subshapes of that type: *C *for compounds, *So *for solids, *Sh *for shells, *F *for faces, *W *for wires, *E *for edges, *V *for vertices.
-
-**exwire **is a special case of **explode **for wires, which extracts the edges in an ordered way,if possible. Each edge, for example, is connected to the following one by a vertex.
-
-**nbshapes **counts the number of shapes of each type in an entity.
-**Example**
-
-# on a box
-box b 10 20 30
-
-# whatis returns the type and various information
-whatis b
-= b is a shape SOLID FORWARD Free Modified
-
-# make one shell
-explode b
-whatis b_1
-= b_1 is a shape SHELL FORWARD Modified Orientable
-Closed
-
-# extract the edges b_1, ... , b_12
-explode b e
-==b_1 ... b_12
-
-# count subshapes
-nbshapes b
-==
-Number of shapes in b
-VERTEX : 8
-EDGE : 12
-WIRE : 6
-FACE : 6
-SHELL : 1
-SOLID : 1
-COMPSOLID : 0
-COMPOUND : 0
-SHAPE : 34
-
-
-@subsubsection occt_2142243456_1869436669714 emptycopy, add, compound
-
-Syntax: emptycopy [newname] name
-add name toname
-compound [name ...] compoundname
-
-**emptycopy **returns an empty shape with the same orientation, location, and geometry as the target shape, but with no sub-shapes. If the newname argument is not given, the new shape is stored with the same name. This command is used to modify a frozen shape. A frozen shape is a shape used by another one. To modify it, you must emptycopy it. Its subshape may be reinserted with the **add **command.
-
-**add **inserts shape C into shape S. Verify that C and S reference compatible types of objects:
-
- * Any *Shape *can be added to a *Compound*.
- * Only a *Solid *can be added to a *CompSolid*.
- * Only a *Shell*, an *Edge *or a *Vertex *can be added into a *Solid*.
- * Only a *Face *can be added to a *Shell*.
- * Only a *Wire *and *Vertex *can be added in a *Solid*.
- * Only an *Edge *can be added to a *Wire*.
- * Only a *Vertex *can be added to an *Edge*.
- * Nothing can be added to a *Vertex*.
-
-Care should be taken using **emptycopy **and **add**.
-
-On the other hand, **compound **is a safe way to achieve a similar result. It creates a compound from shapes. If no shapes are given, the compound is empty.
-**Example**
-
-# a compound with three boxes
-box b1 0 0 0 1 1 1
-box b2 3 0 0 1 1 1
-box b3 6 0 0 1 1 1
-compound b1 b2 b3 c
-
-
-@subsubsection occt_2142243456_1869436669715 checkshape
-
-Syntax: checkshape [-top] shape [result] [-short]
-
-Where:
-*-top* – check only topological validity of a shape.
-*shape *– the only required parameter which represents the name of the shape to check.
-*result* – optional parameter which is the prefix of the output shape names.
-*-short* – short description of check.
-
-
-**checkshape **examines the selected object for topological and geometric coherence. The object should be a three dimensional shape.
-**Example**
-
-# checkshape returns a comment valid or invalid
-box b1 0 0 0 1 1 1
-checkshape b1
-# returns the comment
-this shape seems to be valid
-
-<h4>NOTE</h4>
-*This test is performed using the tolerance set in the algorithm.*
-
-
-
-
-
-@subsection occt_2142243456_186943666972 Curve and surface topology
-
-This group of commands is used to create topology from shapes and to extract shapes from geometry.
-
- * To create vertices, use the **vertex **command.
- * To create edges use, the **edge**, **mkedge **commands.
- * To create wires, use the **wire**, **polyline**, **polyvertex **commands.
- * To create faces, use the **mkplane**, **mkface **commands.
- * To extract the geometry from edges or faces, use the **mkcurve **and **mkface **commands.
- * To extract the 2d curves from edges or faces, use the **pcurve **command.
-
-
-@subsubsection occt_2142243456_1869436669721 vertex
-
-Syntax: vertex name [x y z / p edge]
-
-Creates a vertex at either a 3d location x,y,z or the point at parameter p on an edge.
-**Example**
-
-vertex v1 10 20 30
-
-
-@subsubsection occt_2142243456_1869436669722 edge, mkedge, uisoedge, visoedge
-
-Syntax: edge name vertex1 vertex2
-mkedge edge curve [surface] [pfirst plast] [vfirst [pfirst] vlast [plast]]
-uisoedge edge face u v1 v2
-visoedge edge face v u1 u2
-
-**edge **creates a straight line edge between two vertices.
-
-**mkedge **generates edges from curves<a href="#_ftn4">[4]</a>.Two parameters can be given for the vertices: the first and last parameters of the curve are given by default. Vertices can also be given with their parameters, this option allows you to block the creation of new vertices. If the parameters of the vertices are not given, they are computed by projection on the curve. Instead of a 3d curve, a 2d curve and a surface can be given.
-**Example**
-
-# straight line edge
-vertex v1 10 0 0
-vertex v2 10 10 0
-edge e1 v1 v2
-
-# make a circular edge
-circle c 0 0 0 5
-mkedge e2 c 0 pi/2
-
-# A similar result may be achieved by trimming the curve
-# The trimming is removed by mkedge
-trim c c 0 pi/2
-mkedge e2 c
-
-**visoedge **and **uisoedge **are commands that generate a uiso parameter edge
-or a viso parameter edge.
-
-**Example**
-
-# to create an edge between v1 and v2 at point u
-# to create the example plane
-plane p
-trim p p 0 1 0 1
-convert p p
-incudeg p 3
-incvdeg p 3
-movep p 2 2 0 0 1
-movep p 3 3 0 0 0.5
-mkface p p
-# to create the edge in the plane at the u axis point
-0.5, and between the v axis points v=0.2 and v =0.8
-uisoedge e p 0.5 0.20 0.8
-
-
-@subsubsection occt_2142243456_1869436669723 wire, polyline, polyvertex
-
-Syntax: wire wirename e1/w1 [e2/w2 ...]
-polyline name x1 y1 z1 x2 y2 z2 ...
-polyvertex name v1 v2 ...
-
-**wire **creates a wire from edges or wires. The order of the elements should ensure that the wire is connected, and vertex locations will be compared to detect connection. If the vertices are different, new edges will be created to ensure topological connectivity. The original edge may be copied in the new one.
-
-**polyline **creates a polygonal wire from point coordinates. To make a closed wire, you should give the first point again at the end of the argument list.
-
-**polyvertex **creates a polygonal wire from vertices.
-**Example**
-
-# create two polygonal wires
-# glue them and define as a single wire
-polyline w1 0 0 0 10 0 0 10 10 0
-polyline w2 10 10 0 0 10 0 0 0 0
-wire w w1 w2
-
-
-@subsubsection occt_2142243456_1869436669724 profile
-
-Syntax profile name [code values] [code values] ...
-
-**Code** **Values ** **Action**
-O X Y Z Sets the origin of the plane
-P DX DY DZ UX UY UZ Sets the normal and X of the plane
-F X Y Sets the first point
-X DX Translates a point along X
-Y DY Translates a point along Y
-L DL Translates a point along direction
-XX X Sets point X coordinate
-YY Y Sets point Y coordinate
-T DX DY Translates a point
-TT X Y Sets a point
-R Angle Rotates direction
-RR Angle Sets direction
-D DX DY Sets direction
-IX X Intersects with vertical
-IY Y Intersects with horizontal
-C Radius Angle Arc of circle tangent to direction
-
-<h5>Suffix</h5>
-No suffix Makes a closed face
-W Make a closed wire
-WW Make an open wire
-
-
-**profile **builds a profile in a plane using a moving point and direction. By default, the profile is closed and a face is created. The original point is 0 0, and direction is 1 0 situated in the XY plane.
-
-Codes and values are used to define the next point or change the direction. When the profile changes from a straight line to a curve, a tangent is created. All angles are in degrees and can be negative.
-
-The point [code values] can be repeated any number of times and in any order to create the profile contour.
-
-The profile shape definition is the suffix; no suffix produces a face, **w **is a closed wire, **ww **is an open wire.
-
-Code letters are not case-sensitive.
-**Example**
-
-# to create a trianglular plane using a vertex at the
-origin, in the xy plane
-profile p O 0 0 0 X 1 Y 0 x 1 y 1
-**Example**
-
-# to create a contour using the different code
-possibilities
-
-# two vertices in the xy plane
-profile p F 1 0 x 2 y 1 ww
-
-# to view from a point normal to the plane
-top
-
-# add a circular element of 45 degrees
-profile p F 1 0 x 2 y 1 c 1 45 ww
-
-# add a tangential segment with a length value 1
-profile p F 1 0 x 2 y 1 c 1 45 l 1 ww
-
-# add a vertex with xy values of 1.5 and 1.5
-profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 ww
-
-# add a vertex with the x value 0.2, y value is constant
-profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 ww
-
-# add a vertex with the y value 2 x value is constant
-profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 yy 2 ww
-
-# add a circular element with a radius value of 1 and a circular value of 290 degrees
-profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 yy 2 c 1 290
-
-# wire continues at a tangent to the intersection x = 0
-profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 yy 2 c 1 290 ix 0 ww
-
-# continue the wire at an angle of 90 degrees until it intersects the y axis at y= -o.3
-profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 yy 2 c 1 290 ix 0 r 90 ix -0.3 ww
-
-#close the wire
-profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 yy 2 c 1 290 ix 0 r 90 ix -0.3 w
-
-# to create the plane with the same contour
-profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 yy 2 c 1 290 ix 0 r 90 ix -0.3
-
-
-@subsubsection occt_2142243456_1869436669725 bsplineprof
-
-Syntax: bsplineprof name [S face] [W WW]
-
-for an edge : digitizes ... mouse button 2
-to end profile : mouse button 3
-
-Build a profile in the XY plane from digitizes
-By default the profile is closed and a face is built.
-
-W Make a closed wire
-WW Make an open wires
-
-**bsplineprof **creates a 2d profile from bspline curves using the mouse as the input. MB1 creates the points, MB2 finishes the current curve and starts the next curve, MB3 closes the profile.
-
-The profile shape definition is the suffix; no suffix produces a face, **w **is a closed wire, **ww **is an open wire.
-**Example**
-
-#to view the xy plane
-top
-#to create a 2d curve with the mouse
-bsplineprof res
-# click mb1 to start the curve
-# click mb1 to create the second vertex
-# click mb1 to create a curve
-==
-#click mb2 to finish the curve and start a new curve
-==
-# click mb1 to create the second curve
-# click mb3 to create the face
-
-
-@subsubsection occt_2142243456_1869436669726 mkoffset
-
-Syntax: mkoffset result face/compound of wires nboffset stepoffset
-
-**mkoffset **creates a parallel wire in the same plane using a face or an existing continuous set of wires as a reference. The number of occurences is not limited.
-
-The offset distance defines the spacing and the positionning of the occurences.
-**Example**
-
-#Create a box and select a face
-box b 1 2 3
-explode b f
-#Create three exterior parallel contours with an offset
-value of 2
-mkoffset r b_1 3 2
-Create one interior parallel contour with an offset
-value of
-0.4
-mkoffset r b_1 1 -0.4
-
-NOTE
-*The mkoffset command must be used with prudence, angular contours produce offset contours with fillets. Interior parallel contours can produce more than one wire, normally these are refused. In the following example, any increase in the offset value is refused*
-**Example**
-
-# to create the example contour
-profile p F 0 0 x 2 y 4 tt 1 1 tt 0 4 w
-# to create an incoherent interior offset
-mkoffset r p 1 -0.50
-==p is not a FACE but a WIRE
-BRepFill_TrimEdgeTool: incoherent intersection
-# to create two incoherent wires
-mkoffset r p 1 -0.50
-
-
-@subsubsection occt_2142243456_1869436669727 mkplane, mkface
-
-Syntax: mkplane name wire
-mkface name surface [ufirst ulast vfirst vlast]
-
-**mkplane **generates a face from a planar wire. The planar surface will be constructed with an orientation which keeps the face inside the wire.
-
-**mkface **generates a face from a surface. Parameter values can be given to trim a rectangular area. The default boundaries are those of the surface.
-**Example**
-
-# make a polygonal face
-polyline f 0 0 0 20 0 0 20 10 0 10 10 0 10 20 0 0 20 0 0 0 0
-mkplane f f
-
-# make a cylindrical face
-cylinder g 10
-trim g g -pi/3 pi/2 0 15
-mkface g g
-
-
-@subsubsection occt_2142243456_1869436669728 mkcurve, mksurface
-
-Syntax: mkcurve curve edge
-mksurface name face
-
-**mkcurve **creates a 3d curve from an edge. The curve will be trimmed to the edge boundaries.
-
-**mksurface **creates a surface from a face. The surface will not be trimmed.
-**Example**
-
-# make a line
-vertex v1 0 0 0
-vertex v2 10 0 0
-edge e v1 v2
-
-
-@subsubsection occt_2142243456_1869436669729 pcurve
-
-Syntax: pcurve [name edgename] facename
-
-**pcurve **extracts the 2d curve of an edge on a face. If only the face is specified, the command extracts all the curves and colors them according to their orientation. This is useful in checking to see if the edges in a face are correctly oriented, i.e. they turn counterclockwise. To make curves visible, use a fitted 2d view.
-**Example**
-
-# view the pcurves of a face
-plane p
-trim p p -1 1 -1 1
-mkface p p
-av2d; # a 2d view
-pcurve p
-2dfit
-
-
-@subsubsection occt_2142243456_18694366697210 chfid
-
-Syntax: chfi2d result face [edge1 edge2 (F radius/CDD d1 d2/CDA d ang) ....
-
-chfi2d creates chamfers and fillets on 2D objects. Select t:wo adjacent edges and:
-
- * a radius value
- * two respective distance values
- * a distance value and an angle
-
-The radius value produces a fillet between the two faces.
-
-The distance is the length value from the edge between the two selected faces in a normal direction.
-
-**Example**
-
-# to create a 2d fillet
-top
-profile p x 2 y 2 x -2
-chfi2d cfr p . . F 0.3
-==Pick an object
-#select an edge
-==Pick an object
-#select an edge
-**Example**
-
-# to create a 2d chamfer using two distances
-profile p x 2 y 2 x -2
-chfi2d cfr p . . CDD 0.3 0.6
-==Pick an object
-#select an edge
-==Pick an object
-#select an edge
-**Example**
-
-# to create a 2d chamfer using a defined distance and
-angle
-top
-profile p x 2 y 2 x -2
-chfi2d cfr p . . CDA 0.3 75
-==Pick an object
-#select an edge
-==Pick an object
-#select an edge
-
-
-@subsubsection occt_2142243456_18694366697211 nproject
-
-Syntax: nproject pj e1 e2 e3 ... surf -g -d [dmax] [Tol
-[continuity [maxdeg [maxseg]]]
-
-**nproject **creates a shape projection which is normal to the target surface.
-<h5>Example</h5>
-
-# create a curved surface
-line l 0 0 0 1 0 0
-trim l l 0 2
-convert l l
-
-incdeg l 3
-cmovep l 1 0 0.5 0
-cmovep l 3 0 0.5 0
-copy l ll
-translate ll 2 -0.5 0
-mkedge e1 l
-mkedge e2 ll
-wire w e1 e2
-prism p w 0 0 3
-donl p
-#display in four views
-mu4
-fit
-# create the example shape
-circle c 1.8 -0.5 1 0 1 0 1 0 0 0.4
-mkedge e c
-donly p e
-# create the normal projection of the shape(circle)
-nproject r e p
-
-
-
-@subsection occt_2142243456_186943666973 Primitives
-
-Primitive commands make it possible to create simple shapes. They include:
-
- * **box **and **wedge **commands.
- * **pcylinder**, **pcone**, **psphere**, **ptorus **commands.
- * **halfspace **command
-
-
-@subsubsection occt_2142243456_1869436669731 box, wedge
-
-Syntax: box name [x y z] dx dy dz
-wedge name dx dy dz ltx / xmin zmin xmax xmax
-
-**box **creates a box parallel to the axes with dimensions dx,dy,dz. x,y,z is the corner of the box. It is the default origin.
-
-**wedge **creates a box with five faces called a wedge. One face is in the OXZ plane, and has dimensions dx,dz while the other face is in the plane y = dy. This face either has dimensions ltx, dz or is bounded by xmin,zmin,xmax,zmax.
-
-The other faces are defined between these faces. The face in the y=yd plane may be degenerated into a line if ltx = 0, or a point if xmin = xmax and ymin = ymax. In these cases, the line and the point both have 5 faces each. To position the wedge use the **ttranslate **and **trotate **commands.
-**Example**
-
-# a box at the origin
-box b1 10 20 30
-
-# another box
-box b2 30 30 40 10 20 30
-
-# a wedge
-wedge w1 10 20 30 5
-
-# a wedge with a sharp edge (5 faces)
-wedge w2 10 20 30 0
-
-# a pyramid
-wedge w3 20 20 20 10 10 10 10
-
-
-@subsubsection occt_2142243456_1869436669732 pcylinder, pcone, psphere, ptorus
-
-Syntax: pcylinder name [plane] radius height [angle]
-pcone name [plane] radius1 radius2 height [angle]
-pcone name [plane] radius1 radius2 height [angle]
-psphere name [plane] radius1 [angle1 angle2] [angle]
-ptorus name [plane] radius1 radius2 [angle1 angle2] [angle]
-
-All these commands create solid blocks in the default coordinate system, using the Z axis as the axis of revolution and the X axis as the origin of the angles. To use another system, translate and rotate the resulting solid or use a plane as first argument to specify a coordinate system. All primitives have an optional last argument which is an angle expreesed in degrees and located on the Z axis, starting from the X axis. The default angle is 360.
-
-**pcylinder **creates a cylindrical block with the given radius and height.
-
-**pcone **creates a truncated cone of the given height with radius1 in the plane z = 0 and radius2 in the plane z = height. Neither radius can be negative, but one of them can be null.
-
-**psphere **creates a solid sphere centered on the origin. If two angles, *angle1 *and *angle2, *are given, the solid will be limited by two planes at latitude *angle1 *and *angle2*. The angles must be increasing and in the range -90,90.
-
-**ptorus **creates a solid torus with the given radii, centered on the origin, which is a point along the z axis. If two angles increasing in degree in the range 0 – 360 are given, the solid will be bounded by two planar surfaces at those positions on the circle.
-**Example**
-
-# a can shape
-pcylinder cy 5 10
-
-# a quarter of a truncated cone
-pcone co 15 10 10 90
-
-# three-quarters of sphere
-psphere sp 10 270
-
-# half torus
-ptorus to 20 5 0 90
-@subsubsection occt_2142243456_1869436669733 halfspace
-
-Syntax: halfspace result face/shell x y z
-
-**halfspace **creates an infinite solid volume based on a face in a defined direction. This volume can be used to perform the boolean operation of cutting a solid by a face or plane.
-**Example**
-
-box b 0 0 0 1 2 3
-explode b f
-==b_1 b_2 b_3 b_4 b_5 b_6
-halfspace hr b_3 0.5 0.5 0.5
-
-
-
-@subsection occt_2142243456_186943666974 Sweeping
-
-Sweeping creates shapes by sweeping out a shape along a defined path:
-
- * **prism **sweeps along a direction.
- * **revol **sweeps around an axis.
- * **pipe **sweeps along a wire.
- * **mksweep **and **buildsweep **are commands to create sweeps by defining the arguments and algorithms.
- * **thrusections **creates a sweep from wire in different planes.
-
-
-@subsubsection occt_2142243456_1869436669741 prism
-
-Syntax: prism result base dx dy dz [Copy | Inf | SemiInf]
-
-**prism **creates a new shape by sweeping a shape in a direction. Any shape can be swept: a vertex gives an edge; an edge gives a face; and a face gives a solid.
-
-The shape is swept along the vector dx dy dz. The original shape will be shared in the result unless *Copy *is specified. If *Inf *is specified the prism is infinite in both directions. If *SemiInf *is specified the prism is infinite in the dx,dy,dz direction, and the length of the vector has no importance.
-**Example**
-
-# sweep a planar face to make a solid
-polyline f 0 0 0 10 0 0 10 5 0 5 5 0 5 15 0 0 15 0 0 0 0
-mkplane f f
-
-
-@subsubsection occt_2142243456_1869436669742 revol
-
-Syntax: revol result base x y z dx dy dz angle [Copy]
-
-**revol **creates a new shape by sweeping a base shape through an angle along the axis x,y,z dx,dy,dz. As with the prism command, the shape can be of any type and is not shared if *Copy *is specified.
-**Example**
-
-# shell by wire rotation
-polyline w 0 0 0 10 0 0 10 5 0 5 5 0 5 15 0 0 15 0
-revol s w 20 0 0 0 1 0 90
-
-
-
-@subsubsection occt_2142243456_1869436669743 pipe
-
-Syntax: pipe name wire_spine Profile
-
-**pipe **creates a new shape by sweeping a shape known as the profile along a wire known as the spine.
-**Example**
-
-# sweep a circle along a bezier curve to make a solid
-pipe
-
-beziercurve spine 4 0 0 0 10 0 0 10 10 0 20 10 0
-mkedge spine spine
-wire spine spine
-circle profile 0 0 0 1 0 0 2
-mkedge profile profile
-wire profile profile
-mkplane profile profile
-pipe p spine profile
-
-
-@subsubsection occt_2142243456_1869436669744 mksweep, deletesweep, buildsweep, simulsweep
-
-Syntax: mksweep wire
-addsweep wire[vertex][-M][-C] [auxiilaryshapedeletesweep wire
-setsweep options [arg1 [arg2 [...]]]
-
-options are :
-
--FR : Tangent and Normal are defined by a Frenet trihedron
--CF : Tangent is given by Frenet,
-the Normal is computed to minimize the torsion
--DX Surf : Tangent and Normal are given by Darboux trihedron,
-Surf must be a shell or a face
--CN dx dy dz : BiNormal is given by dx dy dz
--FX Tx Ty TZ [Nx Ny Nz] : Tangent and Normal are fixed
--G guide 0|1(AC
-simulsweep r [n] [option]
-buildsweep [r] [option] [Tol]
-
-These commands are used to create a shape from wires. One wire is designated as the contour that defines the direction; it is called the spine. At least one other wire is used to define the the sweep profile.
-
-**mksweep **initializes the sweep creation and defines the wire to be used as the spine.
-
-**addsweep **defines the wire to be used as the profile.
-
-**deletesweep **cancels the choice of profile wire, without leaving the mksweep mode. You can re-select a profile wire.
-
-**setsweep **commands the algorithms used for the construction of the sweep.
-
-**simulsweep **can be used to create a preview of the shape. [n] is the number of sections that are used to simulate the sweep.
-
-**buildsweep **creates the sweep using the arguments defined by all the commands.
-**Example**
-
-#create a sweep based on a semi-circular wire using the
-Frenet algorithm
-#create a circular figure
-circle c2 0 0 0 1 0 0 10
-trim c2 c2 -pi/2 pi/2
-mkedge e2 c2
-donly e2
-wire w e2
-whatis w
-mksweep w
-# to display all the options for a sweep
-setsweep
-#to create a sweep using the Frenet algorithm where the
-#normal is computed to minimise the torsion
-setsweep -CF
-addsweep w -R
-# to simulate the sweep with a visual approximation
-simulsweep w 3
-
-
-@subsubsection occt_2142243456_1869436669745 thrusections
-
-Syntax: thrusections [-N] result issolid isruled wire1 wire2 [..wire..]
-
-**thrusections **creates a shape using wires that are positioned in different planes. Each wire selected must have the same number of edges and vertices.
-A bezier curve is generated between the vertices of each wire. The option [-N] means no check is made on wires for direction.
-**Example**
-
-#create three wires in three planes
-polyline w1 0 0 0 5 0 0 5 5 0 2 3 0
-polyline w2 0 1 3 4 1 3 4 4 3 1 3 3
-polyline w3 0 0 5 5 0 5 5 5 5 2 3 5
-# create the shape
-thrusections th issolid isruled w1 w2 w3
-==thrusections th issolid isruled w1 w2 w3
-Tolerances obtenues -- 3d : 0
--- 2d : 0
-
-
-
-
-
-@subsection occt_2142243456_186943666975 Topological transformation
-
-Transformations are applications of matrices. When the transformation is nondeforming, such as translation or rotation, the object is not copied. The topology localcoordinate system feature is used. The copy can be enforced with the **tcopy **command.
-
- * **tcopy **makes a copy of the structure of a shape.
- * **ttranslate**, **trotate**, **tmove**, **reset **move a shape.
- * **tmirror**, **tscale **always modify the shape.
-
-
-@subsubsection occt_2142243456_1869436669751 tcopy
-
-Syntax: tcopy name toname [name toname ...]
-
-Copies the structure of one shape, including the geometry, into another, newer shape.
-**Example**
-
-# create an edge from a curve and copy it
-beziercurve c 3 0 0 0 10 0 0 20 10 0
-mkedge e1 c
-ttranslate e1 0 5 0
-tcopy e1 e2
-ttranslate e2 0 5 0
-# now modify the curve, only e1 and e2 will be modified
-
-@subsubsection occt_2142243456_1869436669752 tmove, treset
-
-Syntax: tmove name [name ...] shape
-reset name [name ...]
-
-**tmove **and **reset **modify the location, or the local coordinate system of a shape.
-
-**tmove **applies the location of a given shape to other shapes. **reset **restores one or several shapes it to its or their original coordinate system(s).
-**Example**
-
-# create two boxes
-box b1 10 10 10
-box b2 20 0 0 10 10 10
-# translate the first box
-ttranslate b1 0 10 0
-# and apply the same location to b2
-tmove b2 b1
-# return to original positions
-reset b1 b2
-
-
-@subsubsection occt_2142243456_1869436669753 ttranslate, trotate
-
-Syntax: ttranslate [name ...] dx dy dz
-trotate [name ...] x y z dx dy dz angle
-
-**ttranslate **translates a set of shapes by a given vector, and **trotate **rotates them by a given angle around an axis. Both commands only modify the location of the shape.
-When creating multiple shapes, the same location is used for all the shapes. (See toto.tcl example below. Note that the code of this file can also be directly executed in interactive mode.)
-
-Locations are very economic in the data structure because multiple occurences of an object share the topological description.
-**Example**
-# make rotated copies of a sphere in between two cylinders
-# create a file source toto.tcl
-# toto.tcl code:
-for {set i 0} {$i 360} {incr i 20} {
-copy s s$i
-trotate s$i 0 0 0 0 0 1 $i
-}
-
-# create two cylinders
-pcylinder c1 30 5
-copy c1 c2
-ttranslate c2 0 0 20
-
-#create a sphere
-psphere s 3
-ttranslate s 25 0 12.5
-
-# call the source file for multiple copies
-source toto.tcl
-
-
-@subsubsection occt_2142243456_1869436669754 tmirror, tscale
-
-Syntax: tmirror name x y z dx dy dz
-tscale name x y z scale
-
-**tmirror **makes a mirror copy of a shape about a plane x,y,z dx,dy,dz. **Tscale **applies a central homotopic mapping to a shape.
-**Example**
-
-# mirror a portion of cylinder about the YZ plane
-pcylinder c1 10 10 270
-copy c1 c2
-tmirror c2 15 0 0 1 0 0
-# and scale it
-tscale c1 0 0 0 0.5
-
-
-
-@subsection occt_2142243456_186943666976 Old Topological operations
-
-
-
- * **fuse**, **cut**, **common **are boolean operations.
- * **section**, **psection **compute sections.
- * **sewing **joins two or more shapes.
-
-
-@subsubsection occt_2142243456_1869436669761 fuse, cut, common
-
-Syntax: fuse name shape1 shape2
-cut name shape1 shape2
-common name shape1 shape2
-
-**fuse **creates a new shape by a boolean operation on two existing shapes. The new shape contains both originals intact.
-
-**cut **creates a new shape which contains all parts of the second shape but only the first shape without the intersection of the two shapes.
-
-**common **creates a new shape which contains only what is in common between the two original shapes in their intersection.
-**Example**
-
-# all four boolean operations on a box and a cylinder
-
-box b 0 -10 5 20 20 10
-pcylinder c 5 20
-
-fuse s1 b c
-ttranslate s1 40 0 0
-
-cut s2 b c
-ttranslate s2 -40 0 0
-
-cut s3 c b
-ttranslate s3 0 40 0
-
-common s4 b c
-ttranslate s4 0 -40 0
-
-
-
-@subsubsection occt_2142243456_1869436669762 section, psection
-
-Syntax: section result shape1 shape2
-psection name shape plane
-
-**section **creates a compound object consisting of the edges for the intersection curves on the faces of two shapes.
-
-**psection **creates a planar section consisting of the edges for the intersection curves on the faces of a shape and a plane.
-**Example**
-
-# section line between a cylinder and a box
-pcylinder c 10 20
-box b 0 0 5 15 15 15
-trotate b 0 0 0 1 1 1 20
-section s b c
-
-# planar section of a cone
-pcone c 10 30 30
-plane p 0 0 15 1 1 2
-psection s c p
-
-
-@subsubsection occt_2142243456_1869436669763 sewing
-
-Syntax: sewing result [tolerance] shape1 shape2 ...
-
-**Sewing **joins shapes by connecting their adjacent or near adjacent edges. Adjacency can be redefined by modifying the tolerance value.
-
-**Example**
-
-# create two adjacent boxes
-box b 0 0 0 1 2 3
-box b2 0 2 0 1 2 3
-sewing sr b b2
-whatis sr
-sr is a shape COMPOUND FORWARD Free Modified
-
-
-@subsection occt_2142243456_186943666977 New Topological operations
-
-
-The new algorithm of Boolean operations avoids a large number of weak points and limitations presented in the old boolean operation algorithm.
-
-
-@subsubsection occt_2142243456_1869436669771 bop, bopfuse, bopcut, boptuc, bopcommon,
-
-**bop** defines **shape1** and **shape2** subject to ulterior Boolean operations
-
-**bopfuse **creates a new shape by a boolean operation on two existing shapes. The new shape contains both originals intact.
-
-**bopcut **creates a new shape which contains all parts of the second shape but only the first shape without the intersection of the two shapes.
-
-**boptuc **is a reverced** bopcut**.
-
-**bopcommon **creates a new shape which contains only whatever is in common between the two original shapes in their intersection.
-
-
-Syntax: bop shape1 shape2
-bopcommon result
-bopfuse result
-bopcut result
-boptuc result
-
-These commands have short variants:
-
-bcommon result shape1 shape2
-bfuse result shape1 shape2
-bcut result shape1 shape2
-
-
-**bop** fills data structure (DS) of boolean operation for **shape1** and **shape2**.
-**bopcommon, bopfuse, bopcut, boptuc **commands used after **bop** command. After one **bop** command it is possible to call several commands from the list above. For example: **bop** S1 S2; **bopfuse** R.
-
-**Example**
-
-# all four boolean operations on a box and a cylinder
-
-box b 0 -10 5 20 20 10
-pcylinder c 5 20
-
-# fills data structure
-bop b c
-
-bopfuse s1
-ttranslate s1 40 0 0
-
-bopcut s2
-ttranslate s2 -40 0 0
-
-boptuc s3
-ttranslate s3 0 40 0
-
-bopcommon s4
-ttranslate s4 0 -40 0
-
-
-Short variants of commands:
-
-bfuse s11 b c
-ttranslate s11 40 0 100
-
-bcut s12 b c
-ttranslate s12 -40 0 100
-
-bcommon s14 b c
-ttranslate s14 0 -40 100
-
-@subsubsection occt_2142243456_1869436669772 bopsection
-
-**bopsection **creates a compound object consisting of the edges for the intersection curves on the faces of two shapes.
-
-
-Syntax: bop shape1 shape2
-bopsection result
-
-
-
-Short variant:
-
-bsection result shape1 shape2 [-2d/-2d1/-2s2] [-a]
-
-
-**bop** fills data structure (DS) of boolean operation for **shape1** and **shape2**.
-**bopsection** command used after **bop** command.
-
-**-2d** - PCurves are computed on both parts.
-**-2d1** - PCurves are computed on first part.
-**-2d2 **- PCurves are computed on second part.
-**-a** - geometries built are approximated.
-
-
-**Example**
-
-# section line between a cylinder and a box
-pcylinder c 10 20
-box b 0 0 5 15 15 15
-trotate b 0 0 0 1 1 1 20
-bop b c
-bopsection s
-# Short variant:
-bsection s2 b c
-
-
-@subsubsection occt_2142243456_1869436669773 bopcheck, bopargshape
-
-Syntax: bopcheck shape
-bopargcheck shape1 [[shape2] [-F/O/C/T/S/U] [/R|F|T|V|E|I|P]] [#BF]
-
-
-**bopcheck** checks a shape for self-interference.
-
-**bopargcheck** checks the validity of argument(s) for boolean operations.
-
--Boolean Operation
- **F** (fuse)
- **O** (common)
- **C** (cut)
- **T** (cut21)
- **S** (section)
- **U** (unknown)
-By default a section is made.
-
- /Test Options
- **R** (disable small edges (shrank range) test)
- **F** (disable faces verification test)
- **T** (disable tangent faces searching test)
- **V** (disable test possibility to merge vertices)
- **E** (disable test possibility to merge edges)
- **I** (disable self-interference test)
- **P** (disable shape type test)
-By default all options are enabled.
-
- #Additional Test Options
- **B** (stop test on first faulty found); default OFF
- **F** (full output for faulty shapes);
-**By **default the output is made in a short format.
-
- NOTE: Boolean Operation and Test Options are used only for a couple of argument shapes, except for **I** and **P** options that are always used to test a couple of shapes as well as a single shape.
-
-**Example**
-
-# checks a shape on self-interference
-box b1 0 0 0 1 1 1
-bopcheck b1
-
-# checks the validity of argument for boolean cut operations
-box b2 0 0 0 10 10 10
-bopargcheck b1 b2 -C
-
-
-@subsection occt_2142243456_186943666978 Drafting and blending
-
-Drafting is creation of a new shape by tilting faces through an angle.
-
-Blending is the creation of a new shape by rounding edges to create a fillet.
-
- * Use the **depouille **command for drafting.
- * Use the **chamf **command to add a chamfer to an edge
- * Use the **blend **command for simple blending.
- * Use **fubl **for a fusion + blending operation.
- * Use **buildevol**, **mkevol**, **updatevol **to realize varying radius blending.
-
-
-@subsubsection occt_2142243456_1869436669781 depouille
-
-Syntax: dep result shape dirx diry dirz face angle x y x dx dy dz [face angle...]
-
-**depouille **creates a new shape by drafting one or more faces of a shape.
-
-Identify the shape(s) to be drafted, the drafting direction, and the face(s) with an angle and an axis of rotation for each face. You can use dot syntax to identify the faces.
-**Example**
-# draft a face of a box
-box b 10 10 10
-explode b f
-== b_1 b_2 b_3 b_4 b_5 b_6
-
-dep a b 0 0 1 b_2 10 0 10 0 1 0 5
-
-
-@subsubsection occt_2142243456_1869436669782 chamf
-
-Syntax: chamf newname shape edge face S dist
-chamf newname shape edge face dist1 dist2
-chamf newname shape edge face A dist angle
-
-**chamf **creates a chamfer along the edge between faces using:
-
- * a equal distances from the edge
- * the edge, a face and distance, a second distance
- * the edge, a reference face and an angle
-
-Use the dot syntax to select the faces and edges.
-<h5>Example</h5>
-
-# to create a chamfer based on equal distances from the
-edge (45 degree angle)
-# create a box
-box b 1 2 3
-chamf ch b . . S 0.5
-==Pick an object
-# select an edge
-==Pick an object
-# select an adjacent face
-**Example**
-
-# to create a chamfer based on different distances from
-the selected edge
-box b 1 2 3
-chamf ch b . . 0.3 0.4
-==Pick an object
-# select an edge
-==Pick an object
-# select an adjacent face
-**Example**
-
-# to create a chamfer based on a distance from the edge
-and an angle
-box b 1 2 3
-chamf ch b . . A 0.4 30
-==Pick an object
-# select an edge
-==Pick an object
-# select an adjacent face
-
-
-@subsubsection occt_2142243456_1869436669783 blend
-
-Syntax: blend result object rad1 ed1 rad2 ed2 ... [R/Q/P]
-
-**blend **creates a new shape by filleting the edges of an existing shape. The edge must be inside the shape. You may use the dot syntax. Note that the blend is propagated to the edges of tangential planar, cylindrical or conical faces.
-**Example**
-
-# blend a box, click on an edge
-box b 20 20 20
-blend b b 2 .
-==tolerance ang : 0.01
-==tolerance 3d : 0.0001
-==tolerance 2d : 1e-05
-==fleche : 0.001
-==tolblend 0.01 0.0001 1e-05 0.001
-==Pick an object
-# click on the edge you want ot fillet
-
-==COMPUTE: temps total 0.1s dont :
-==- Init + ExtentAnalyse 0s
-==- PerformSetOfSurf 0.02s
-==- PerformFilletOnVertex 0.02s
-==- FilDS 0s
-==- Reconstruction 0.06s
-==- SetRegul 0s
-
-
-@subsubsection occt_2142243456_1869436669784 fubl
-
-Syntax: fubl name shape1 shape2 radius
-** **
-**fubl **creates a boolean fusion of two shapes and then blends (fillets) the intersection edges using the given radius.
-**Example**
-
-# fuse-blend two boxes
-box b1 20 20 5
-copy b1 b2
-ttranslate b2 -10 10 3
-fubl a b1 b2 1
-See also: **fuse**, **blend**
-
-
-@subsubsection occt_2142243456_1869436669785 mkevol, updatevol, buildevol
-
-Syntax: mkevol result object (then use updatevol) [R/Q/P]
-updatevol edge u1 radius1 [u2 radius2 ...]
-buildevol
-
-These three commands work together to create fillets with evolving radii.
-
-**mkevol **allows you to specify the shape and the name of the result. It returns the tolerances of the fillet.
-
-**updatevol **allows you to describe the filleted edges you want to create. For each edge, you give a set of coordinates: parameter and radius and the command prompts you to pick the edge of the shape which you want to modify. The parameters will be calculated along the edges and the radius function applied to the whole edge.
-
-**buildevol **produces the result described previously in **mkevol **and **updatevol**.
-**Example**
-
-# makes an evolved radius on a box
-box b 10 10 10
-mkevol b b
-==tolerance ang : 0.01
-==tolerance 3d : 0.0001
-==tolerance 2d : 1e-05
-==fleche : 0.001
-==tolblend 0.01 0.0001 1e-05 0.001
-
-# click an edge
-updatevol . 0 1 1 3 2 2
-==Pick an object
-
-buildevol
-==Dump of SweepApproximation
-==Error 3d = 1.28548881203818e-14
-==Error 2d = 1.3468326936926e-14 ,
-==1.20292299999388e-14
-==2 Segment(s) of degree 3
-
-==COMPUTE: temps total 0.91s dont :
-==- Init + ExtentAnalyse 0s
-==- PerformSetOfSurf 0.33s
-==- PerformFilletOnVertex 0.53s
-==- FilDS 0.01s
-==- Reconstruction 0.04s
-==- SetRegul 0s
-
-
-
-@subsection occt_2142243456_186943666979 Topological analysis
-
-Analysis of shapes includes commands to compute length, area, volumes and inertial properties.
-
- * Use **lprops**, **sprops**, **vprops **to compute integral properties.
- * Use **bounding **to display the bounding box of a shape.
- * Use **distmini **to calculate the minimum distance between two shapes.
-
-
-
-
-@subsubsection occt_2142243456_1869436669791 lprops, sprops, vprops
-
-Syntax: lprops shape
-sprops shape
-vprops shape
-
-**lprops **computes the mass properties of all edges in the shape with a linear density of 1, **sprops **of all faces with a surface density of 1 and **vprops **of all solids with a density of 1.
-
-All three commands print the mass, the coordinates of the center of gravity, the matrix of inertia and the moments. Mass is either the length, the area or the volume. The center and the main axis of inertia are displayed.
-**Example**
-
-# volume of a cylinder
-pcylinder c 10 20
-vprops c
-== results
-Mass : 6283.18529981086
-
-Center of gravity :
-X = 4.1004749224903e-06
-Y = -2.03392858349861e-16
-Z = 9.9999999941362
-
-Matrix of Inertia :
-366519.141445068 5.71451850691484e-12
-0.257640437382627
-5.71451850691484e-12 366519.141444962
-2.26823064169991e-10 0.257640437382627
-2.26823064169991e-10 314159.265358863
-
-Moments :
-IX = 366519.141446336
-IY = 366519.141444962
-I.Z = 314159.265357595
-
-
-
-@subsubsection occt_2142243456_1869436669792 bounding
-
-Syntax: bounding shape
-
-Displays the bounding box of a shape. The bounding box is a cuboid created with faces parallel to the x, y, and z planes. The command returns the dimension values of the the box, *xmin ymin zmin xmax ymax zmax.*
-**Example**
-
-# bounding box of a torus
-ptorus t 20 5
-bounding t
-==-27.059805107309852 -27.059805107309852 -
-5.0000001000000003
-==27.059805107309852 27.059805107309852
-5.0000001000000003
-
-
-@subsubsection occt_2142243456_1869436669793 distmini
-
-Syntax: distmini name Shape1 Shape2
-
-**distmini **calculates the minimum distance between two shapes. The calculation returns the number of solutions, If more than one solution exists. The options are displayed in the viewer(red) and the results are listed in the shell window. The distmini lines are considered as shapes which have a value v.
-**Example**
-
-box b 0 0 0 10 20 30
-box b2 30 30 0 10 20 30
-distmini d1 b b2
-==the distance value is : 22.3606797749979
-==the number of solutions is :2
-
-==solution number 1
-==the type of the solution on the first shape is 0
-==the type of the solution on the second shape is 0
-==the coordinates of the point on the first shape are:
-==X=10 Y=20 Z=30
-==the coordinates of the point on the second shape
-are:
-==X=30 Y=30 Z=30
-
-==solution number 2:
-==the type of the solution on the first shape is 0
-==the type of the solution on the second shape is 0
-==the coordinates of the point on the first shape are:
-==X=10 Y=20 Z=0
-==the coordinates of the point on the second shape
-are:
-==X=30 Y=30 Z=0
-
-==d1_val d1 d12
-
-
-
-
-@subsection occt_2142243456_1869436669710 Surface creation
-
-Surface creation commands include surfaces created from boundaries and from spaces between shapes.
-
- * gplate creates a surface from a boundary definition.
- * filling creates a surface from a group of surfaces.
-
-
-@subsubsection occt_2142243456_18694366697101 gplate,
-
-Syntax: gplate result nbrcurfront nbrpntconst [SurfInit] [edge 0] [edge tang (1:G1;2:G2) surf]...[point] [u v tang (1:G1;2:G2) surf] ...
-
-**gplate **creates a surface from a defined boundary. The boundary can be defined using edges, points, or other surfaces.
-<h5>Example</h5>
-
-plane p
-trim p p -1 3 -1 3
-mkface p p
-
-beziercurve c1 3 0 0 0 1 0 1 2 0 0
-mkedge e1 c1
-tcopy e1 e2
-tcopy e1 e3
-
-ttranslate e2 0 2 0
-trotate e3 0 0 0 0 0 1 90
-tcopy e3 e4
-ttranslate e4 2 0 0
-# create the surface
-gplate r1 4 0 p e1 0 e2 0 e3 0 e4 0
-==
-======== Results ===========
-DistMax=8.50014503228635e-16
-* GEOMPLATE END*
-Calculation time: 0.33
-Loop number: 1
-Approximation results
-Approximation error : 2.06274907619957e-13
-Criterium error : 4.97600631215754e-14
-
-#to create a surface defined by edges and passing through a point
-# to define the border edges and the point
-plane p
-trim p p -1 3 -1 3
-mkface p p
-
-beziercurve c1 3 0 0 0 1 0 1 2 0 0
-mkedge e1 c1
-tcopy e1 e2
-tcopy e1 e3
-
-ttranslate e2 0 2 0
-trotate e3 0 0 0 0 0 1 90
-tcopy e3 e4
-ttranslate e4 2 0 0
-# to create a point
-point pp 1 1 0
-# to create the surface
-gplate r2 4 1 p e1 0 e2 0 e3 0 e4 0 pp
-==
-======== Results ===========
-DistMax=3.65622157610934e-06
-* GEOMPLATE END*
-Calculculation time: 0.27
-Loop number: 1
-Approximation results
-Approximation error : 0.000422195884750181
-Criterium error : 3.43709808053967e-05
-
-@subsubsection occt_2142243456_18694366697102 filling, fillingparam
-
-Syntax: filling result nbB nbC nbP [SurfInit] [edge][face]order...
-edge[face]order... point/u v face order...
-
-**filling **creates a surface between borders. It uses the **gplate **algorithm but creates a surface that is tangential to the adjacent surfaces. The result is a smooth continuous surface based on the G1 criterion.
-
-To define the surface border:
-
- * enter the number of edges, constraints, and points
- * enumerate the edges, constraints and points
-
-The surface can pass through other points. These are defined after the border definition.
-
-You can use the **fillingparam **command to access the filling parameters.
-
-The options are:
-
--l : to list current values
-
--i : to set default values
-
--r deg nbPonC nbIt anis : to set filling options
-
--c t2d t3d tang tcur : to set tolerances
-
--a maxdeg maxseg : Approximation option
-**Example**
-
-# to create four curved survaces and a point
-plane p
-trim p p -1 3 -1 3
-mkface p p
-
-beziercurve c1 3 0 0 0 1 0 1 2 0 0
-mkedge e1 c1
-tcopy e1 e2
-tcopy e1 e3
-
-ttranslate e2 0 2 0
-trotate e3 0 0 0 0 0 1 90
-tcopy e3 e4
-ttranslate e4 2 0 0
-
-point pp 1 1 0
-
-prism f1 e1 0 -1 0
-prism f2 e2 0 1 0
-prism f3 e3 -1 0 0
-prism f4 e4 1 0 0
-
-# to create a tangential surface
-filling r1 4 0 0 p e1 f1 1 e2 f2 1 e3 f3 1 e4 f4 1
-# to create a tangential surface passing through point pp
-filling r2 4 0 1 p e1 f1 1 e2 f2 1 e3 f3 1 e4 f4 1 pp#
-# to visualise the surface in detail
-isos r2 40
-# to display the current filling parameters
-fillingparam -l
-==
-Degree = 3
-NbPtsOnCur = 10
-NbIter = 3
-Anisotropie = 0
-Tol2d = 1e-05
-Tol3d = 0.0001
-TolAng = 0.01
-TolCurv = 0.1
-
-MaxDeg = 8
-MaxSegments = 9
-
-
-
-
-@subsection occt_2142243456_1869436669711 Complex Topology
-
-Complex topology is the group of commands that modify the topology of shapes. This includes feature modeling.
-
-
-@subsubsection occt_2142243456_18694366697111 offsetshape, offsetcompshape
-
-Syntax: offsetshape r shape offset [tol] [face ...]
-offsetcompshape r shape offset [face ...]
-
-**offsetshape **and **offsetcompshape **assigns a thickness to the edges of a shape. The **offset **value can be negative or positive. This value defines the thickness and direction of the resulting shape. Each face can be removed to create a hollow object.
-
-The resulting shape is based on a calculation of intersections. In case of simple shapes such as a box, only the adjacent intersections are required and you can use the **offsetshape **command.
-
-In case of complex shapes, where intersections can occur from non-adjacent edges and faces, use the **offsetcompshape **command. **comp **indicates complete and requires more time to calculate the result.
-
-
-The opening between the object interior and exterior is defined by the argument face or faces.
-**Example**
-
-box b1 10 20 30
-explode b1 f
-== b1_1 b1_2 b1_3 b1_4 b1_5 b1_6
-offsetcompshape r b1 -1 b1_3
-
-Syntax: offsetparameter tolerance intersection(c/p) join(a/i)
-offsetload shape offset [face1 face2 …]
-offsetonface face1 offset1 face2 offset2 …
-offsetperform result
-
-**offsetparameter** sets the values of parameters and options for the following command **offsetload**:
- * *tolerance* defines the coincidence tolerance criterion for generated shapes;
- * *intersection* defines the mode of intersection: *c* means complete intersection, *p* means partial intersection;
- * *join* defines the mode of connecting new adjacent faces: *a* means GeomAbs_Arc, *i* means GeomAbs_Intersection.
-
-**offsetload** loads shape, offset value and, if necessary, a set of faces to remove from the shape. These data are later used by command **offsetperform**.
-**offsetonface** indicates the faces of shape (loaded earlier by command **offsetload**) that should be shifted with special offset value. This command is optional. **Warning:** this command should be called only after **offsetload** and it takes effect only if parameter join = GeomAbs_Intersection.
-
-**offsetperform** performs the result of 3d-offset algorithm using the data loaded by previous commands.
-**Example**
-
-box b1 10 20 30
-explode b1 f
-== b1_1 b1_2 b1_3 b1_4 b1_5 b1_6
-offsetparameter 1e-7 p i
-offsetload b1 2 b1_1 b1_2
-offsetonface b1_3 5
-offsetperform result
-
-
-
-@subsubsection occt_2142243456_18694366697112 featprism, featdprism, featrevol, featlf, featrf
-
-Syntax: featprism shape element skface Dirx Diry Dirz Fuse(0/1/2) Modify(0/1)
-featdprism shape face skface angle Fuse(0/1/2) Modify(0/1)
-featrevol shape element skface Ox Oy Oz Dx Dy Dz Fuse(0/1/2) Modify(0/1)
-featlf shape wire plane DirX DirY DirZ DirX DirY DirZ Fuse(0/1/2) Modify(0/1)
-featrf shape wire plane X Y Z DirX DirY DirZ Size Size Fuse(0/1/2) Modify(0/1)
-featperform prism/revol/pipe/dprism/lf result [[Ffrom] Funtil]
-featperformval prism/revol/dprism/lf result value
-
-**featprism **loads the arguments for a prism with contiguous sides normal to the face.
-
-**featdprism **loads the arguments for a prism which is created in a direction normal to the face and includes a draft angle.
-
-**featrevol **loads the arguments for a prism with a circular evolution.
-
-**featlf **loads the arguments for a linear rib or slot. This feature uses planar faces and a wire as a guideline.
-
-**featrf **loads the arguments for a rib or slot with a curved surface. This feature uses a circular face and a wire as a guideline.
-
-**featperform **loads the arguments to create the feature.
-
-**featperformval **uses the defined arguments to create a feature with a limiting value.
-
-All the features are created from a set of arguments which are defined when you initialize the feature context. Negative values can be used to create depressions.
-**Example**
-
-# to create a feature prism with a draft angle and a
-normal direction
-# create a box with a wire contour on the upper face
-box b 1 1 1
-profil f O 0 0 1 F 0.25 0.25 x 0.5 y 0.5 x -0.5
-explode b f
-# loads the feature arguments defining the draft angle
-featdprism b f b_6 5 1 0
-# create the feature
-featperformval dprism r 1
-==BRepFeat_MakeDPrism::Perform(Height)
-BRepFeat_Form::GlobalPerform ()
-Gluer
-still Gluer
-Gluer result
-
-# to create a feature prism with circular direction
-# create a box with a wire contour on the upper face
-box b 1 1 1
-profil f O 0 0 1 F 0.25 0.25 x 0.5 y 0.5 x -0.5
-explode b f
-# loads the feature arguments defining a rotation axis
-featrevol b f b_6 1 0 1 0 1 0 1 0
-featperformval revol r 45
-==BRepFeat_MakeRevol::Perform(Angle)
-BRepFeat_Form::GlobalPerform ()
-Gluer
-still Gluer
-Gluer result
-
-# to create a slot using the linear feature
-#create the base model using the multi viewer
-mu4
-profile p x 5 y 1 x -3 y -0.5 x -1.5 y 0.5 x 0.5 y 4 x -1 y -5
-prism pr p 0 0 1
-# create the contour for the linear feature
-vertex v1 -0.2 4 0.3
-vertex v2 0.2 4 0.3
-vertex v3 0.2 0.2 0.3
-vertex v4 4 0.2 0.3
-vertex v5 4 -0.2 0.3
-edge e1 v1 v2
-edge e2 v2 v3
-edge e3 v3 v4
-edge e4 v4 v5
-wire w e1 e2 e3 e4
-# define a plane
-plane pl 0.2 0.2 0.3 0 0 1
-# loads the linear feature arguments
-featlf pr w pl 0 0 0.3 0 0 0 0 1
-featperform lf result
-
-# to create a rib using the revolution feature
-#create the base model using the multi viewer
-mu4
-pcylinder c1 3 5
-# create the contour for the revolution feature
-profile w c 1 190 WW
-trotate w 0 0 0 1 0 0 90
-ttranslate w -3 0 1
-trotate w -3 0 1.5 0 0 1 180
-plane pl -3 0 1.5 0 1 0
-# loads the revolution feature arguments
-featrf c1 w pl 0 0 0 0 0 1 0.3 0.3 1 1
-featperform rf result
-
-
-@subsubsection occt_2142243456_18694366697113 draft
-
-Syntax: draft result shape dirx diry dirz angle shape/surf/length [-IN/-OUT] [Ri/Ro] [-Internal]
-
-**draft **computes a draft angle surface from a wire. The surface is determined by the draft direction, the inclination of the draft surface, a draft angle, and a limiting distance.
-
- * The draft angle is measured in radians.
- * The draft direction is determined by the argument -INTERNAL
- * The argument Ri/Ro deftermines wether the corner edges of the
-
-draft surface are angular or rounded.
-
- * Arguments that can be used to define the surface distance are:
- * length, a defined distance
- * shape, until the surface contacts a shape
- * surface, until the surface contacts a surface.
-
-<h4>NOTE</h4>
-*The original aim of adding a draft angle to a shape is to*
-*produce a shape which can be removed easily from a mould.*
-*The Examples below use larger angles than are used normally*
-*and the calculation results returned are not indicated.*
-
-**Example**
-
-# to create a simple profile
-profile p F 0 0 x 2 y 4 tt 0 4 w
-# creates a draft with rounded angles
-draft res p 0 0 1 3 1 -Ro
-# to create a profile with an internal angle
-profile p F 0 0 x 2 y 4 tt 1 1.5 tt 0 4 w
-# creates a draft with rounded external angles
-draft res p 0 0 1 3 1 -Ro
-
-
-@subsubsection occt_2142243456_18694366697114 deform, nurbsconvert
-
-Syntax: deform newname name CoeffX CoeffY CoeffZ
-
-**deform **modifies the shape using the x, y, and z coefficients. You can reduce or magnify the shape in the x,y, and z directions.
-
-Syntax nurbsconvert result name [result name]
-
-**nurbsconvert **changes the NURBS curve definition of a shape to a Bspline curve definition. This conversion is required for assymetric deformation and prepares the arguments for other commands such as **deform. **The conversion can be necessary when transferring shape data to other applications.
-**Example**
-
-pcylinder c 20 20
-deform a c 1 3 5
-# the conversion to bspline is followed by the
-deformation
-
-
-
-@subsection occt_2142243456_1869436669712 Texture Mapping to a Shape
-
-Texture mapping allows you to map textures on a shape. Textures are texture image files and several are predefined. You can control the number of occurrences of the texture on a face, the position of a texture and the scale factor of the texture.
-
-@subsubsection occt_2142243456_18694366697121 vtexture
-
-Syntax vtexture NameOfShape TextureFile
-vtexture NameOfShape
-vtexture NameOfShape ?
-vtexture NameOfShape IdOfTexture
-
-**TextureFile **identifies the file containing the texture you want. The same syntax without **TextureFile **disables texture mapping. The question-mark ***?* **lists available textures. **IdOfTexture **allows you to apply predefined textures.
-
-@subsubsection occt_2142243456_18694366697122 vtexscale
-
-Syntax: vtexscale NameOfShape ScaleU ScaleV
-vtexscale NameOfShape ScaleUV
-vtexscale NameOfShape
-
-**ScaleU **and **Scale V **allow you to scale the texture according to the U and V parameters individually, while **ScaleUV **applies the same scale to both parameters. The same syntax without **ScaleU**, **ScaleV **or **ScaleUV **disables texture scaling.
-
-@subsubsection occt_2142243456_18694366697123 vtexorigin
-
-Syntax vtexorigin NameOfShape UOrigin VOrigin
-vtexorigin NameOfShape UVOrigin
-vtexorigin NameOfShape
-
-**UOrigin **and **VOrigin **allow you to place the texture according to the U and V parameters individually while **UVOrigin **applies the same position value to both parameters. The same syntax without **UOrigin**, **VOrigin **or **UVOrigin **disables origin positioning.
-
-@subsubsection occt_2142243456_18694366697124 vtexrepeat
-
-Syntax vtexrepeat NameOfShape URepeat VRepeat
-vtexrepeat NameOfShape UVRepeat
-vtexrepeat NameOfShape
-
-**URepeat **and **VRepeat **allow you to repeat the texture along the U and V parameters individually while **UVRepeat **applies the same number of repetitions for both parameters. The same syntax without **URepeat**, **VRepeat **or **UVRepeat **disables texture repetition.
-
-@subsubsection occt_2142243456_18694366697125 vtexdefault
-
-Syntax vtexdefault NameOfShape
-
-**Vtexdefault **sets or resets the texture mapping default parameters.
-
-The defaults are:
-
-URepeat = VRepeat = 1 = no repetition
-UOrigin = VOrigin = 1 = origin set at (0,0)
-UScale = VScale = 1 = texture covers 100% of the face
-@section occt_2142243456_1866931135 Data Exchange commands
-
-
-@subsection occt_2142243456_186693113581 General
-
-This paragraph presents some general information about Data Exchange (DE) operations.
-
-DE commands are intended for translation files of various formats (IGES,STEP) into OCCT shapes with their attributes (colors, layers etc.)
-
-This files include a number of entities. Each entity has its own number in the file which we call label and denote as # for a STEP file and D for an IGES file. Each file has entities called roots (one or more). A full description of such entities is contained in the Users’s Guide for a corresponding format.
-
-Each Draw session has an interface model – some structure for keeping various information.
-First step of translation – loading information from a file into a model.
-Second step – creation of an OpenCASCADE shape from this model.
-Each entity from file has its own number in the model (num).
-During the translation a map of correspondences between labels(from file) and numbers (from model) is created.
-The model and the mentioned map are used for working with most of DE commands.
-
-@subsection occt_2142243456_186693113582 IGES commands
-
-These commands are used during the translation of IGES models.
-
-
-@subsubsection occt_2142243456_1866931135821 igesread
-
-Syntax: igesread file_name result_shape_name [selection]
-
-Read an IGES file to an OCCT shape.
-This command will interactively ask the user to select a set of entities to be converted:
-
-
-After the selected set of entities is loaded the user will be asked how loaded entities should be converted into OCCT shapes (e.g., one shape per root or one shape for all the entities). It is also possible to save loaded shapes in files, and to cancel loading.
-The second parameter of this command defines the name of the loaded shape. If several shapes are created, they will get indexed names. For instance, if the last parameter was ‘s’, they will be s_1, ... s_N.
-selection specifies the scope of selected entities in the model, it is xst-transferrable-roots by default. More about selection see in the *IGES FORMAT User’s Guide*.
-If we use symbol * as selection all roots will be translated.
-<h5>Example</h5>
-
-# translation all roots from file
-igesread /disk01/files/model.igs a *
-
-@subsubsection occt_2142243456_1866931135822 tplosttrim
-
-Syntax: tplosttrim [IGES_type]
-
-Sometimes the trimming contours of IGES faces (i.e., entity 141 for 143, 142 for 144) can be lost during translation due to fails. This command gives us a number of lost trims and the number of corresponding IGES entities.
-It outputs the rank and numbers of faces that lost their trims and their numbers for each type (143, 144, 510) and their total number. If a face lost several of its trims it is output only once.
-Optional parameter IGES_type can be TrimmedSurface, BoundedSurface or Face to specify the only type of IGES faces.
-<h5>Example</h5>
-
-tplosttrim TrimmedSurface
-
-@subsubsection occt_2142243456_1866931135823 brepiges
-
-Syntax: brepiges shape_name filename.igs
-
-Writes an OCCT shape to an IGES file.
-**Example**
-
-# write shape with name aa to IGES file
-brepiges aa /disk1/tmp/aaa.igs
-== unit (write) : MM
-== mode write : Faces
-== To modifiy : command param
-== 1 Shapes written, giving 345 Entities
-== Now, to write a file, command : writeall filename
-== Output on file : /disk1/tmp/aaa.igs
-== Write OK
-
-
-
-@subsection occt_2142243456_186693113583 STEP commands
-
-These commands are used during the translation of STEP models.
-
-
-@subsubsection occt_2142243456_1866931135831 stepread
-
-Syntax: stepread file_name result_shape_name [selection]
-
-Read a STEP file to an OCCT shape.
-This command will interactively ask the user to select a set of entities to be converted:
-
-
-After the selected set of entities is loaded the user will be asked how loaded entities should be converted into OCCT shapes.
-The second parameter of this command defines the name of the loaded shape. If several shapes are created, they will get indexed names. For instance, if the last parameter was ‘s’, they will be s_1, ... s_N.
-selection specifies the scope of selected entities in the model. More about selection see in the *STEP FORMAT User’s Guide*.
-If as selection we use symbol * all roots will be translated.
-<h5>Example</h5>
-
-# translation all roots from file
-stepread /disk01/files/model.stp a *
-
-@subsubsection occt_2142243456_1866931135832 stepwrite
-
-Syntax: stepwrite mode shape_name file_name
-
-Writes an OCCT shape to a STEP file.
-The available modes are the following:
- 0 or ‘a’ - ;as is; mode – mode is selected automatically depending on type & geometry of the shape
- 1 or ‘m’ - manifold_solid_brep or brep_with_voids
- 2 or ‘f’ - faceted_brep
- 3 or ‘w’ - geometric_curve_set
- 4 or ‘s’ - shell_based_surface_model
-For further information see ;STEP FORMAT User’s Guide ;.
-<h5>Example</h5>
-
-# write shape with name a to STEP file with mode 0
-stepwrite 0 a /disk1/tmp/aaa.igs
-
-
-
-@subsection occt_2142243456_186693113584 General commands
-
-These commands are auxilary commands. Most of them are used for the analysis of result of translation of IGES and STEP files.
-
-@subsubsection occt_2142243456_1866931135841 count
-
-Syntax: count counter [selection]
-
-Is used to calculate statistics on the entities in the model.
-Gives us a count of entities.
-The optional selection argument, if specified, defines a subset of entities, which are to be taken into account. The first argument should be one of the currently defined counters (for example):
-
-<h5>Example</h5>
-
-count xst-types
-
-@subsubsection occt_2142243456_1866931135842 data
-
-Syntax: data symbol
-
-Is used to obtain general statistics on the loaded data.
-Information printed by this command depends on the symbol specified:
-<h5>Example</h5>
-
-# print full information about warnings and fails
-data c
-
-@subsubsection occt_2142243456_1866931135843 elabel
-
-Syntax: elabel num
-
-Entities in the IGES and STEP files are numbered in the succeeding order. An entity can be identified either by its number or by its label. Label is the letter ‘#'(for STEP, for IGES use ‘D’) followed by the rank. This command gives us a label for an entity with a known number.
-<h5>Example</h5>
-
-elabel 84
-
-@subsubsection occt_2142243456_1866931135844 entity
-
-Syntax: entity #(D)_or_num level_of_information
-
-The content of an IGES or STEP entity can be obtained by using this command.
-Entity can be determined by its number or label.
-level_of_information has range [0-6]. You can get more information about this level using this command without parameters.
-<h5>Example</h5>
-
-# full information for STEP entity with label 84
-entity #84 6
-
-@subsubsection occt_2142243456_1866931135845 enum
-
-Syntax: enum #(D)
-
-Prints a number for the entity with a given label.
-<h5>Example</h5>
-
-# give a number for IGES entity with label 21
-enum D21
-
-@subsubsection occt_2142243456_1866931135846 estatus
-
-Syntax: estatus #(D)_or_num
-
-The list of entities referenced by a given entity and the list of entities referencing to it can be obtained by this command.
-<h5>Example</h5>
-
-estatus #315
-
-@subsubsection occt_2142243456_1866931135847 fromshape
-
-Syntax: fromshape shape_name
-
-Gives us the number of an IGES or STEP entity corresponding to an OCCT shape. If no corresponding entity can be found and if OCCT shape is a compound the command explodes it to subshapes and try to find corresponding entities for them.
-<h5>Example</h5>
-
-fromshape a_1_23
-
-@subsubsection occt_2142243456_1866931135848 givecount
-
-Syntax: givecount selection_name [selection_name]
-
-<h5>Example</h5>
-
-givecount xst-model-roots
-
-@subsubsection occt_2142243456_1866931135849 givelist
-
-Syntax: givelist selection_name
-
-Prints a list of a subset of loaded entities defined by the selection argument:
-
-<h5>Example</h5>
-
-# give a list of all entities of the model
-givelist xst-model-all
-
-@subsubsection occt_2142243456_18669311358410 listcount
-
-Syntax: listcount counter [selection ...]
-
-Prints a list of entities per each type matching the criteria defined by arguments.
-Optional selection argument, if specified, defines a subset of entities, which are to be taken into account. Argument counter should be one of the currently defined counters:
-
-<h5>Example</h5>
-
-listcount xst-types
-
-@subsubsection occt_2142243456_18669311358411 listitems
-
-Syntax: listitems
-
-This command prints a list of objects (counters, selections etc.) defined in the current session.
-<h5>Example</h5>
-
-listitems
-
-@subsubsection occt_2142243456_18669311358412 listtypes
-
-Syntax: listtypes [selection_name ...]
-
-Gives a list of entity types which were encountered in the last loaded file (with a number of entities of each type). The list can be shown not for all entities but for a subset of them. This subset is defined by an optional selection argument.
-<h5>Example</h5>
-
-# full list of all entities with thier counts
-listtypes
-
-@subsubsection occt_2142243456_18669311358413 newmodel
-
-Syntax: newmodel
-
-Clears the current model.
-<h5>Example</h5>
-
-newmodel
-
-@subsubsection occt_2142243456_18669311358414 param
-
-Syntax: param [parameter] [value]
-
-This command is used to manage translation parameters.
-Command without arguments gives us a full list of parameters with current values.
-Command with parameter (without value) gives us the current value of this parameter and all possible values for it. Command with value sets this new value to parameter.
-For more information about translation parameters see the corresponding User’s Guide.
-<h5>Example</h5>
-
-# info about possible schemes for writing STEP file
-param write.step.schema
-
-@subsubsection occt_2142243456_18669311358415 sumcount
-
-Syntax: sumcount counter [selection ...]
-
-Prints only a number of entities per each type matching the criteria defined by arguments.
-<h5>Example</h5>
-
-sumcount xst-types
-
-@subsubsection occt_2142243456_18669311358416 tpclear
-
-Syntax: tpclear
-
-Clears the map of correspondences between IGES or STEP entities and OCCT shapes.
-<h5>Example</h5>
-
-tpclear
-
-@subsubsection occt_2142243456_18669311358417 tpdraw
-
-Syntax: tpdraw #(D)_or_num
-
-<h5>Example</h5>
-
-tpdraw 57
-
-@subsubsection occt_2142243456_18669311358418 tpent
-
-Syntax: tpent #(D)_or_num
-
-<h5>Example</h5>
-
-tpent #23
-
-@subsubsection occt_2142243456_18669311358419 tpstat
-
-Syntax: tpstat [*|?]symbol [selection]
-
-Gives all statistics on the last transfer, including the list of transferred entities with mapping from IGES or STEP to OCCT types, as well as fail and warning messages. The parameter *symbol *defines what information will be printed:
-
-
-The sign ‘*’ before the parameters **n**, **s**, **b**, **t**, **r** makes it work on all entities (not only on roots). The sign ‘?’ before **n**, **s**, **b**, **t** limits the scope of information to invalid entities.
-Optional argument selection can limit the action of the command with a selected subset of entities.
-<h5>Example</h5>
-
-# translation ratio on IGES faces
-tpstat *l iges-faces
-
-@subsubsection occt_2142243456_18669311358420 xload
-
-Syntax: xload file_name
-
-This command loads an IGES or STEP file into memory (i.e. to fill the model with data from the file) without creation of an OCCT shape.
-<h5>Example</h5>
-
-xload /disk1/tmp/aaa.stp
-
-
-
-@subsection occt_2142243456_186693113585 Overview of XDE commands
-
-These commands are used for translation of IGES and STEP files into an XCAF document (special document is inherited from CAF document and is intended for Extended Data Exchange (XDE) ) and working with it. XDE translation allows reading and writing of shapes with additional attributes – colors, layers etc. All commands can be divided into the following groups:
- * **XDE translation commands**
- * **XDE general commands**
- * **XDE shape’s commands**
- * **XDE color’s commands**
- * **XDE layer’s commands**
- * **XDE property’s commands**
-
-
-
-@subsection occt_2142243456_186693113586 XDE translation commands
-
-Reminding: All operations of translation are performed with parameters managed by command param (see above)
-
-@subsubsection occt_2142243456_1866931135861 ReadIges
-
-Syntax: ReadIges document file_name
-
-Reads information from an IGES file to an XCAF document.
-<h5>Example</h5>
-
-ReadIges D /disk1/tmp/aaa.igs
-== Document saved with name D
-
-@subsubsection occt_2142243456_1866931135862 ReadStep
-
-Syntax: ReadStep document file_name
-
-Reads information from a STEP file to an XCAF document.
-<h5>Example</h5>
-
-ReadStep D /disk1/tmp/aaa.stp
-== Document saved with name D
-
-@subsubsection occt_2142243456_1866931135863 WriteIges
-
-Syntax: WriteIges document file_name
-
-<h5>Example</h5>
-
-WriteIges D /disk1/tmp/aaa.igs
-
-@subsubsection occt_2142243456_1866931135864 WriteStep
-
-Syntax: WriteStep document file_name
-
-Writes information from an XCAF document to a STEP file.
-<h5>Example</h5>
-
-WriteStep D /disk1/tmp/aaa.stp
-
-@subsubsection occt_2142243456_1866931135865 XFileCur
-
-Syntax: XFileCur
-
-Returns the name of file which is set as the current one in the Draw session.
-<h5>Example</h5>
-
-XFileCur
-== *as1-ct-203.stp*
-
-@subsubsection occt_2142243456_1866931135866 XFileList
-
-Syntax: XFileList
-
-Returns a list all files that were transferred by the last transfer. This command is meant (assigned) for the assemble step file.
-<h5>Example</h5>
-
-XFileList
-== *as1-ct-Bolt.stp*
-== *as1-ct-L-Bracktet.stp*
-== *as1-ct-LBA.stp*
-== *as1-ct-NBA.stp*
-== …
-
-@subsubsection occt_2142243456_1866931135867 XFileSet
-
-Syntax: XFileSet filename
-
-Sets the current file taking it from the components list of the assemble file.
-<h5>Example</h5>
-
-XFileSet as1-ct-NBA.stp
-
-@subsubsection occt_2142243456_1866931135868 XFromShape
-
-Syntax: XFromShape shape
-
-This command is similar to command *fromshape* (see above) but gives additional information about the name of file. It is useful in the case when a shape was translated from several files.
-<h5>Example</h5>
-
-XFromShape a
-== Shape a: imported from entity 217:#26 in file as1-ct-Nut.stp
-
-
-@subsection occt_2142243456_186693113587 XDE general commands
-
-@subsubsection occt_2142243456_1866931135871 XNewDoc
-
-Syntax: XNewDoc document
-
-Creates a new XCAF document.
-<h5>Example</h5>
-
-XNewDoc D
-
-@subsubsection occt_2142243456_1866931135872 XShow
-
-Syntax: XShow document [ label1 … ]
-
-Shows a shape from a given label in the 3D viewer. If the label is not given – shows all shapes from the document.
-<h5>Example</h5>
-
-# show shape from label 0:1:1:4 from document D
-XShow D 0:1:1:4
-
-@subsubsection occt_2142243456_1866931135873 XStat
-
-Syntax: XStat document
-
-Prints common information from an XCAF document.
-<h5>Example</h5>
-
-XStat D
-==Statistis of shapes in the document:
-==level N 0 : 9
-==level N 1 : 18
-==level N 2 : 5
-==Total number of labels for shapes in the document = 32
-==Number of labels with name = 27
-==Number of labels with color link = 3
-==Number of labels with layer link = 0
-==Statistis of Props in the document:
-==Number of Centroid Props = 5
-==Number of Volume Props = 5
-==Number of Area Props = 5
-==Number of colors = 4
-==BLUE1 RED YELLOW BLUE2
-==Number of layers = 0
-
-@subsubsection occt_2142243456_1866931135874 XWdump
-
-Syntax: XWdump document filename
-
-Saves the contents of the viewer window as an image (XWD, png or BMP file).
-filename must have a corresponding extention.
-<h5>Example</h5>
-
-XWdump D /disk1/tmp/image.png
-
-@subsubsection occt_2142243456_1866931135875 Xdump
-
-Syntax: Xdump document [int deep {0|1}]
-
-Prints information about the tree structure of the document. If parameter 1 is given, then the tree is printed with a link to shapes.
-<h5>Example</h5>
-
-Xdump D 1
-== ASSEMBLY 0:1:1:1 L-BRACKET(0xe8180448)
-== ASSEMBLY 0:1:1:2 NUT(0xe82151e8)
-== ASSEMBLY 0:1:1:3 BOLT(0xe829b000)
-== ASSEMBLY 0:1:1:4 PLATE(0xe8387780)
-== ASSEMBLY 0:1:1:5 ROD(0xe8475418)
-== ASSEMBLY 0:1:1:6 AS1(0xe8476968)
-== ASSEMBLY 0:1:1:7 L-BRACKET-ASSEMBLY(0xe8476230)
-== ASSEMBLY 0:1:1:1 L-BRACKET(0xe8180448)
-== ASSEMBLY 0:1:1:8 NUT-BOLT-ASSEMBLY(0xe8475ec0)
-== ASSEMBLY 0:1:1:2 NUT(0xe82151e8)
-== ASSEMBLY 0:1:1:3 BOLT(0xe829b000)
-etc.
-
-
-@subsection occt_2142243456_186693113588 XDE shape’s commands
-
-@subsubsection occt_2142243456_1866931135881 XAddComponent
-
-Syntax: XAddComponent document label shape
-
-Adds a component shape to assembly.
-<h5>Example</h5>
-
-# Add shape b as component shape to assembly shape from
-# label 0:1:1:1
-XAddComponent D 0:1:1:1 b
-
-@subsubsection occt_2142243456_1866931135882 XAddShape
-
-Syntax: XAddShape document shape [makeassembly=1]
-
-Adds a shape (or an assembly) to a document. If this shape already exists in the document, then prints the label which points to it. By default, a new shape is added as an assembly (i.e. last parameter 1), otherwise it is necessary to pass 0 as the last parameter.
-<h5>Example</h5>
-
-# add shape b to document D
-XAddShape D b 0
-== 0:1:1:10
-# if pointed shape is compound and last parameter in
-# XAddShape command is used by default (1), then for
-# each subshapes new label is created
-
-@subsubsection occt_2142243456_1866931135883 XFindComponent
-
-Syntax: XFindComponent document shape
-
-Prints a sequence of labels of the assembly path.
-<h5>Example</h5>
-
-XFindComponent D b
-
-@subsubsection occt_2142243456_1866931135884 XFindShape
-
-Syntax: XFindShape document shape
-
-Finds and prints a label with an indicated top-level shape.
-<h5>Example</h5>
-
-XFindShape D a
-
-@subsubsection occt_2142243456_1866931135885 XGetFreeShapes
-
-Syntax: XGetFreeShapes document [shape_prefix]
-
-Print labels or create DRAW shapes for all free shapes in the document.
-If [shape_prefix] is absent – prints labels, else – creates DRAW shapes with names
-[shape_prefix]_num (i.e. for example: there are 3 free shapes and [shape_prefix] = a therefore shapes will be created with names a_1, a_2 and a_3).
-Note: a free shape is a shape to which no other shape refers to.
-<h5>Example</h5>
-
-XGetFreeShapes D
-== 0:1:1:6 0:1:1:10 0:1:1:12 0:1:1:13
-
-XGetFreeShapes D sh
-== sh_1 sh_2 sh_3 sh_4
-
-@subsubsection occt_2142243456_1866931135886 XGetOneShape
-
-Syntax: XGetOneShape shape document
-
-Creates one DRAW shape for all free shapes from a document.
-<h5>Example</h5>
-
-XGetOneShape a D
-
-@subsubsection occt_2142243456_1866931135887 XGetReferredShape
-
-Syntax: XGetReferredShape document label
-
-Prints a label that contains a top-level shape that corresponds to a shape at a given label.
-<h5>Example</h5>
-
-XGetReferredShape D 0:1:1:1:1
-
-@subsubsection occt_2142243456_1866931135888 XGetShape
-
-Syntax: XGetShape result document label
-
-Puts a shape from the indicated label in document to result.
-<h5>Example</h5>
-
-XGetShape b D 0:1:1:3
-
-@subsubsection occt_2142243456_1866931135889 XGetTopLevelShapes
-
-Syntax: XGetTopLevelShapes document
-
-Prints labels that contain top-level shapes.
-<h5>Example</h5>
-
-XGetTopLevelShapes D
-== 0:1:1:1 0:1:1:2 0:1:1:3 0:1:1:4 0:1:1:5 0:1:1:6 0:1:1:7
-0:1:1:8 0:1:1:9
-
-@subsubsection occt_2142243456_18669311358810 XLabelInfo
-
-Syntax: XLabelInfo document label
-
-Prints information about a shape, stored at an indicated label.
-**Example**
-
-XLabelInfo D 0:1:1:6
-== There are TopLevel Shape. There are an Assembly. This Shape don’t used.
-
-@subsubsection occt_2142243456_18669311358811 XNewShape
-
-Syntax: XNewShape document
-
-Creates a new empty top-level shape.
-<h5>Example</h5>
-
-XNewShape D
-
-@subsubsection occt_2142243456_18669311358812 XRemoveComponent
-
-Syntax: XRemoveComponent document label
-
-Removes a component from the components label.
-<h5>Example</h5>
-
-XRemoveComponent D 0:1:1:1:1
-
-@subsubsection occt_2142243456_18669311358813 XRemoveShape
-
-Syntax: XRemoveShape document label
-
-Removes a shape from a document (by it’s label).
-<h5>Example</h5>
-
-XRemoveShape D 0:1:1:2
-
-@subsubsection occt_2142243456_18669311358814 XSetShape
-
-Syntax: XSetShape document label shape
-
-Sets a shape at the indicated label.
-<h5>Example</h5>
-
-XSetShape D 0:1:1:3 b
-
-
-@subsection occt_2142243456_186693113589 XDE color’s commands
-
-@subsubsection occt_2142243456_1866931135891 XAddColor
-
-Syntax: XAddColor document R G B
-
-Adds color in document to the color table. Parameters R,G,B are real.
-<h5>Example</h5>
-
-XAddColor D 0.5 0.25 0.25
-
-@subsubsection occt_2142243456_1866931135892 XFindColor
-
-Syntax: XFindColor document R G B
-
-Finds a label where the indicated color is situated.
-<h5>Example</h5>
-
-XFindColor D 0.25 0.25 0.5
-== 0:1:2:2
-
-@subsubsection occt_2142243456_1866931135893 XGetAllColors
-
-Syntax: XGetAllColors document
-
-Prints all colors that are defined in the document.
-<h5>Example</h5>
-
-XGetAllColors D
-== RED DARKORANGE BLUE1 GREEN YELLOW3
-
-@subsubsection occt_2142243456_1866931135894 XGetColor
-
-Syntax: XGetColor document label
-
-Returns a color defined at the indicated label from the color table.
-<h5>Example</h5>
-
-XGetColor D 0:1:2:3
-== BLUE1
-
-@subsubsection occt_2142243456_1866931135895 XGetObjVisibility
-
-Syntax: XGetObjVisibility document {label|shape}
-
-Returns the visibility of a shape.
-<h5>Example</h5>
-
-XGetObjVisibility D 0:1:1:4
-
-@subsubsection occt_2142243456_1866931135896 XGetShapeColor
-
-Syntax: XGetShapeColor document label colortype(s|c)
-
-Returns the color defined by label. If colortype=’s’ – returns surface color, else – returns curve color.
-<h5>Example</h5>
-
-XGetShapeColor D 0:1:1:4 c
-
-@subsubsection occt_2142243456_1866931135897 XRemoveColor
-
-Syntax: XRemoveColor document label
-
-Removes a color from the color table in a document.
-<h5>Example</h5>
-
-XRemoveColor D 0:1:2:1
-
-@subsubsection occt_2142243456_1866931135898 XSetColor
-
-Syntax: XSetColor document {label|shape} R G B
-
-Sets an RGB color to a shape given by label.
-<h5>Example</h5>
-
-XsetColor D 0:1:1:4 0.5 0.5 0.
-
-@subsubsection occt_2142243456_1866931135899 XSetObjVisibility
-
-Syntax: XSetObjVisibility document {label|shape} {0|1}
-
-Sets the visibility of a shape.
-<h5>Example</h5>
-
-# set shape from label 0:1:1:4 as invisible
-XSetObjVisibility D 0:1:1:4 0
-
-@subsubsection occt_2142243456_18669311358910 XUnsetColor
-
-Syntax: XUnsetColor document {label|shape} colortype
-
-Unset a color given??? type (‘s’ or ‘c’) for the indicated shape.
-<h5>Example</h5>
-
-XUnsetColor D 0:1:1:4 s
-
-
-@subsection occt_2142243456_1866931135810 XDE layer’s commands
-
-@subsubsection occt_2142243456_18669311358101 XAddLayer
-
-Syntax: XAddLayer document layer
-
-Adds a new layer in an XCAF document. layer - name of new layer (string).
-<h5>Example</h5>
-
-XAddLayer D layer2
-
-@subsubsection occt_2142243456_18669311358102 XFindLayer
-
-Syntax: XFindLayer document layer
-
-Prints a label where a layer is situated.
-<h5>Example</h5>
-
-XFindLayer D Bolt
-== 0:1:3:2
-
-@subsubsection occt_2142243456_18669311358103 XGetAllLayers
-
-Syntax: XGetAllLayers document
-
-Prints all layers in an XCAF document.
-<h5>Example</h5>
-
-XGetAllLayers D
-== *0:1:1:3* *Bolt* *0:1:1:9*
-
-@subsubsection occt_2142243456_18669311358104 XGetLayers
-
-Syntax: XGetLayers document {shape|label}
-
-Returns names of layers, which are pointed to by links of an indicated shape.
-<h5>Example</h5>
-
-XGetLayers D 0:1:1:3
-== *bolt* *123*
-
-@subsubsection occt_2142243456_18669311358105 XGetOneLayer
-
-Syntax: XGetOneLayer document label
-
-Prints the name of a layer at a given label.
-<h5>Example</h5>
-
-XGetOneLayer D 0:1:3:2
-
-@subsubsection occt_2142243456_18669311358106 XIsVisible
-
-Syntax: XIsVisible document {label|layer}
-
-Returns 1 if the indicated layer is visible, else returns 0.
-<h5>Example</h5>
-
-XIsVisible D 0:1:3:1
-
-@subsubsection occt_2142243456_18669311358107 XRemoveAllLayers
-
-Syntax: XRemoveAllLayers document
-
-Removes all layers from an XCAF document.
-<h5>Example</h5>
-
-XRemoveAllLayers D
-
-@subsubsection occt_2142243456_18669311358108 XRemoveLayer
-
-Syntax: XRemoveLayer document {label|layer}
-
-Removes the indicated layer from an XCAF document.
-<h5>Example</h5>
-
-XRemoveLayer D layer2
-
-@subsubsection occt_2142243456_18669311358109 XSetLayer
-
-Syntax: XSetLayer document {shape|label} layer
- [shape_in_one_layer {0|1}]
-
-Sets a reference between a shape and a layer (adds a layer if it is necessary).
-Parameter shape_in_one_layer shows whether a shape could be in a number of layers or only in one (0 by default).
-<h5>Example</h5>
-
-XSetLayer D 0:1:1:2 layer2
-
-@subsubsection occt_2142243456_186693113581010 XSetVisibility
-
-Syntax: XSetVisibility document {label|layer} isvisible {0|1}
-
-Sets the visibility of a layer.
-<h5>Example</h5>
-
-# set layer at label 0:1:3:2 as invisible
-XSetVisibility D 0:1:3:2 0
-
-@subsubsection occt_2142243456_186693113581011 XUnSetAllLayers
-
-Syntax: XUnSetAllLayers document {label|shape}
-
-Unsets a shape from all layers.
-<h5>Example</h5>
-
-XUnSetAllLayers D 0:1:1:2
-
-@subsubsection occt_2142243456_186693113581012 XUnSetLayer
-
-Syntax: XUnSetLayer document {label|shape} layer
-
-Unsets a shape from the indicated layer.
-<h5>Example</h5>
-
-XUnSetLayer D 0:1:1:2 layer1
-
-
-@subsection occt_2142243456_1866931135811 XDE property’s commands
-
-@subsubsection occt_2142243456_18669311358111 XCheckProps
-
-Syntax: XCheckProps document [ {0|deflection} [shape|label] ]
-
-Gets properties for a given shape (volume, area and centroid) and compares them with the results after internal calculations. If the second parameter is 0, the standard OCCT tool is used for the computation of properties. If the second parameter is not 0, it is treated as a deflection. If the deflection is positive the computation is done by triangulations, if it is negative – meshing is forced.
-<h5>Example</h5>
-
-# check properties for shapes at label 0:1:1:1 from
-# document using standard Open CASCADE Technology tools
-XCheckProps D 0 0:1:1:1
-== Label 0:1:1:1 ;L-BRACKET*
-== Area defect: -0.0 ( 0%)
-== Volume defect: 0.0 ( 0%)
-== CG defect: dX=-0.000, dY=0.000, dZ=0.000
-
-@subsubsection occt_2142243456_18669311358112 XGetArea
-
-Syntax: XGetArea document {shape|label}
-
-Returns the area of a given shape.
-<h5>Example</h5>
-
-XGetArea D 0:1:1:1
-== 24628.31815094999
-
-@subsubsection occt_2142243456_18669311358113 XGetCentroid
-
-Syntax: XGetCentroid document {shape|label}
-
-Returns the center of gravity coordinates of a given shape.
-<h5>Example</h5>
-
-XGetCentroid D 0:1:1:1
-
-@subsubsection occt_2142243456_18669311358114 XGetVolume
-
-Syntax: XGetVolume document {shape|label}
-
-Returns the volume of a given shape.
-<h5>Example</h5>
-
-XGetVolume D 0:1:1:1
-
-@subsubsection occt_2142243456_18669311358115 XSetArea
-
-Syntax: XSetArea document {shape|label} area
-
-Sets new area to attribute list ??? given shape.
-<h5>Example</h5>
-
-XSetArea D 0:1:1:1 2233.99
-
-@subsubsection occt_2142243456_18669311358116 XSetCentroid
-
-Syntax: XSetCentroid document {shape|label} x y z
-
-Sets new center of gravity to the attribute list ??? given shape.
-<h5>Example</h5>
-
-XSetCentroid D 0:1:1:1 0. 0. 100.
-
-@subsubsection occt_2142243456_18669311358117 XSetMaterial
-
-Syntax: XSetMaterial document {shape|label} name
- density(g/cu sm)
-
-Adds a new label with material into the material table in a document, and adds a link to this material to the attribute list of agiven shape or a given label. The last parameter sets the density of a pointed material.
-<h5>Example</h5>
-
-XSetMaterial D 0:1:1:1 Titanium 8899.77
-
-@subsubsection occt_2142243456_18669311358118 XSetVolume
-
-Syntax: XSetVolume document {shape|label} volume
-
-Sets new volume to the attribute list ??? given shape.
-<h5>Example</h5>
-
-XSetVolume D 0:1:1:1 444555.33
-
-@subsubsection occt_2142243456_18669311358119 XShapeMassProps
-
-Syntax: XShapeMassProps document [ deflection [{shape|label}] ]
-
-Computes and returns real mass and real center of gravity for a given shape or for all shapes in a document. The second parameter is used for calculation of the volume and CG(center of gravity). If it is 0, then the standard CASCADE tool (geometry) is used for computation, otherwise - by triangulations with a given deflection.
-<h5>Example</h5>
-
-XShapeMassProps D
-== Shape from label : 0:1:1:1
-== Mass = 193.71681469282299
-== CenterOfGravity X = 14.594564763807696,Y =
- 20.20271885211281,Z = 49.999999385313245
-== Shape from label : 0:1:1:2 not have a mass
-etc.
-
-@subsubsection occt_2142243456_186693113581110 XShapeVolume
-
-Syntax: XShapeVolume shape deflection
-
-Calculates the real volume of a pointed shape with a given deflection.
-<h5>Example</h5>
-
-XShapeVolume a 0
-
-@section occt_2142243456_1672096717 Shape Healing commands
-
-
-
-@subsection occt_2142243456_16720967171 General commands
-
-@subsubsection occt_2142243456_1672096717111 bsplres
-
-Syntax: bsplres result shape tol3d tol2d reqdegree reqnbsegments continuity3d continuity2d PriorDeg RationalConvert
-
-Performs approximations of a given shape (BSpline curves and surfaces or other surfaces) to BSpline with given required parameters. The specified continuity can be reduced if the approximation with a specified continuity was not done successfully. Results are put into the shape, which is given as a parameter result. For a more detailed description see the ShapeHealing User’s Guide (operator: BSplineRestriction).
-
-@subsubsection occt_2142243456_1672096717112 checkfclass2d
-
-Syntax: checkfclass2d face ucoord vcoord
-
-Shows where a point which is given by coordinates is located in relation to a given face – outbound, inside or at the bounds.
-<h5>Example</h5>
-
-checkfclass2d f 10.5 1.1
-== Point is OUT
-
-@subsubsection occt_2142243456_1672096717113 checkoverlapedges
-
-Syntax: checkoverlapedges edge1 edge2 [toler domaindist]
-
-Checks the overlapping of two given edges. If the distance between two edges is less than the given value of tolerance then edges are overlapped. Parameter domaindist sets length of part of edges on which edges are overlapped.
-<h5>Example</h5>
-
-checkoverlapedges e1 e2
-
-@subsubsection occt_2142243456_1672096717114 comtol
-
-Syntax: comptol shape [nbpoints] [prefix]
-
-Compares the real value of tolerance on curves with the value calculated by standard (using 23 points). The maximal value of deviation of 3d curve from pcurve at given simple points is taken as a real value (371 is by default). Command returns the maximal, minimal and average value of tolerance for all edges and difference between real values and set values. Edges with the maximal value of tolerance and relation will be saved if the ‘prefix’ parameter is given.
-**Example**
-
-comptol h 871 t
-
-== Edges tolerance computed by 871 points:
-== MAX=8.0001130696523449e-008 AVG=6.349346868091096e-009
- MIN=0
-== Relation real tolerance / tolerance set in edge
-== MAX=0.80001130696523448 AVG=0.06349345591805905 MIN=0
-== Edge with max tolerance saved to t_edge_tol
-== Concerned faces saved to shapes t_1, t_2
-
-
-@subsubsection occt_2142243456_1672096717115 convtorevol
-
-Syntax: convtorevol result shape
-
-Converts all elementary surfaces of a given shape into surfaces of revolution.
-Results are put into the shape, which is given as theresult parameter.
-<h5>Example</h5>
-
-convtorevol r a
-
-@subsubsection occt_2142243456_1672096717116 directfaces
-
-Syntax: directfaces result shape
-
-Converts indirect surfaces and returns the results into the shape, which is given as the result parameter.
-<h5>Example</h5>
-
-directfaces r a
-
-@subsubsection occt_2142243456_1672096717117 expshape
-
-Syntax: expshape shape maxdegree maxseg
-
-Gives statistics for a given shape. This test command is working with Bezier and BSpline entities.
-<h5>Example</h5>
-
-expshape a 10 10
-== Number of Rational Bspline curves 128
-== Number of Rational Bspline pcurves 48
-
-@subsubsection occt_2142243456_1672096717118 fixsmall
-
-Syntax: fixsmall result shape [toler=1.]
-
-Fixes small edges in given shape by merging adjacent edges with agiven tolerance. Results are put into the shape, which is given as the result parameter.
-<h5>Example</h5>
-
-fixsmall r a 0.1
-
-@subsubsection occt_2142243456_1672096717119 fixsmalledges
-
-Syntax: fixsmalledges result shape [toler mode maxangle]
-
-Searches at least one small edge at a given shape. If such edges have been found, then small edges are merged with a given tolerance. If parameter mode is equal to Standard_True (can be given any values, except 2), then small edges, which can not be merged, are removed, otherwise they are to be kept (Standard_False is used by default). Parameter maxangle sets a maximum possible angle for merging two adjacent edges, by default no limit angle is applied (-1).Results are put into the shape, which is given as parameter result.
-<h5>Example</h5>
-
-fixsmalledges r a 0.1 1
-
-@subsubsection occt_2142243456_16720967171110 fixshape
-
-Syntax: fixshape result shape [preci [maxpreci]] [{switches}]
-
-Performs fixes of all sub-shapes (such as Solids, Shells, Faces, Wires and Edges) of a given shape. Parameter preci sets a basic precision value, maxpreci sets the maximal allowed tolerance. Results are put into the shape, which is given as parameter result.
-{switches} allows to tune parameters of ShapeFix
-The following syntax is used: symbolparameter
-- symbol may be - to set parameter off, + to set on or * to set default
-- parameters are identified by letters:
-l - FixLackingMode
-o - FixOrientationMode
-h - FixShiftedMode
-m - FixMissingSeamMode
-d - FixDegeneratedMode
-s - FixSmallMode
-i - FixSelfIntersectionMode
-n - FixNotchedEdgesMode
-For enhanced message output, use switch '+?'
-<h5>Example</h5>
-
-fixshape r a 0.001
-
-@subsubsection occt_2142243456_16720967171111 fixwgaps
-
-Syntax: fixwgaps result shape [toler=0]
-
-Fixes gaps between ends of curves of adjacent edges (both 3d and pcurves) in wires in a given shape with a given tolerance. Results are put into the shape, which is given as parameter result.
-<h5>Example</h5>
-
-fixwgaps r a
-
-@subsubsection occt_2142243456_16720967171112 offsetcurve, offset2dcurve
-
-Syntax: offsetcurve result curve offset direction(as point)
- offset2dcurve result curve offset
-
-Both commands are intended to create a new offset curve by copying the given curve to distance, given by parameter offset. Parameter direction defines direction of the offset curve. It is created as a point. For correct work of these commands the direction of normal of the offset curve must be perpendicular to the plane, the basis curve is located there. Results are put into the curve, which is given as parameter result. **offsetcurve **works with the curve in 3d space, **offset2dcurve **in 2d space accordingly.
-<h5>Example</h5>
-
-point pp 10 10 10
-offsetcurve r c 20 pp
-
-@subsubsection occt_2142243456_16720967171113 projcurve
-
-Syntax: projcurve edge|curve3d|curve3d first last X Y Z
-
-**projcurve **returns the projection of a given point on a given curve. The curve may be defined by three ways: by giving the edge name, giving the 3D curve and by giving the unlimited curve and limiting it by pointing its start and finish values.
-**Example**
-
-projcurve k_1 0 1 5
-==Edge k_1 Params from 0 to 1.3
-==Precision (BRepBuilderAPI) : 9.9999999999999995e-008 ==Projection : 0 1 5
-==Result : 0 1.1000000000000001 0
-==Param = -0.20000000000000001 Gap = 5.0009999000199947
-
-
-@subsubsection occt_2142243456_16720967171114 projface
-
-Syntax: projface face X Y [Z]
-
-Returns the projection of a given point to a given face in 2d or 3d space. If two coordinates (2d space) are given then returns coordinates projection of this point in 3d space and vice versa.
-<h5>Example</h5>
-
-projface a_1 10.0 0.0
-== Point UV U = 10 V = 0
-== = proj X = -116 Y = -45 Z = 0
-
-@subsubsection occt_2142243456_16720967171115 scaleshape
-
-Syntax: scaleshape result shape scale
-
-<h5>Example</h5>
-
-scaleshape r a_1 0.8
-
-@subsubsection occt_2142243456_16720967171116 settolerance
-
-Syntax: settolerance shape [mode=v-e-w-f-a] val(fix value) or
- tolmin tolmax
-
-Sets new values of tolerance for a given shape. If the given second parameter (mode) is given, then the atolerance value is set only for these sub shapes.
-<h5>Example</h5>
-
-settolerance a 0.001
-
-@subsubsection occt_2142243456_16720967171117 splitface
-
-Syntax: splitface result face [u usplit1 usplit2...] [v vsplit1 vsplit2 ...]
-
-Splits a given face in parametric space and puts the result into the given parameter result.
-Returns the status of split face.
-<h5>Example</h5>
-
-# split face f by parameter u = 5
-splitface r f u 5
-== Splitting by U: ,5
-== Status: DONE1
-
-@subsubsection occt_2142243456_16720967171118 statshape
-
-Syntax: statshape shape [particul]
-
-Returns the number of sub-shapes, which compose the given shape. For example, the number of solids, number of faces etc. It also returns the number of geometrical objects or sub-shapes with a specified type, example, number of free faces, number of C0 surfaces. The last parameter becomes out of date.
-<h5>Example</h5>
-
-statshape a
-== Count Item
-== ----- ----
-== 402 Edge (oriented)
-== 402 Edge (Shared)
-== 74 Face
-== 74 Face (Free)
-== 804 Vertex (Oriented)
-== 402 Vertex (Shared)
-== 78 Wire
-== 4 Face with more than one wire
-== 34 bspsur: BSplineSurface
-
-@subsubsection occt_2142243456_16720967171119 tolerance
-
-Syntax: tolerance shape [mode:D v e f c] [tolmin tolmax:real]
-
-Returns tolerance (maximal, avg and minimal values) of all given shapes and tolerance of their Faces, Edges and Vertices. If parameter tolmin or tolmax or both of them are given, then sub-shapes are returned as a result of analys of this shape, which satisfy the given tolerances. If a particular value of entity (all shapes (D) (v) vertices (e) edges (f) faces (c) combined (faces)) is given as the second parameter then only this group will be analyzed for tolerance.
-<h5>Example</h5>
-
-tolerance a
-== Tolerance MAX=0.31512672416608001 AVG=0.14901359484722074 MIN=9.9999999999999995e-08
-== FACE : MAX=9.9999999999999995e-08 AVG=9.9999999999999995e-08 MIN=9.9999999999999995e-08
-== EDGE : MAX=0.31512672416608001 AVG=0.098691334511810405 MIN=9.9999999999999995e-08
-== VERTEX : MAX=0.31512672416608001 AVG=0.189076074499648 MIN=9.9999999999999995e-08
-
-tolerance a v 0.1 0.001
-== Analysing Vertices gives 6 Shapes between tol1=0.10000000000000001 and tol2=0.001 , named tol_1 to tol_6
-
-
-
-@subsection occt_2142243456_16720967172 Convertion commands
-More detailed information about using here classes can be found into Shape Healing documentation. All this commands are created for testing.
-
-@subsubsection occt_2142243456_1672096717121 DT_ClosedSplit
-
-Syntax: DT_ClosedSplit result shape
-
-Divides all closed faces in the shape (for example cone) and returns result of given shape into shape, which is given as parameter result. Number of faces in resulting shapes will be increased.
-Note: Closed face – it’s face with one or more seam.
-<h5>Example</h5>
-
-DT_ClosetSplit r a
-
-@subsubsection occt_2142243456_1672096717122 DT_ShapeConvert, DT_ShapeConvertRev
-
-Syntax: DT_ShapeConvert result shape convert2d convert3d
- DT_ShapeConvertRev result shape convert2d convert3d
-
-Both commands are intended for the conversion of 3D, 2D curves to Bezier curves and surfaces to Bezier based surfaces. Parameters convert2d and convert3d take on a value 0 or 1. If the given value is 1, then the conversion will be performed, otherwise it will not be performed. The results are put into the shape, which is given as parameter Result. Command **DT_ShapeConvertRev **differs from **DT_ShapeConvert **by converting all elementary surfaces into surfaces of revolution first.
-<h5>Example</h5>
-
-DT_ShapeConvert r a 1 1
-== Status: DONE1
-
-@subsubsection occt_2142243456_1672096717123 DT_ShapeDivide
-
-Syntax: DT_ShapeDivide result shape tol
-
-Divides the shape with C1 criterion and returns the result of geometry conversion of a given shape into the shape, which is given as parameter result. This command illustrates how class ShapeUpgrade_ShapeDivideContinuity works. This class allows to convert geometry with a continuity less than the specified continuity to geometry with target continuity. If conversion is not possible then the geometrical object is split into several ones, which satisfy the given tolerance. It also returns the status shape splitting:
-OK : no splitting was done
-Done1 : Some edges were split
-Done2 : Surface was split
-Fail1 : Some errors occurred
-<h5>Example</h5>
-
-DT_ShapeDivide r a 0.001
-== Status: OK
-
-@subsubsection occt_2142243456_1672096717124 DT_SplitAngle
-
-Syntax: DT_SplitAngle result shape [MaxAngle=95]
-
-Works with all revolved surfaces, like cylinders, surfaces of revolution etc. This command divides given revolved surfaces into segments so that each resulting segment covers not more than the given MaxAngle degrees and puts the result of splitting into the shape, which is given as parameter result. Values of returned status are given above.
-This command illustrates how class ShapeUpgrade_ShapeDivideAngle works.
-<h5>Example</h5>
-
-DT_SplitAngle r a
-== Status: DONE2
-
-@subsubsection occt_2142243456_1672096717125 DT_SplitCurve
-
-Syntax: DT_SplitCurve curve tol split(0|1)
-
-Divides the 3d curve with C1 criterion and returns the result of splitting of the given curve into a new curve. If the curve had been divided by segments, then each segment is put to an individual result. This command can correct a given curve at a knot with the given tolerance, if it is impossible, then the given surface is split at that knot. If the last parameter is 1, then 5 knots are added at the given curve, and its surface is split by segments, but this will be performed not for all parametric spaces.
-<h5>Example</h5>
-
-DT_SplitCurve r c
-
-@subsubsection occt_2142243456_1672096717126 DT_SplitCurve2d
-
-Syntax: DT_SplitCurve2d Curve Tol Split(0/1)
-
-Works just as DT_SplitCurve (see above), only with 2d curve.
-<h5>Example</h5>
-
-DT_SplitCurve2d r c
-
-@subsubsection occt_2142243456_1672096717127 DT_SplitSurface
-
-Syntax: DT_SplitSurface result Surface|GridSurf tol split(0|1)
-
-Divides surface with C1 criterion and returns the result of splitting of a given surface into surface, which is given as parameter result. If the surface has been divided into segments, then each segment is put to an individual result. This command can correct a given C0 surface at a knot with a given tolerance, if it is impossible, then the given surface is split at that knot. If the last parameter is 1, then 5 knots are added to the given surface, and its surface is split by segments, but this will be performed not for all parametric spaces.
-**Example**
-
-# split surface with name ‘su’
-DT_SplitSurface res su 0.1 1
-== single surf
-== appel a SplitSurface::Init
-== appel a SplitSurface::Build
-== appel a SplitSurface::GlobalU/VKnots
-== nb GlobalU;nb GlobalV=7 2 0 1 2 3 4 5 6.2831853072 0 1
-== appel a Surfaces
-== transfert resultat
-== res1_1_1 res1_2_1 res1_3_1 res1_4_1 res1_5_1 res1_6_1
-
-
-@subsubsection occt_2142243456_1672096717128 DT_ToBspl
-
-Syntax: DT_ToBspl result shape
-
-Converts a surface of linear extrusion, revolution and offset surfaces into BSpline surfaces. Returns the result into the shape, which is given as parameter result.
-**Example**
-
-DT_ToBspl res sh
-== error = 5.20375663162094e-08 spans = 10
-== Surface is aproximated with continuity 2
-
-@section occt_2142243456_1640587828 Performance evaluation commands
-
-
-@subsubsection occt_2142243456_16405878281.1 VDrawSphere
-
-Syntax: vdrawsphere shapeName Fineness [X=0.0 Y=0.0 Z=0.0] [Radius=100.0] [ToEnableVBO=1] [NumberOfViewerUpdate=1] [ToShowEdges=0]
-
-Calculates and displays in a given number of steps a sphere with given coordinates, radius and fineness. Returns the information about the properties of the sphere, the time and the amount of memory required to build it.
-
-This command can be used for visualization performance evaluation instead of the outdated Visualization Performance Meter.
-**Example**
-
-vdrawsphere s 200 1 1 1 500 1 == Compute Triangulation... == NumberOfPoints: 39602 == NumberOfTriangles: 79200 == Amount of memory required for PolyTriangulation without Normals: 2 Mb == Amount of memory for colors: 0 Mb == Amount of memory for PolyConnect: 1 Mb == Amount of graphic card memory required: 2 Mb == Number of scene redrawings: 1 == CPU user time: 15.6000999999998950 msec == CPU system time: 0.0000000000000000 msec == CPU average time of scene redrawing: 15.6000999999998950 msec
-
-
-
-@section occt_2142243456_713659999 Extending Test Harness with custom commands
-
-
-The following chapters explain how to extend Test Harness with custom commands and how to activate them using a plug-in mechanism.
-
-
-@subsection occt_2142243456_7136599991 Custom command implementation
-
-Custom command implementation has not undergone any changes since the introduction of the plug-in mechanism. The syntax of every command should still be like in the following example.
-**Example**
-
-static Standard_Integer myadvcurve(Draw_Interpretor& di,
-Standard_Integer n,
-char** a)
-{
-...
-}
-
-For examples of existing commands refer to Open CASCADE Technology (e.g. GeomliteTest.cxx).
-
-
-@subsection occt_2142243456_7136599992 Registration of commands in Test Harness
-
-To become available in the Test Harness the custom command must be registered in it. This should be done as follows.
-**Example**
-
-void MyPack::CurveCommands(Draw_Interpretor& theCommands)
-{
-...
-char* g = ;Advanced curves creation;;
-
-
- theCommands.Add ( ;myadvcurve;, ;myadvcurve name p1 p2 p3 –
- Creates my advanced curve from points;,
-__FILE__, myadvcurve, g);
-...
-}
-
-@subsection occt_2142243456_7136599993 Creating a toolkit (library) as a plug-in
-
-All custom commands are compiled and linked into a dynamic library (.dll on Windows, or .so on Unix/Linux). To make Test Harness recognize it as a plug-in it must respect certain conventions. Namely, it must export function PLUGINFACTORY() accepting the Test Harness interpreter object (Draw_Interpretor). This function will be called when the library is dynamically loaded during the Test Harness session.
-This exported function PLUGINFACTORY() must be implemented only once per library.
-For convenience the DPLUGIN macro (defined in the Draw_PluginMacro.hxx file) has been provided. It implements the PLUGINFACTORY() function as a call to the Package::Factory() method and accepts Package as an argument. Respectively, this Package::Factory() method must be implemented in the library and activate all implemented commands.
-**Example**
-
-#include Draw_PluginMacro.hxx
-
-void MyPack::Factory(Draw_Interpretor& theDI)
-{
-...
-//
-MyPack::CurveCommands(theDI);
-...
-}
-
-// Declare entry point PLUGINFACTORY
-DPLUGIN(MyPack)
-
-
-@subsection occt_2142243456_7136599994 Creation of the plug-in resource file
-
-As mentioned above, the plug-in resource file must be compliant with Open CASCADE Technology requirements (see Resource_Manager.cdl file for details). In particular, it should contain keys separated from their values by a colon (;:;).
-For every created plug-in there must be a key. For better readability and comprehension it is recommended to have some meaningful name.
-Thus, the resource file must contain a line mapping this name (key) to the library name. The latter should be without file extension (.dll on Windows, .so on Unix/Linux) and without the ;lib; prefix on Unix/Linux.
-For several plug-ins one resource file can be created. In such case, keys denoting plug-ins can be combined into groups, these groups - into their groups and so on (thereby creating some hierarchy). Any new parent key must have its value as a sequence of child keys separated by spaces, tabs or commas. Keys should form a tree without cyclic dependencies.
-**Examples** (file MyDrawPlugin):
-
-! Hierarchy of plug-ins
-ALL : ADVMODELING, MESHING
-DEFAULT : MESHING
-ADVMODELING : ADVSURF, ADVCURV
-
-! Mapping from naming to toolkits (libraries)
-ADVSURF : TKMyAdvSurf
-ADVCURV : TKMyAdvCurv
-MESHING : TKMyMesh
-
-
-For other examples of the plug-in resource file refer to the *;Plug-in resource file;* chapter above or to the $CASROOT/src/DrawPlugin file shipped with Open CASCADE Technology.
-
-
-@subsection occt_2142243456_7136599995 Dynamic loading and activation
-
-Loading a plug-in and activating its commands is described in the *;Activation of the commands implemented in the plug-in;* chapter.
-
-The procedure consists in defining the system variables and using the pload commands in the Test Harness session.
-
-**Example**
-
-Draw[] set env(CSF_MyDrawPluginDefaults) /users/test
-
-
Foundation Classes {#user_guides__foundation_classes}
=================================
+@tableofcontents
+
@section occt_fcug_1 Introduction
@subsection occt_fcug_1_1 Foundation Classes Overview
* Pointers to other object classes
Inside a package, two data types cannot bear the same name.
-@image html /user_guides/foundation_classes/images/foundation_classes_image003.jpg "Contents of a package"
-@image latex /user_guides/foundation_classes/images/foundation_classes_image003.jpg "Contents of a package"
+@image html /user_guides/foundation_classes/images/foundation_classes_image003.png "Contents of a package"
+@image latex /user_guides/foundation_classes/images/foundation_classes_image003.png "Contents of a package"
**Methods** are either **functions** or **procedures**. Functions return an object, whereas procedures only communicate by passing arguments. In both cases, when the transmitted object is an instance manipulated by a handle, its identifier is passed. There are three categories of methods:
* **Object constructor** Creates an instance of the described class. A class will have one or more object constructors with various different arguments or none.
* Data types manipulated by handle (or reference)
* Data types manipulated by value
-@image html /user_guides/foundation_classes/images/foundation_classes_image004.jpg "Manipulation of data types"
-@image latex /user_guides/foundation_classes/images/foundation_classes_image004.jpg "Manipulation of data types"
+@image html /user_guides/foundation_classes/images/foundation_classes_image004.png "Manipulation of data types"
+@image latex /user_guides/foundation_classes/images/foundation_classes_image004.png "Manipulation of data types"
A data type is implemented as a class. The class not only defines its data representation and the methods available on instances, but it also suggests how the instance will be manipulated.
* A variable of a type manipulated by value contains the instance itself.
The table below presents the equivalence existing between C++ fundamental types and OCCT primitive types.
**Table 1: Equivalence between C++ Types and OCCT Primitive Types**
-|C++ Types | OCCT Types |
-|----------:|------------:|
-|int | Standard_Integer |
+
+| C++ Types | OCCT Types |
+| :--------- | :----------- |
+| int | Standard_Integer |
| double | Standard_Real |
-|float | Standard_ShortReal |
-|unsigned int | Standard_Boolean |
-|char | Standard_Character |
+| float | Standard_ShortReal |
+| unsigned int | Standard_Boolean |
+| char | Standard_Character |
| short | Standard_ExtCharacter |
| char\* | Standard_CString |
| void\* | Standard_Address |
* Types defined by classes not inheriting from Standard_Persistent or Standard_Transient, whether directly or not.
Types which are manipulated by value behave in a more direct fashion than those manipulated by handle and thus can be expected to perform operations faster, but they cannot be stored independently in a file.
-@image html /user_guides/foundation_classes/images/foundation_classes_image005.jpg "Manipulation of a data type by value"
-@image latex /user_guides/foundation_classes/images/foundation_classes_image005.jpg "Manipulation of a data type by value"
+@image html /user_guides/foundation_classes/images/foundation_classes_image005.png "Manipulation of a data type by value"
+@image latex /user_guides/foundation_classes/images/foundation_classes_image005.png "Manipulation of a data type by value"
Types that are known to the schema (i.e. they are either **primitives** or they inherit from **Storable**) and are manipulated by value, can be stored inside a persistent object as part of the representation. Only in this way can a “manipulated by value” object be stored in a file.
* Types defined by classes inheriting from the **Persistent** class, which are therefore storable in a file.
* Types defined by classes inheriting from the **Transient** class.
-@image html /user_guides/foundation_classes/images/foundation_classes_image006.jpg "Manipulation of a data type by reference"
-@image latex /user_guides/foundation_classes/images/foundation_classes_image006.jpg "Manipulation of a data type by reference"
+@image html /user_guides/foundation_classes/images/foundation_classes_image006.png "Manipulation of a data type by reference"
+@image latex /user_guides/foundation_classes/images/foundation_classes_image006.png "Manipulation of a data type by reference"
@subsubsection occt_fcug_2_1_4 Summary of properties
The following table summarizes how various data types are handled and stored.
-| | Manipulated by handle | Manipulated by value |
-|--------:|----------------------:|---------------------:|
+| Type | Manipulated by handle | Manipulated by value |
+| :------- | :-------------------- | :-------------------- |
| storable | Persistent | Primitive, Storable (if nested in a persistent class)|
|temporary | Transient | Other |
If conversion is not compatible with the actual type of the referenced object, the handle which was “cast” becomes null (and no exception is raised). So, if you require reliable services defined in a sub-class of the type seen by the handle (static type), write as follows:
~~~~~~
-void MyFunction (const Handle(A) & a)
+void MyFunction (const Handle(A) & a)
{
Handle(B) b = Handle(B)::Downcast(a);
if (! b.IsNull()) {
then, the *Value* function may be implemented as follows:
~~~~~
-Item TCollection_Array1::Value (const Standard_Integer&index) const
+Item TCollection_Array1::Value (const Standard_Integer&index) const
{
// where r1 and r2 are the lower and upper bounds of the array
if(index r1 || index > r2) {
Using this syntax, the Value function becomes:
~~~~~
-Item TCollection_Array1::Value (const Standard_Integer&index) const
+Item TCollection_Array1::Value (const Standard_Integer&index) const
{
OutOfRange_Raise_if(index r1 || index > r2,
“index out of range in Array1::Value”);
2. On SUN and Linux, macro *OCC_CONVERT_SIGNALS* is defined by default. The C++ exception mechanism is used for catching exceptions and for throwing them from normal code. Since it is not possible to throw C++ exception from system signal handler function, that function makes a long jump to the nearest (in the execution stack) invocation of macro *OCC_CATCH_SIGNALS*, and only there the C++ exception gets actually thrown. The macro *OCC_CATCH_SIGNALS* is defined in the file *Standard_ErrorHandler.hxx*. Therefore, including this file is necessary for successful compilation of a code containing this macro.
This mode differs from standard C++ exception handling only for signals:
- + macro *OCC_CATCH_SIGNALS* is necessary (besides call to *OSD::SetSignal()* described above) for conversion of signals into exceptions;
- + the destructors for automatic C++ objects created in the code after that macro and till the place where signal is raised will not be called in case of signal, since no C++ stack unwinding is performed by long jump.
+ * macro *OCC_CATCH_SIGNALS* is necessary (besides call to *OSD::SetSignal()* described above) for conversion of signals into exceptions;
+ * the destructors for automatic C++ objects created in the code after that macro and till the place where signal is raised will not be called in case of signal, since no C++ stack unwinding is performed by long jump.
3. On SUN and Linux Open CASCADE Technology can also be compiled in compatibility mode (which was default till Open CASCADE Technology 6.1.0). In that case macro *NO_CXX_EXCEPTIONS* is defined and the C++ exceptions are simulated with C long jumps. As a consequence, the behavior is slightly different from that expected in the C++ standard.
* Open CASCADE Technology try/catch block will not handle normal C++ exceptions; however this can be achieved using special workarounds;
* the try macro defines a C++ object that holds an entry point in the exception handler. Therefore if exception is raised by code located immediately after the try/catch block but on the same nesting level as *try*, it may be handled by that *catch*. This may lead to unexpected behavior, including infinite loop. To avoid that, always surround the try/catch block in {} braces;
* the destructors of the C++ objects allocated on the stack after handler initialization are not called by exception raising.
+
In general, for writing platform-independent code it is recommended to insert macros *OCC_CATCH_SIGNALS* in try {} blocks or other code where signals may happen. For compatibility with previous versions of Open CASCADE Technology the limitations described above for *NO_CXX_EXCEPTIONS* shall be assumed.
@subsection occt_fcug_2_5 Plug-In Management
// purpose :
//======================================================
-Handle(Standard_Transient) FAFactory::Factory(const Standard_GUID& aGUID)
+Handle(Standard_Transient) FAFactory::Factory(const Standard_GUID& aGUID)
{
if(aGUID == StorageDriver) {
cout “FAFactory : Create store driver” endl;
class FAFactory {
public:
Standard_EXPORT static Handle_Standard_Transient
- Factory(const Standard_GUID& aGUID) ;
+ Factory(const Standard_GUID& aGUID) ;
. . .
};
~~~~~
@subsection occt_occt_fcug_4_3 Primitive Geometric Types
Before creating a geometric object, you must decide whether you are in a 2d or in a 3d context and how you want to handle the object.
The *gp* package offers classes for both 2d and 3d objects which are handled by value rather than by reference. When this sort of object is copied, it is copied entirely. Changes in one instance will not be reflected in another.
-The *gp* package defines the basic non-persistent geometric entities used for algebraic calculation and basic analytical geometry in 2d & 3d space. It also provides basic transformations such as identity, rotation, translation, mirroring, scale transformations, combinations of transformations, etc. Entities are handled by value.
+The *gp* package defines the basic non-persistent geometric entities used for algebraic calculation and basic analytical geometry in 2d & 3d space. It also provides basic transformations such as identity, rotation, translation, mirroring, scale transformations, combinations of transformations, etc. Entities are handled by value.
The available geometric entities are:
- * 2d & 3d Cartesian coordinates (x, y, z)
+ * 2d & 3d Cartesian coordinates (x, y, z)
* Matrices
* Cartesian points
* Vector
~~~~~~
class Gauss {
public:
- Gauss (const math_Matrix& A);
+ Gauss (const math_Matrix& A);
Standard_Boolean IsDone() const;
- void Solve (const math_Vector& B,
- math_Vector& X) const;
+ void Solve (const math_Vector& B,
+ math_Vector& X) const;
};
~~~~~~
~~~~~
class BissecNewton {
public:
- BissecNewton (math_FunctionWithDerivative& f,
+ BissecNewton (math_FunctionWithDerivative& f,
const Standard_Real bound1,
const Standard_Real bound2,
const Standard_Real tolx);
class math_FunctionWithDerivative {
public:
virtual Standard_Boolean Value
- (const Standard_Real x, Standard_Real& f) = 0;
+ (const Standard_Real x, Standard_Real& f) = 0;
virtual Standard_Boolean Derivative
- (const Standard_Real x, Standard_Real& d) = 0;
+ (const Standard_Real x, Standard_Real& d) = 0;
virtual Standard_Boolean Values
(const Standard_Real x,
- Standard_Real& f,
- Standard_Real& d) = 0;
+ Standard_Real& f,
+ Standard_Real& d) = 0;
};
~~~~~
{}
virtual Standard_Boolean Value (const Standard_Real x,
- Standard_Real& f)
+ Standard_Real& f)
{
f = coefa * x * x + coefb * x + coefc;
}
virtual Standard_Boolean Derivative (const Standard_Real x,
- Standard_Real& d)
+ Standard_Real& d)
{
d = coefa * x * 2.0 + coefb;
}
virtual Standard_Boolean Values (const Standard_Real x,
- Standard_Real& f, Standard_Real& d)
+ Standard_Real& f, Standard_Real& d)
{
f = coefa * x * x + coefb * x + coefc;
d = coefa * x * 2.0 + coefb;
@section occt_fcug_5 Data Storage
@subsection occt_fcug_5_1 Saving and Opening Files
-@image html /user_guides/foundation_classes/images/foundation_classes_image007.jpg "Example of Saving-Opening workflow"
-@image latex /user_guides/foundation_classes/images/foundation_classes_image007.jpg "Example of Saving-Opening workflow"
+@image html /user_guides/foundation_classes/images/foundation_classes_image007.png "Example of Saving-Opening workflow"
+@image latex /user_guides/foundation_classes/images/foundation_classes_image007.png "Example of Saving-Opening workflow"
In the example, the roots of the transferable transient objects *TopoDS_Shape, Geom_Geometry* and *Geom2d_Geometry* are used in algorithms, they contain data and temporary results.
The associated objects in the persistent domain are *PTopoDS_HShape, PGeom_Geometry* and *PGeom2d_Geometry*. They contain a real data structure which is stored in a file.
Note that when an object is stored, if it contains another stored object, the references to the contained object are also managed.
-@image html /user_guides/foundation_classes/images/foundation_classes_image008.jpg "Saving-Opening mechanism"
-@image latex /user_guides/foundation_classes/images/foundation_classes_image008.jpg "Saving-Opening mechanism"
+@image html /user_guides/foundation_classes/images/foundation_classes_image008.png "Saving-Opening mechanism"
+@image latex /user_guides/foundation_classes/images/foundation_classes_image008.png "Saving-Opening mechanism"
@subsection occt_fcug_5_2 Basic Storage Procedures
IGES Support {#user_guides__iges}
==================
+@tableofcontents
+
@section occt_iges_1 Introduction
* Surfaces
* B-Rep entities
* Structure entities (groups). Each entity in the group outputs a shape. There can be a group of groups.
- * Subfigures. Each entity defined in a subfigure outputs a shape
+ * Subfigures. Each entity defined in a sub-figure outputs a shape
* Transformation Matrix.
**Note** that all non-millimeter length unit values in the IGES file are converted to millimeters.
reader.TransferRoots(onlyvisible)
~~~~~
-@subsubsection occt_iges_2_36 Getting the translation results
+@subsubsection occt_iges_2_3_6 Getting the translation results
Each successful translation operation outputs one shape. A series of translations gives a series of shapes.
Each time you invoke *TransferEntity, Transfer* or *Transferlist*, their results are accumulated and NbShapes increases. You can clear the results (Clear function) between two translation operations, if you do not do this, the results from the next translation will be added to the accumulation. *TransferRoots* operations automatically clear all existing results before they start.
~~~~~
@subsubsection occt_iges_2_4_1 Points
-| IGES entity type | CASCADE shape | Comments |
-
-| ----------------: | -------------: | ---------: |
-
-| 116: Point | TopoDS_Vertex |
+| IGES entity type | CASCADE shape | Comments |
+| :---------------- | :------------- | --------- |
+| 116: Point | TopoDS_Vertex | |
@subsubsection occt_iges_2_4_2 Curves
Curves, which form the 2D of face boundaries, are translated as *Geom2D_Curves* (Geom2D circles, etc.).
-IGES entity type CASCADE shape Comments
-100: Circular Arc TopoDS_Edge
- The geometrical support is:
-- a Geom_Circle,
-- or a Geom_TrimmedCurve.
-A Geom_TrimmedCurve is output if the arc is not closed.
-102: Composite Curve
- TopoDS_Wire
- The resulting shape is always a TopoDS_Wire that is built from a set of TopoDS_Edges.
-Each TopoDS_Edge is connected to the preceding and to the following edge by a common TopoDS_Vertex.
-104: Conic Arc TopoDS_Edge The geometric support depends on whether the IGES entity's form is:
-- 0 (Geom_Circle),
-- 1 (Geom_Ellipse),
-- 2 (Geom_Hyperbola),
-- or 3 (Geom_Parabola).
-A Geom_TrimmedCurve is output if the arc is not closed.
-106: Copious Data TopoDS_Edge or TopoDS_Wire IGES entity Copious Data (type 106, forms 1-3) is translated just as the IGES entities Linear Path (106/11-13) and the Simple Closed Planar Curve (106/63). Vectors applying to forms other than 11,12 or 63 are ignored.
-The Geom_BSplineCurve (geometrical support) has C0 continuity.
-If the Copious Data has vectors (DataType = 3) they will be ignored.
-110: Line TopoDS_Edge The supporting curve is a Geom_TrimmedCurve whose basis curve is a Geom_Line.
-112: Parametric Spline Curve TopoDS_Edge or TopoDS_Wire The geometric support is a Geom_BsplineCurve.
-126: BSpline Curve TopoDS_Edge or TopoDS_Wire
-130: Offset Curve TopoDS_Edge or TopoDS_Wire
- The resulting shape is a TopoDS_Edge or a TopoDS_Wire (depending on the translation of the basis curve) whose geometrical support is a Geom_OffsetCurve built from a basis Geom_Curve.
-Limitation: The IGES Offset Type value must be 1.
-141: Boundary TopoDS_Wire Same behavior as for the Curve On Surface (see below).
-The translation of a non-referenced Boundary IGES entity in a BoundedSurface IGES entity outputs a TopoDS_Edge or a TopoDS_Wire with a Geom_Curve.
-142: Curve On Surface TopoDS_Wire Each TopoDS_Edge is defined by a 3D curve and by a 2D curve that references the surface.
+| IGES entity type | CASCADE shape | Comments |
+| :---------------- | :------------ | :------- |
+| 100: Circular Arc | TopoDS_Edge | The geometrical support is a *Geom_Circle* or a *Geom_TrimmedCurve* (if the arc is not closed). |
+| 102: Composite Curve | TopoDS_Wire | The resulting shape is always a *TopoDS_Wire* that is built from a set of *TopoDS_Edges*. Each *TopoDS_Edge* is connected to the preceding and to the following edge by a common *TopoDS_Vertex*. |
+| 104: Conic Arc | TopoDS_Edge | The geometric support depends on whether the IGES entity's form is 0 (*Geom_Circle*), 1 (*Geom_Ellipse*), 2 (*Geom_Hyperbola*), or 3 (*Geom_Parabola*). A *Geom_TrimmedCurve* is output if the arc is not closed. |
+| 106: Copious Data | TopoDS_Edge or TopoDS_Wire | IGES entity Copious Data (type 106, forms 1-3) is translated just as the IGES entities Linear Path (106/11-13) and the Simple Closed Planar Curve (106/63). Vectors applying to forms other than 11,12 or 63 are ignored. The *Geom_BSplineCurve* (geometrical support) has C0 continuity. If the Copious Data has vectors (DataType = 3) they will be ignored. |
+| 110: Line | TopoDS_Edge | The supporting curve is a *Geom_TrimmedCurve* whose basis curve is a *Geom_Line*. |
+| 112: Parametric Spline Curve | TopoDS_Edge or TopoDS_Wire | The geometric support is a Geom_BsplineCurve. |
+| 126: BSpline Curve | TopoDS_Edge or TopoDS_Wire | |
+| 130: Offset Curve | TopoDS_Edge or TopoDS_Wire | The resulting shape is a *TopoDS_Edge* or a *TopoDS_Wire* (depending on the translation of the basis curve) whose geometrical support is a *Geom_OffsetCurve* built from a basis *Geom_Curve*. Limitation: The IGES Offset Type value must be 1. |
+| 141: Boundary | TopoDS_Wire | Same behavior as for the Curve On Surface (see below). The translation of a non-referenced Boundary IGES entity in a *BoundedSurface* IGES entity outputs a *TopoDS_Edge* or a *TopoDS_Wire* with a *Geom_Curve*. |
+| 142: Curve On Surface | TopoDS_Wire | Each *TopoDS_Edge* is defined by a 3D curve and by a 2D curve that references the surface. |
The type of OCCT shapes (either *TopDS_Edges* or *TopoDS_Wires*) that result from the translation of IGES entities 106, 112 and 126 depends on the continuity of the curve in the IGES file and the value of the *read.iges.bspline.continuity* translation parameter.
@subsubsection occt_iges_2_4_3 Surfaces
-Translation of a surface outputs either a TopoDS_Face or a TopoDS_Shell.
-If a TopoDS_Face is output, its geometrical support is a Geom_Surface and its outer and inner boundaries (if it has any) are TopoDS_Wires.
-
-IGES entity type CASCADE shape Comments
-108: Plane
- TopoDS_Face
- The geometrical support for the TopoDS_Face is a Geom_Plane and the orientation of its TopoDS_Wire depends on whether it is an outer TopoDS_Wire or whether it is a hole.
-114: Parametric Spline Surface TopoDS_Face The geometrical support of a TopoDS_Face is a Geom_BSplineSurface.
-118: Ruled Surface
- TopoDS_Face
- or
-TopoDS_Shell The translation of a Ruled Surface outputs:
-- a TopoDS_Face if the profile curves become TopoDS_Edges,
-- a TopoDS_Shell if the profile curves become TopoDS_Wires.
-
-Limitation: This translation cannot be completed when these two TopoDS_Wires are oriented in different directions.
-120: Surface Of Revolution TopoDS_Face
- or
-TopoDS_Shell
- The translation of a Surface Of Revolution outputs:
-- a TopoDS_Face if the generatrix becomes a TopoDS_Edge,
-- a TopoDS_Shell if the generatrix becomes a TopoDS_Wire.
-The geometrical support may be:
- - a Geom_CylindricalSurface,
- - a Geom_ConicalSurface,
- - a Geom_SphericalSurface,
- - a Geom_ToroidalSurface
- - or a Geom_SurfaceOfRevolution
-depending on the result of the CASCADE computation (based on the generatrix type).
-122: Tabulated Cylinder TopoDS_Face
- or
-TopoDS_Shell
- The translation outputs:
-- a TopoDS_Face if the base becomes a TopoDS_Edge,
-- a TopoDS_Shell if the base becomes a TopoDS_Wire.
-
-The geometrical support may be:
-- a Geom_Plane,
-- a Geom_Cylindrical Surface,
-- a Geom_SurfaceOfLinearExtrusion
-depending on the result of the CASCADE computation (based on the generatrix type).
+Translation of a surface outputs either a *TopoDS_Face* or a *TopoDS_Shell*.
+If a *TopoDS_Face* is output, its geometrical support is a *Geom_Surface* and its outer and inner boundaries (if it has any) are *TopoDS_Wires*.
+
+| IGES entity type | CASCADE shape | Comments |
+| :-------------- | :------------ | :--------- |
+| 108: Plane | TopoDS_Face | The geometrical support for the TopoDS_Face is a Geom_Plane and the orientation of its TopoDS_Wire depends on whether it is an outer TopoDS_Wire or whether it is a hole. |
+| 114: Parametric Spline Surface | TopoDS_Face | The geometrical support of a TopoDS_Face is a Geom_BSplineSurface. |
+| 118: Ruled Surface | TopoDS_Face or TopoDS_Shell | The translation of a Ruled Surface outputs a TopoDS_Face if the profile curves become TopoDS_Edges, or a TopoDS_Shell if the profile curves become TopoDS_Wires.
+Limitation: This translation cannot be completed when these two TopoDS_Wires are oriented in different directions. |
+| 120: Surface Of Revolution | TopoDS_Face or TopoDS_Shell | The translation of a Surface Of Revolution outputs: a TopoDS_Face if the generatrix becomes a TopoDS_Edge, a TopoDS_Shell if the generatrix becomes a TopoDS_Wire. The geometrical support may be: *Geom_CylindricalSurface, Geom_ConicalSurface, Geom_SphericalSurface, Geom_ToroidalSurface* or a *Geom_SurfaceOfRevolution* depending on the result of the CASCADE computation (based on the generatrix type). |
+| 122: Tabulated Cylinder | TopoDS_Face or TopoDS_Shell | The translation outputs: a TopoDS_Face if the base becomes a TopoDS_Edge, or a TopoDS_Shell if the base becomes a TopoDS_Wire. The geometrical support may be Geom_Plane, Geom_Cylindrical Surface or a Geom_SurfaceOfLinearExtrusion depending on the result of the CASCADE computation (based on the generatrix type). |
The Geom_Surface geometrical support is limited according to the generatrix.
128: BSpline Surface TopoDS_Face The geometrical support of the TopoDS_Face is a Geom_BsplineSurface.
140: Offset Surface TopoDS_Face
<h4>3D (spatial) tolerances</h4>
-* Package method *Precision::Confusion* equal to 10<sup>-7</sup> is used as a minimal distance between points, which are considered distinct.
+* Package method *Precision\::Confusion* equal to 10<sup>-7</sup> is used as a minimal distance between points, which are considered distinct.
* Resolution in the IGES file is defined in the Global section of an IGES file. It is used as a fundamental value of precision during the transfer.
* User-defined variable *read.precision.val* can be used instead of resolution from the file when parameter *read.precision.mode* is set to 1 ("User").
* Field *EpsGeom* of the class *IGESToBRep_CurveAndSurface* is a basic precision for translating an IGES object. It is set for each object of class *IGESToBRep_CurveAndSurface* and its derived classes. It is initialized for the root of transfer either by value of resolution from the file or by value of *read.precision.val*, depending on the value of *read.precision.mode* parameter. It is returned by call to method *IGESToBRep_CurvAndSurface::GetEpsGeom*. As this value belongs to measurement units of the IGES file, it is usually multiplied by the coefficient *UnitFactor* (returned by method *IGESToBRep_CurvAndSurface::GetUnitFactor*) to convert it to Open CASCADE Technology units.
<h4>2D (parametric) tolerances</h4>
-* Package method *Precision::PConfusion* equal to <i> 0.01*Precision::Confusion</i>, i.e. 10<sup>-9</sup>. It is used to compare parametric bounds of curves.
+* Package method *Precision\::PConfusion* equal to <i> 0.01*Precision\::Confusion</i>, i.e. 10<sup>-9</sup>. It is used to compare parametric bounds of curves.
* Field *EpsCoeff* of the class *IGESToBRep_CurveAndSurface* is a parametric precision for translating an IGES object. It is set for each object of class *IGESToBRep_CurveAndSurface* and its derived classes. Currently, it always has its default value 10<sup>-6</sup>. It is returned by call to method *IGESToBRep_CurvAndSurface::GetEpsCoeff*. This value is used for translating 2d objects (for instance, parametric curves).
* Methods *UResolution(tolerance3d)* and *VResolution(tolerance3d)* of the class *GeomAdaptor_Surface* or *BRepAdaptor_Surface* return tolerance in parametric space of a surface computed from 3D tolerance. When one tolerance value is to be used for both U and V parametric directions, the maximum or the minimum value of *UResolution* and *VResolution* is used.
* Methods *Resolution(tolerance3d)* of the class *GeomAdaptor_Curve* or *BRepAdaptor_Curve* return tolerance in the parametric space of a curve computed from 3d tolerance.
<h4>Translating into Topology</h4>
-IGES entities represented as topological shapes and geometrical objects are translated into OCCT shapes by use of the following classes:
-IGESToBRep_TopoCurve, IGESToBRep_TopoSurface, IGESToBRep_BRepEntity, ShapeFix_Wire
-Class IGESToBRep_BRepEntity is intended for transferring BRep entities (IGES version ³ 5.1) while the two former are used for translating geometry and topology defined in IGES 5.1. Methods from IGESToBRep_BRepEntity call methods from IGESToBRep_TopoCurve and IGESToBRep_TopoSurface, while those call methods from IGESToBRep_BasicCurve and IGESToBRep_BasicSurface in order to translate IGES geometry into OCCT geometry.
+IGES entities represented as topological shapes and geometrical objects are translated into OCCT shapes by use of the classes *IGESToBRep_TopoCurve, IGESToBRep_TopoSurface, IGESToBRep_BRepEntity* and *ShapeFix_Wire*.
+
+Class *IGESToBRep_BRepEntity* is intended for transferring BRep entities (IGES version 5.1) while the two former are used for translating geometry and topology defined in IGES 5.1. Methods from *IGESToBRep_BRepEntity* call methods from *IGESToBRep_TopoCurve* and *IGESToBRep_TopoSurface*, while those call methods from *IGESToBRep_BasicCurve* and *IGESToBRep_BasicSurface* to translate IGES geometry into OCCT geometry.
+
Although the IGES file contains only one parameter for tolerance in the Global Section, OCCT shapes are produced with different tolerances. As a rule, updating the tolerance is fulfilled according to local distances between shapes (distance between vertices of adjacent edges, deviation of edge’s 3D curve and its parametric curve and so on) and may be less or greater than precision in the file.
+
The following classes show what default tolerances are used when creating shapes and how they are updated during transfer.
+
<h5>Class IGESToBRep_TopoCurve</h5>
-All the methods which are in charge of transferring curves from IGES curve entities (TransferCompositeCurve, Transfer2dCompositeCurve, TransferCurveOnFace, TransferBoundaryOnFace, TransferOffsetCurve, TransferTopoBasicCurve) if an entity has transformation call to IGESData_ToolLocation::ConvertLocation with Epsilon value set to 10-4.
- * IGESToBRep_TopoCurve::TransferPoint
-Vertex is constructed from a Point entity with tolerance EpsGeom*UnitFactor.
- * IGESToBRep_TopoCurve::Transfer2dPoint
-Vertex is constructed from a Point entity with tolerance EpsCoeff.
- * IGESToBRep_TopoCurve::TransferCompositeCurveGeneral
-Obtains shapes (edges or wires) from other methods and adds them into the resulting wire. Two adjacent edges of the wire can be connected with tolerance up to MaxTol.
- * IGESToBRep_TopoCurve::TransferCurveOnFace and IGESToBRep_TopoCurve::TransferBoundaryOnFace
-This method builds a wire from 3D and 2D representations of a curve on surface.
-Edges and vertices of the wire cannot have tolerance larger than MaxTol.
-The value EpsGeom*UnitFactor is passed into ShapeFix_Wire::SetPrecision and MaxTol - into ShapeFix_Wire::MaxTolerance. To find out how these parameters affect the resulting tolerance changes, please refer to class ShapeFix_Wire.
- * IGESToBRep_TopoCurve::TransferTopoBasicCurve and IGESToBRep_TopoCurve::Transfer2dTopoBasicCurve
-The boundary vertices of an edge (or a wire if a curve was of C0 continuity) translated from a basis IGES curve (BSplineCurve, CopiousData, Line, etc.) are built with tolerance EpsGeom*UnitFactor, the tolerance of the edge(s) is (are) Precision::Confusion*.*
-If a curve was divided into several edges, the common vertices of such adjacent edges have tolerance Precision::Confusion*.*
+
+All methods are in charge of transferring curves from IGES curve entities *(TransferCompositeCurve, Transfer2dCompositeCurve, TransferCurveOnFace, TransferBoundaryOnFace, TransferOffsetCurve, TransferTopoBasicCurve)* if an entity has transformation call to *IGESData_ToolLocation::ConvertLocation* with *Epsilon* value set to 10<sup>-4</sup>.
+ * *IGESToBRep_TopoCurve::TransferPoint* - vertex is constructed from a Point entity with tolerance *EpsGeom*UnitFactor*.
+ * *IGESToBRep_TopoCurve::Transfer2dPoint* - vertex is constructed from a Point entity with tolerance *EpsCoeff*.
+ * *IGESToBRep_TopoCurve::TransferCompositeCurveGeneral* - obtains shapes (edges or wires) from other methods and adds them into the resulting wire. Two adjacent edges of the wire can be connected with tolerance up to *MaxTol*.
+ * *IGESToBRep_TopoCurve::TransferCurveOnFace* and *IGESToBRep_TopoCurve::TransferBoundaryOnFace* build a wire from 3D and 2D representations of a curve on surface. Edges and vertices of the wire cannot have tolerance larger than *MaxTol*. The value *EpsGeom*UnitFactor* is passed into *ShapeFix_Wire::SetPrecision* and *MaxTol* - into *ShapeFix_Wire::MaxTolerance*. To find out how these parameters affect the resulting tolerance changes, please, refer to class *ShapeFix_Wire*.
+ * *IGESToBRep_TopoCurve::TransferTopoBasicCurve* and *IGESToBRep_TopoCurve::Transfer2dTopoBasicCurve* - the boundary vertices of an edge (or a wire if a curve was of C0 continuity) translated from a basis IGES curve (*BSplineCurve, CopiousData, Line,* etc.) are built with tolerance *EpsGeom*UnitFactor*, the edge tolerance is *Precision::Confusion*. If a curve was divided into several edges, the common vertices of such adjacent edges have tolerance *Precision::Confusion*.
+
+
<h5>Class IGESToBRep_TopoSurface</h5>
-All the faces created by this class have tolerance Precision::Confusion*.*
+
+All faces created by this class have tolerance *Precision::Confusion*.
+
<h5>Class IGESToBRep_BRepEntity</h5>
- * IGESToBRep_BRepEntity::TransferVertex
-The vertices from the VertexList entity are constructed with tolerance EpsGeom*UnitFactor.
- * IGESToBRep_BRepEntity::TransferEdge
-The edges from the EdgeList entity are constructed with tolerance Precision::Confusion*.*
- * IGESToBRep_BRepEntity::TransferLoop
-This function works like IGESToBRep_TopoCurve::TransferCurveOnFace* *and* *IGESToBRep_TopoCurve::TransferBoundaryOnFace*.*
- * IGESToBRep_BRepEntity::TransferFace
-The face from the Face IGES entity is constructed with tolerance Precision::Confusion.
+
+ * *IGESToBRep_BRepEntity::TransferVertex* - the vertices from the *VertexList* entity are constructed with tolerance *EpsGeom*UnitFactor*.
+ * *IGESToBRep_BRepEntity::TransferEdge* - the edges from the *EdgeList* entity are constructed with tolerance *Precision::Confusion*.
+ * *IGESToBRep_BRepEntity::TransferLoop* - this function works like *IGESToBRep_TopoCurve::TransferCurveOnFace* and *IGESToBRep_TopoCurve::TransferBoundaryOnFace*.
+ * *IGESToBRep_BRepEntity::TransferFace* the face from the Face IGES entity is constructed with tolerance *Precision::Confusion*.
+
<h5>Shape Healing classes</h5>
-After performing a simple mapping, shape-healing algorithms are called (class ShapeFix_Shape) by IGESToBRep_Actor::Transfer(). A shape-healing algorithm performs the correction of a resulting OCCT shape.
-Class ShapeFix_Wire can increase the tolerance of a shape. This class is used in IGESToBRep_BRepEntity::TransferLoop*,* IGESToBRep_TopoCurve::TransferBoundaryOnFace and IGESToBRep_TopoCurve::TransferCurveOnFace for correcting a wire. The maximum possible tolerance which edges or vertices will have after invoking the methods of this class is MaxTolerance (set by method ShapeFix_Wire::MaxTolerance()).
+After performing a simple mapping, shape-healing algorithms are called (class *ShapeFix_Shape*) by *IGESToBRep_Actor::Transfer()*. Shape-healing algorithm performs the correction of the resulting OCCT shape.
+Class *ShapeFix_Wire* can increase the tolerance of a shape. This class is used in *IGESToBRep_BRepEntity::TransferLoop*, *IGESToBRep_TopoCurve::TransferBoundaryOnFace* and *IGESToBRep_TopoCurve::TransferCurveOnFace* for correcting a wire. The maximum possible tolerance applied to the edges or vertices after invoking the methods of this class is *MaxTolerance* (set by method *ShapeFix_Wire::MaxTolerance()* ).
@subsection occt_iges_2_7 Code architecture
-@subsubsection occt_iges_2_71 List of the classes
-<h5>Package IGESControl</h5>
-IGESControl_Reader
-<h5>Package IGESToBRep</h5>
-IGESToBRep_Reader
-IGESToBRep_Actor
-IGESToBRep_CurveAndSurface
-IGESToBRep_BasicCurve
-IGESToBRep_BasicSurface
-IGESToBRep_TopoCurve
-IGESToBRep_TopoSurface
-IGESToBRep_BRepEntity
-<h5>Package IGESConvGeom</h5>
-For description of classes, refer to CDL.
-@subsubsection occt_iges_2_72 List of API classes
-<h5>package IGESControl</h5>
-IGESControl_Reader
-<h5>package IGESToBRep</h5>
-IGESToBRep_Reader
-<h5>package IGESData</h5>
-class IGESData_IGESModel
-class IGESData_IGESEntity
-For details, refer to 4 API for reading/writing IGES and CDL.
-@subsubsection occt_iges_2_73 Graph of calls
+
The following diagram illustrates the structure of calls in reading IGES.
The highlighted classes produce OCCT geometry.
-@image html /user_guides/iges/images/iges_image003.jpg
-@image latex /user_guides/iges/images/iges_image003.jpg
+
+@image html /user_guides/iges/images/iges_image003.png "The structure of calls in reading IGES"
+@image latex /user_guides/iges/images/iges_image003.png "The structure of calls in reading IGES"
@subsection occt_iges_2_8 Example
+
+~~~~~
#include “IGESControl_Reader.hxx”
#include “TColStd_HSequenceOfTransient.hxx”
#include “TopoDS_Shape.hxx”
TopoDS_Shape sh = myIgesReader.OneShape();
//and obtains the results in an OCCT shape.
}
+~~~~~
+@section occt_iges_3 Writing IGES
+@subsection occt_iges_3_1 Procedure
-@section occt_1856844696_874243683 Writing IGES
-@subsection occt_1856844696_8742436831 Procedure
You can translate OCCT shapes to IGES entities in the following steps:
-1. initialize the process.
-2. set the translation parameters,
-3. perform the model translation,
-4. write the output IGES file.
+1. Initialize the process.
+2. Set the translation parameters,
+3. Perform the model translation,
+4. Write the output IGES file.
+
You can translate several shapes before writing a file. Each shape will be a root entity in the IGES model.
-@subsection occt_1856844696_8742436832 Domain covered
+
+@subsection occt_iges_3_2 Domain covered
There are two families of OCCT objects that can be translated:
* geometrical,
* topological.
-@subsection occt_1856844696_8742436833 Description of the process
-@subsubsection occt_1856844696_87424368331 Initializing the process
+
+@subsection occt_iges_3_3 Description of the process
+@subsubsection occt_iges_3_3_1 Initializing the process
+
Choose the unit and the mode you want to use to write the output file as follows:
-IGESControl_Controller::Init
-performs standard initialization. Returns False if an error occurred.
-IGESControl_Writer writer;
-uses the default unit (millimeters) and the default write mode (Face).
-IGESControl_Writer writer (UNIT);
-uses the Face write mode and any of the units that are accepted by IGES.
-IGESControl_Writer writer (UNIT,modecr);
-uses the unit (accepted by IGES) and the write mode of your choice.
- * 0: Faces,
- * 1: BRep
-The result is an IGESControl_Writer object.
-@subsubsection occt_1856844696_87424368332 Setting the translation parameters
+* *IGESControl_Controller::Init* performs standard initialization. Returns False if an error occurred.
+* *IGESControl_Writer writer* uses the default unit (millimeters) and the default write mode (Face).
+* *IGESControl_Writer writer (UNIT)* uses the Face write mode and any of the units that are accepted by IGES.
+* *IGESControl_Writer writer (UNIT,modecr)* uses the unit (accepted by IGES) and the write mode of your choice.
+ * 0: Faces,
+ * 1: BRep
+The result is an *IGESControl_Writer* object.
+
+@subsubsection occt_iges_3_3_2 Setting the translation parameters
+
The following parameters are used for the OCCT-to-IGES translation.
-<h4>write.iges.brep.mode: </h4>
-gives the choice of the write mode. You can choose the following write modes:
-;Faces; (0): OCCT TopoDS_Faces will be translated into IGES 144 (Trimmed Surface) entities, no B-Rep entities will be written to the IGES file,
-;BRep; (1): OCCT TopoDS_Faces will be translated into IGES 510 (Face) entities, the IGES file will contain B-Rep entities.
-Read this parameter with:
-Standard_Integer byvalue = Interface_Static::IVal(;write.iges.brep.mode;);
-Modify this parameter with:
-Interface_Static::SetIVal (;write.iges.brep.mode;, 1);
-Default value is ;Faces; (0).
-<h4>write.convertsurface.mode</h4>
-For writing to IGES in the BRep mode (see parameter write.iges.brep.mode), this parameter indicates whether elementary surfaces (cylindrical, conical, spherical, and toroidal) are converted into corresponding IGES 5.3 entities (if parameter's value is On), or written as surfaces of revolution (by default).
-Default value is Off.
-<h4>write.iges.unit:</h4>
-gives the choice of the unit. The default unit for Open CASCADE Technology is the millimeter. You can choose to write your file in any of the units that are accepted by IGES.
-Read this parameter with:
-Standard_String byvalue = Interface_Static::CVal(;write.iges.unit;);
-Modify this parameter with:
-Interface_Static::SetCVal (;write.iges.unit;, ;INCH;);
-Default value is ;MM;.
-<h4>write.iges.header.autor:</h4>
-gives the name of the author of the file.
-Read this parameter with:
-Standard_String byvalue = Interface_Static::CVal(;write.iges.header.author;);
-Modify this value with:
-Interface_Static::SetCVal (;write.iges.header.author;, ;name;);
-Default value is the system name of the user.
-<h4>write.iges.header.company:</h4>
-gives the name of the sending company.
-Read this parameter with:
-Standard_String byvalue = Interface_Static::CVal(;write.iges.header.company;);
-Modify this value with:
-Interface_Static::SetCVal (;write.iges.header.company;, ;MDTV;);
-Default value is ;; (empty).
-<h4>write.iges.header.product:</h4>
-gives the name of the sending product.
+* *write.iges.brep.mode:* allows choosing the write mode:
+ * "Faces" (0): OCCT *TopoDS_Faces* will be translated into IGES 144 (Trimmed Surface) entities, no B-Rep entities will be written to the IGES file,
+ * "BRep" (1): OCCT *TopoDS_Faces* will be translated into IGES 510 (Face) entities, the IGES file will contain B-Rep entities.
Read this parameter with:
-Standard_String byvalue = Interface_Static::CVal(;write.iges.header.product;);
-Modify this value with:
-Interface_Static::SetCVal (;write.iges.header.product;, ;product name;);
-Default value is ;CAS.CADE IGES processor Vx.x; where x.x means the current version of Open CASCADE Technology.
-<h4>write.iges.header.receiver:</h4>
-gives the name of the receiving company.
-Read this parameter with:
-Standard_String byvalue = Interface_Static::CVal(;write.iges.header.receiver;);
-Modify this value with:
-Interface_Static::SetCVal (;write.iges.header.receiver;, ;reciever name;);
-Default value is ;; (empty).
-<h4>write.precision.mode:</h4>
-specifies the mode of writing the resolution value into the IGES file.
-;Least; (-1): resolution value is set to the minimum tolerance of all edges and all vertices in an OCCT shape,
-;Average; (0): resolution value is set to average between the average tolerance of all edges and the average tolerance of all vertices in an OCCT shape (default),
-;Greatest; (1): resolution value is set to the maximum tolerance of all edges and all vertices in an OCCT shape,
-;Session; (2): resolution value is that of the write.precision.val parameter.
-Read this parameter with:
-Standard_Integer ic = Interface_Static::IVal(;write.precision.mode;);
+~~~~~
+Standard_Integer byvalue = Interface_Static::IVal("write.iges.brep.mode");
+~~~~~
Modify this parameter with:
-if (!Interface_Static::SetIVal(;write.precision.mode;,1))
-.. error ..
-Default value is ;Average; (0).
-<h4>write.precision.val:</h4>
-user precision value. This parameter gives the resolution value for an IGES file when the write.precision.mode parameter value is 1.
- 0.0001: default
- any real positive (non null) value.
+~~~~~
+Interface_Static::SetIVal ("write.iges.brep.mode", 1);
+~~~~~
+Default value is "Faces" (0).
+* *write.convertsurface.mode* when writing to IGES in the BRep mode, this parameter indicates whether elementary surfaces (cylindrical, conical, spherical, and toroidal) are converted into corresponding IGES 5.3 entities (if the value of a parameter value is On), or written as surfaces of revolution (by default).
+* *write.iges.unit:* allows choosing the unit. The default unit for Open CASCADE Technology is "MM" (millimeter). You can choose to write a file into any unit accepted by IGES.
+ * Read this parameter with *Standard_String byvalue = Interface_Static::CVal("write.iges.unit")*;
+ * Modify this parameter with *Interface_Static::SetCVal ("write.iges.unit", "INCH");*
+* *write.iges.header.autor:* gives the name of the author of the file. The default value is the system name of the user.
+ * Read this parameter with *Standard_String byvalue = Interface_Static::CVal("write.iges.header.author")*;
+ * Modify this value with *Interface_Static::SetCVal ("write.iges.header.author", "name")*;
+* *write.iges.header.company:* gives the name of the sending company. The default value is "" (empty).
+ * Read this parameter with *Standard_String byvalue = Interface_Static::CVal("write.iges.header.company");*
+ * Modify this value with *Interface_Static::SetCVal ("write.iges.header.company", "Open CASCADE");*
+* *write.iges.header.product:* gives the name of the sending product. The default value is "CAS.CADE IGES processor Vx.x", where *x.x* means the current version of Open CASCADE Technology.
+ * Read this parameter with *Standard_String byvalue = Interface_Static::CVal("write.iges.header.product")*;
+ * Modify this value with *Interface_Static::SetCVal ("write.iges.header.product", "product name")*;
+* *write.iges.header.receiver:* - gives the name of the receiving company. The default value is "" (empty).
+ * Read this parameter with *Standard_String byvalue = Interface_Static::CVal("write.iges.header.receiver");*
+ * Modify this value with *Interface_Static::SetCVal ("write.iges.header.receiver", "reciever name");*
+* *write.precision.mode:* specifies the mode of writing the resolution value into the IGES file.
+ * "Least" (-1): resolution value is set to the minimum tolerance of all edges and all vertices in an OCCT shape.
+ * "Average" (0): resolution value is set to average between the average tolerance of all edges and the average tolerance of all vertices in an OCCT shape. This is the default value.
+ * "Greatest" (1): resolution value is set to the maximum tolerance of all edges and all vertices in an OCCT shape.
+ * "Session" (2): resolution value is that of the write.precision.val parameter.
+
+ * Read this parameter with *Standard_Integer ic = Interface_Static::IVal("write.precision.mode");*
+ * Modify this parameter with *if (!Interface_Static\::SetIVal("write.precision.mode",1)) .. error .. *
+* *write.precision.val:* is the user precision value. This parameter gives the resolution value for an IGES file when the *write.precision.mode* parameter value is 1. It is equal to 0.0001 by default, but can take any real positive (non null) value.
+
Read this parameter with:
+~~~
Standard_Real rp = Interface_Static::RVal(;write.precision.val;);
+~~~
Modify this parameter with:
+~~~
if (!Interface_Static::SetRVal(;write.precision.val;,0.01))
.. error ..
+~~~
Default value is 0.0001.
<h4>write.iges.resource.name</h4>
<h4>write.iges.sequence</h4>
The same as read.iges.*, please see above. Note that the default sequence for writing contains one operator – DirectFaces - which converts elementary surfaces based on left-hand axes (valid in CASCADE) to right-hand axes (which are valid only in IGES).
Default values : write.iges.resource.name – IGES, write.iges.sequence – ToIGES.
-@subsubsection occt_1856844696_87424368333 Performing the Open CASCADE Technology shape translation
+@subsubsection occt_iges_333 Performing the Open CASCADE Technology shape translation
You can perform the translation in one or several operations. Here is how you translate topological and geometrical objects:
Standard_Boolean ok = writer.AddShape (shape);
where shape is a TopoDS_Shape.
Standard_Boolean ok = writer.AddGeom (geom);
where geom is either Handle(Geom_Curve) or Handle(Geom_Surface)
ok is True if the translation was correctly performed and False if there was at least one entity whose geometry was not among the allowed types.
-@subsubsection occt_1856844696_87424368334 Writing the IGES file
+@subsubsection occt_iges_334 Writing the IGES file
Write the IGES file with:
Standard_Boolean ok = writer.Write (;filename.igs;);
to give the file name.
Standard_Boolean ok = writer.Write (S);
where S is Standard_OStream
ok is True if the operation was correctly performed and False if an error occurred (for instance, if the processor could not create the file).
-@subsection occt_1856844696_8742436834 Mapping Open CASCADE Technology shapes to IGES entities
+@subsection occt_iges_34 Mapping Open CASCADE Technology shapes to IGES entities
Translated objects depend on the write mode that you chose. If you chose the Face mode, all of the shapes are translated, but the level of topological entities becomes lower (geometrical one). If you chose the BRep mode, topological OCCT shapes become topological IGES entities.
-@subsubsection occt_1856844696_87424368341 Curves
-@subsubsection occt_1856844696_87424368342 Surfaces
+@subsubsection occt_iges_341 Curves
+@subsubsection occt_iges_342 Surfaces
-@subsubsection occt_1856844696_87424368343 Topological entities
+@subsubsection occt_iges_343 Topological entities
<h5>Translation in Face mode</h5>
<h5>Translation in BRep mode</h5>
-@subsection occt_1856844696_8742436835 Tolerance management
-@subsubsection occt_1856844696_87424368351 Setting resolution in an IGES file
+@subsection occt_iges_35 Tolerance management
+@subsubsection occt_iges_351 Setting resolution in an IGES file
There are several possibilities to set resolution in an IGES file. They are controlled by write.precision.mode parameter; the dependence between the value of this parameter and the set resolution is described in paragraph 3.3.2 Setting the translation parameters.
If the value of parameter write.precision.mode is -1, 0 or 1, resolution is computed from tolerances of sub-shapes inside the shape to be translated. In this computation, only tolerances of TopoDS_Edges and TopoDS_Vertices participate since they reflect the accuracy of the shape. TopoDS_Faces are ignored in computations since their tolerances may have influence on resulting computed resolution while IGES resolution mainly concerns points and curves but not surfaces.
-@subsection occt_1856844696_8742436836 Code architecture
-@subsubsection occt_1856844696_87424368361 List of the classes
+@subsection occt_iges_36 Code architecture
+@subsubsection occt_iges_361 List of the classes
<h5>package IGESControl </h5>
IGESControl_Controller
IGESControl_Writer
<h5>package IGESConvGeom </h5>
IGESConvGeom_GeomBuilder
For description of classes refer to CDL.
-@subsubsection occt_1856844696_87424368362 List of API classes
+@subsubsection occt_iges_362 List of API classes
<h5>package IGESControl</h5>
* IGESControl_Controller
* IGESControl_Writer
* class IGESData_IGESModel
* class IGESData_IGESEntity
For details refer to 4. API for reading/writing IGES and CDL.
-@subsubsection occt_1856844696_87424368363 Graph of calls
+@subsubsection occt_iges_363 Graph of calls
The following diagram illustrates the class structure in writing IGES.
The highlighted classes are intended to translate geometry.
- @image html /user_guides/iges/images/iges_image004.jpg
- @image latex /user_guides/iges/images/iges_image004.jpg
+ @image html /user_guides/iges/images/iges_image004.png
+ @image latex /user_guides/iges/images/iges_image004.png
-@subsection occt_1856844696_8742436837 Example
+@subsection occt_iges_37 Example
+
+~~~~~{c++}
#include IGESControl_Controller.hxx
#include IGESControl_Writer.hxx
#include TopoDS_Shape.hxx
Standard_Boolean OK = ICW.Write (;MyFile.igs;);
//writes a model to the file MyFile.igs
}
+~~~~~
+
@section occt_1856844696_1288309531 API for reading/writing IGES
@subsection occt_1856844696_12883095311 Overview
+
API classes provides the following tools:
* loading IGES files into memory,
* checking IGES files consistency,
Purpose: Creates a new empty model ready to receive data of the norm. The Global section is filled with static parameters (receiver, author, company and unit).
<h5>Method for getting the actor object</h5>
IGESControl:: ActorRead
-Handle_Transfer_ActorOfTransientProcess ActorRead( const Handle(Interface_InterfaceModel)& model) const;
+Handle_Transfer_ActorOfTransientProcess ActorRead( const Handle(Interface_InterfaceModel)& model) const;
Purpose: Returns the actor object for reading (actually, it is of type IGESToBRep_Actor) with a set parameter of spline continuity taken from static parameter.
<h5>Method for translating an Open CASCADE Technology shape</h5>
IGESControl:: TransferWriteShape
-virtual IFSelect_ReturnStatus TransferWriteShape(const TopoDS_Shape& shape, const Handle(Transfer_FinderProcess)& FP, const Handle(Interface_InterfaceModel)& model, const Standard_Integer modetrans = 0) const;
+virtual IFSelect_ReturnStatus TransferWriteShape(const TopoDS_Shape& shape, const Handle(Transfer_FinderProcess)& FP, const Handle(Interface_InterfaceModel)& model, const Standard_Integer modetrans = 0) const;
Purpose: Translates shape into the interface model.
modetrans: 0 - group of Faces (IGES 5.1) , 1 - for BRep (IGES = 5.1)
Returns:
<h5>Constructors: </h5>
* IGESControl_Reader ();
Purpose: Creates a reader from scratch and with a new WorkSession object.
- * IGESControl_Reader (const Handle(XSControl_WorkSession)& WS,
+ * IGESControl_Reader (const Handle(XSControl_WorkSession)& WS,
const Standard_Boolean scratch);
Purpose: Defines work session for the reader. If scratch is True the new model will be created in the work session.
<h5>Methods for dealing with WorkSession object </h5>
* IGESControl_Reader::SetWS
-void SetWS ( const Handle(XSControl_WorkSession)& WS,
+void SetWS ( const Handle(XSControl_WorkSession)& WS,
const Standard_Boolean scratch = Standard_True);
Purpose: Defines the work session for the reader.
If scratch is True the new model will be created in the work session object.
* if first is a name of a selection and second is defined - the criterion defined by second is applied to result of first selection
Remarks:
if second is erroneous it is ignored.
-Handle_TColStd_HSequenceOfTransient GiveList( const Standard_CString first, const Handle(Standard_Transient)& ent) ;
+Handle_TColStd_HSequenceOfTransient GiveList( const Standard_CString first, const Handle(Standard_Transient)& ent) ;
Purpose: Returns a list of entities from the model according to the following rules:
* if first is a selection name and second is an entity or a list of entities (as a HSequenceOfTransient) - the standard result of this selection is applied to this list.
Remarks:
if first is erroneous, a null handle is returned.
<h5>Methods for performing translation</h5>
* IGESControl_Reader::TransferEntity
-Standard_Boolean TransferEntity(const Handle(Standard_Transient)& start) ;
+Standard_Boolean TransferEntity(const Handle(Standard_Transient)& start) ;
Purpose: Performs the translation of the entity specified by its handle.
Returns False if an entity is not in the Model, else returns the result of the transfer.
* IGESControl_Reader:: TransferList
-Standard_Integer TransferList( const Handle(TColStd_HSequenceOfTransient)& list) ;
+Standard_Integer TransferList( const Handle(TColStd_HSequenceOfTransient)& list) ;
Purpose: Performs the translation of the list of entities.
Returns the number of successful transfers.
<h5>Methods for printing statistics</h5>
modecr corresponds to write mode:
0 - Face (default),
1 - BRep
- * IGESControl_Writer( const Handle(IGESData_IGESModel)& model,
+ * IGESControl_Writer( const Handle(IGESData_IGESModel)& model,
const Standard_Integer modecr = 0);
Purpose: Creates a writer object with an already prepared IGES model and write mode.
<h5>Methods dealing with IGES models</h5>
Purpose: Prepares the model before writing by setting the required statuses inside the model.
<h5>Methods dealing with transfer processes</h5>
* IGESControl_Writer:: SetTransferProcess
-void SetTransferProcess(const Handle(Transfer_FinderProcess)& TP) ;
+void SetTransferProcess(const Handle(Transfer_FinderProcess)& TP) ;
Purpose: Sets the FinderProcess object for the writer.
* IGESControl_Writer:: TransferProcess
Handle_Transfer_FinderProcess TransferProcess() const;
Purpose: Returns the FinderProcess object (containing final results and messages if any).
<h5>Methods for performing translation</h5>
* IGESControl_Writer:: AddShape
-Standard_Boolean AddShape(const TopoDS_Shape& sh) ;
+Standard_Boolean AddShape(const TopoDS_Shape& sh) ;
Purpose: Translates a shape sh to IGES entities and adds them to the model.
Returns True if done, False if sh is not suitable for IGES or is null.
* IGESControl_Writer:: AddGeom
-Standard_Boolean AddGeom(const Handle(Standard_Transient)& geom) ;
+Standard_Boolean AddGeom(const Handle(Standard_Transient)& geom) ;
Purpose: Translates geom (which must be a curve or a surface) to IGES entities and adds them to the model.
Returns True if done, False if geom is neither a surface nor a curve suitable for IGES or is null.
* IGESControl_Writer:: AddEntity
-Standard_Boolean AddEntity(const Handle(IGESData_IGESEntity)& ent) ;
+Standard_Boolean AddEntity(const Handle(IGESData_IGESEntity)& ent) ;
Purpose: Adds an IGES entity (and the ones it references) to the model.
Returns False if ent is null.
<h5>Methods for writing an IGES file</h5>
* IGESControl_Writer:: Write
-Standard_Boolean Write( Standard_OStream& S, const Standard_Boolean fnes = Standard_False) ;
+Standard_Boolean Write( Standard_OStream& S, const Standard_Boolean fnes = Standard_False) ;
Standard_Boolean Write( const Standard_CString file, const Standard_Boolean fnes = Standard_False) ;
Purpose: Prepares (call ComputeModel()) and writes the model to the stream S or to the file file.
Returns True if the operation was correctly performed, False in case of error.
Purpose: Performs checking of a loaded IGES file calling Interface_CheckTool and Interface_CheckIterator. If withprint is True outputs the results of checking to the default trace file.
<h5>Methods for preparing the transfer process</h5>
* IGESToBRep_Reader:: SetModel
-void SetModel(const Handle(IGESData_IGESModel)& model) ;
+void SetModel(const Handle(IGESData_IGESModel)& model) ;
Purpose: Sets a new IGES model object. Clears the list of translated shapes (if there are any), sets a new transfer process object.
* IGESToBRep_Reader:: Model
Handle_IGESData_IGESModel Model() const;
Purpose: Returns the used IGES model object.
* IGESToBRep_Reader:: SetTransientProcess
-void SetTransientProcess(const Handle(Transfer_TransientProcess)& TP) ;
+void SetTransientProcess(const Handle(Transfer_TransientProcess)& TP) ;
Purpose: Sets the transfer process object.
* IGESToBRep_Reader:: TransientProcess
Handle_Transfer_TransientProcess TransientProcess() const;
Purpose: Returns a new Empty Model of the same type as this object, i.e. of type IGESData_IGESModel.
<h5>Methods for dealing with the Start and the Global sections</h5>
* IGESData_IGESModel::DumpHeader
-void DumpHeader(Standard_OStream& S, const Standard_Integer level = 0) const;
+void DumpHeader(Standard_OStream& S, const Standard_Integer level = 0) const;
Remark: the Integer parameter is intended to be used as a level indicator, but not used for the moment.
* IGESData_IGESModel::StartSection
Handle_TColStd_HSequenceOfHAsciiString StartSection() const;
void ClearStartSection() ;
Purpose: Clears the Start section.
* IGESData_IGESModel::SetStartSection
-void SetStartSection(const Handle(TColStd_HSequenceOfHAsciiString)& list, const Standard_Boolean copy = Standard_True) ;
+void SetStartSection(const Handle(TColStd_HSequenceOfHAsciiString)& list, const Standard_Boolean copy = Standard_True) ;
Purpose: Sets a new Start section from the list of strings list, copying it if copy is True (by default) or pointing to the list if copy is False.
* IGESData_IGESModel::AddStartLine
void AddStartLine(const Standard_CString line, const Standard_Integer atnum = 0) ;
Purpose: Adds a new string to the end of the existing Start section if atnum is 0 or not given, or before the atnum-th line.
Remark: If a number is out of range [0, NbStartLines()], the line is added at the end of section.
* IGESData_IGESModel::GlobalSection
-const IGESData_GlobalSection& GlobalSection() const;
+const IGESData_GlobalSection& GlobalSection() const;
Purpose: Returns the Global section of the Model.
* IGESData_IGESModel::SetGlobalSection.
-void SetGlobalSection(const IGESData_GlobalSection& header) ;
+void SetGlobalSection(const IGESData_GlobalSection& header) ;
Purpose: Sets the Model's Global section.
* IGESData_IGESModel::ApplyStatic
Standard_Boolean ApplyStatic(const Standard_CString param = ;;) ;
Remark: To set a unit into the Global section use the IGESData_BasicEditor class.
See also: User’s Guide: Parameters of translation.
* IGESData_IGESModel::GetFromAnother
-void GetFromAnother(const Handle(Interface_InterfaceModel)& other) ;
+void GetFromAnother(const Handle(Interface_InterfaceModel)& other) ;
Purpose: Takes the Global section from another Model.
* IGESData_IGESModel::VerifyCheck
-virtual void VerifyCheck(Interface_Check& ach) const;
+virtual void VerifyCheck(Interface_Check& ach) const;
Purpose: Checks whether the Global section contains valid data according to the IGES specification. If the Global section is correct this method adds nothing into ach, but if not the method adds fail messages.
* IGESData_IGESModel::SetLineWeights
void SetLineWeights(const Standard_Real defw) ;
void ClearLabels() ;
Purpose: Erases labels. Not yet implemented.
* IGESData_IGESModel::PrintLabel
-void PrintLabel(const Handle(Standard_Transient)& ent, Standard_OStream& S) const;
+void PrintLabel(const Handle(Standard_Transient)& ent, Standard_OStream& S) const;
Purpose: Prints the Directory Entry number of a given entity, i.e. 'Dnn' where Dnn=2*number-1on the stream S.
* IGESData_IGESModel::StringLabel
-Handle_TCollection_HAsciiString StringLabel (const Handle(Standard_Transient)& ent) const;
+Handle_TCollection_HAsciiString StringLabel (const Handle(Standard_Transient)& ent) const;
Purpose: Returns a string with a Directory Entry number of a given entity, i.e. a string 'Dnn' where Dnn=2*number-1.
* IGESData_IGESModel::Entity
Handle_IGESData_IGESEntity Entity(const Standard_Integer num) const;
Purpose: Returns an entity given by its rank number.
* IGESData_IGESModel::DNum
-Standard_Integer DNum(const Handle(IGESData_IGESEntity)& ent) const;
+Standard_Integer DNum(const Handle(IGESData_IGESEntity)& ent) const;
Purpose: Returns the DE Number of an entity, i.e. 2*Number(ent)-1, or 0 if ent is unknown from this Model.
@subsubsection occt_1856844696_128830953133 Class IGESData_IGESEntity
<h4>General description</h4>
Purpose: Sets the Type and Form Numbers to new values.
Remarks: Private method. Reserved for special use.
* IGESData_IGESEntity::InitDirFieldEntity
-void InitDirFieldEntity( const Standard_Integer fieldnum, const Handle(IGESData_IGESEntity)& ent) ;
+void InitDirFieldEntity( const Standard_Integer fieldnum, const Handle(IGESData_IGESEntity)& ent) ;
Purpose: Sets a directory field to an ent of any kind (see DirFieldEntity() for more details).
Remarks: If fieldnum is not equal to values listed in DirFieldEntity(), this method does nothing.
* IGESData_IGESEntity::InitTransf
-void InitTransf(const Handle(IGESData_TransfEntity)& ent) ;
+void InitTransf(const Handle(IGESData_TransfEntity)& ent) ;
Purpose: Sets the Transf or erases it if ent is null.
* IGESData_IGESEntity::InitView
-void InitView(const Handle(IGESData_ViewKindEntity)& ent) ;
+void InitView(const Handle(IGESData_ViewKindEntity)& ent) ;
Purpose: Sets the View or erases it if ent is null.
* IGESData_IGESEntity::InitLineFont
-void InitLineFont( const Handle(IGESData_LineFontEntity)& ent, const Standard_Integer rank = 0) ;
+void InitLineFont( const Handle(IGESData_LineFontEntity)& ent, const Standard_Integer rank = 0) ;
Purpose: Sets the LineFont. If ent is null the RankLineFont is set to rank, otherwise it is set to a negative value.
* IGESData_IGESEntity::InitLevel
-void InitLevel( const Handle(IGESData_LevelListEntity)& ent, const Standard_Integer val = 0) ;
+void InitLevel( const Handle(IGESData_LevelListEntity)& ent, const Standard_Integer val = 0) ;
Purpose: Sets the Level. If ent is null the DefLevel is set to val, otherwise it is set to a negative value.
* IGESData_IGESEntity::InitColor
-void InitColor( const Handle(IGESData_ColorEntity)& ent, const Standard_Integer rank = 0) ;
+void InitColor( const Handle(IGESData_ColorEntity)& ent, const Standard_Integer rank = 0) ;
Purpose: Sets the Color. If ent is null the DefColor is set to rank, otherwise it is set to a negative value.
* IGESData_IGESEntity::InitStatus
void InitStatus( const Standard_Integer blank,
const Standard_Integer hierarchy) ;
Purpose: Sets the flags of the Directory Part.
* IGESData_IGESEntity::SetLabel
-void SetLabel( const Handle(TCollection_HAsciiString)& label, const Standard_Integer sub = -1) ;
+void SetLabel( const Handle(TCollection_HAsciiString)& label, const Standard_Integer sub = -1) ;
Purpose: Sets a new Label to an Entity. If sub is given, it sets the value of SubScriptNumber, else SubScriptNumber is erased.
* IGESData_IGESEntity::InitMisc
-void InitMisc( const Handle(IGESData_IGESEntity)& str,
- const Handle(IGESData_LabelDisplayEntity)& lab,
+void InitMisc( const Handle(IGESData_IGESEntity)& str,
+ const Handle(IGESData_LabelDisplayEntity)& lab,
const Standard_Integer weightnum) ;
Purpose: Sets data or erases it if it is given as null (zero for weightnum):
str for Structure,
* IGESData_IGESEntity::Transf
Handle_IGESData_TransfEntity Transf() const;
Purpose: Returns the Transformation Matrix (under IGES definition). Returns a null handle if there is none.
-Remarks: For a more complete use, see Location & CompoundLocation.
+Remarks: For a more complete use, see Location & CompoundLocation.
* IGESData_IGESEntity::HasLabelDisplay
Standard_Boolean HasLabelDisplay() const;
Purpose: Returns True if the LabelDisplay mode is defined for this entity.
Purpose: Returns the Associativity List in the form of an EntityIterator.
* IGESData_IGESEntity::NbTypedAssociativities
Standard_Integer NbTypedAssociativities
- const Handle(Standard_Type)& atype) const;
+ const Handle(Standard_Type)& atype) const;
Purpose: Returns information on how many Associativities have the given type.
* IGESData_IGESEntity::TypedAssociativity
Handle_IGESData_IGESEntity TypedAssociativity
- (const Handle(Standard_Type)& atype) const;
+ (const Handle(Standard_Type)& atype) const;
Purpose: Returns the Associativity of a given Type (if one exists)
Exceptions: Interface_InterfaceError if there is none or more than one associativity.
* IGESData_IGESEntity::AddAssociativity
-void AddAssociativity(const Handle(IGESData_IGESEntity)& ent) ;
+void AddAssociativity(const Handle(IGESData_IGESEntity)& ent) ;
Purpose: Adds an Associativity to the list (called by Associate only).
Exceptions: Standard_NullObject if ent is null.
* IGESData_IGESEntity::RemoveAssociativity
-void RemoveAssociativity(const Handle(IGESData_IGESEntity)& ent) ;
+void RemoveAssociativity(const Handle(IGESData_IGESEntity)& ent) ;
Purpose: Removes an Associativity from the list (called by Dissociate).
Exceptions: Standard_NullObject if ent is null.
* IGESData_IGESEntity::LoadAssociativities
-void LoadAssociativities(const Interface_EntityList& list) ;
+void LoadAssociativities(const Interface_EntityList& list) ;
Purpose: Loads a complete List of Asociativities (used during Read or Copy operations).
* IGESData_IGESEntity::ClearAssociativities
void ClearAssociativities() ;
Purpose: Removes all associativities at once.
* IGESData_IGESEntity::Associate
-void Associate(const Handle(IGESData_IGESEntity)& ent) const;
+void Associate(const Handle(IGESData_IGESEntity)& ent) const;
Purpose: Sets this object to the Associativity list of another Entity. If ent is a null object, method does nothing.
* IGESData_IGESEntity::Dissociate
-void Dissociate(const Handle(IGESData_IGESEntity)& ent) const;
+void Dissociate(const Handle(IGESData_IGESEntity)& ent) const;
Purpose: Removes this object from the Associativity list of another Entity. If ent is a null object, method does nothing.
* IGESData_IGESEntity::ArePresentProperties
Standard_Boolean ArePresentProperties() const;
Purpose: Returns the Property List in the form of an EntityIterator
* IGESData_IGESEntity::NbTypedProperties
Standard_Integer NbTypedProperties
- (const Handle(Standard_Type)& atype) const;
+ (const Handle(Standard_Type)& atype) const;
Purpose: Returns information on how many Properties have a given type
* IGESData_IGESEntity::TypedProperty
Handle_IGESData_IGESEntity TypedProperty
- (const Handle(Standard_Type)& atype) const;
+ (const Handle(Standard_Type)& atype) const;
Purpose: Returns the Property of a given Type (if only one exists)
Exceptions: Interface_InterfaceError if there is none or more than one Properties.
* IGESData_IGESEntity::AddProperty
-void AddProperty(const Handle(IGESData_IGESEntity)& ent) ;
+void AddProperty(const Handle(IGESData_IGESEntity)& ent) ;
Purpose: Adds a Property to the list.
Exceptions: Standard_NullObject if entis null.
* IGESData_IGESEntity::RemoveProperty
-void RemoveProperty(const Handle(IGESData_IGESEntity)& ent) ;
+void RemoveProperty(const Handle(IGESData_IGESEntity)& ent) ;
Purpose: Removes a Property from the list.
Exceptions: Standard_NullObject if entis null.
* IGESData_IGESEntity::LoadProperties
-void LoadProperties(const Interface_EntityList& list) ;
+void LoadProperties(const Interface_EntityList& list) ;
Purpose: Loads a complete List of Properties (used during Read or Copy operations).
* IGESData_IGESEntity::ClearProperties() ;
void ClearProperties() ;
Modeling Algorithms {#user_guides__modeling_algos}
=========================
+@tableofcontents
+
@section occt_modalg_1 Introduction
@subsection occt_modalg_1_1 The Modeling Algorithms Module
BRepBuilderAPI_MakeEdge provides valuable information. For example, when creating an edge from two points, two vertices have to be created from the points. Sometimes you may be interested in getting these vertices quickly without exploring the new edge. Such information can be provided when using a class. The following example shows a function creating an edge and two vertices from two points.
~~~~~
-void MakeEdgeAndVertices(const gp_Pnt& P1,
-const gp_Pnt& P2,
-TopoDS_Edge& E,
-TopoDS_Vertex& V1,
-TopoDS_Vertex& V2)
+void MakeEdgeAndVertices(const gp_Pnt& P1,
+const gp_Pnt& P2,
+TopoDS_Edge& E,
+TopoDS_Vertex& V1,
+TopoDS_Vertex& V2)
{
BRepBuilderAPI_MakeEdge ME(P1,P2);
if (!ME.IsDone()) {
The *Geom2dAPI_InterCurveCurve* class allows the evaluation of the intersection points (*gp_Pnt2d*) between two geometric curves (*Geom2d_Curve*) and the evaluation of the points of self-intersection of a curve.
-@image html /user_guides/modeling_algos/images/modeling_algos_image003.jpg "Intersection and self-intersection of curves"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image003.jpg "Intersection and self-intersection of curves"
+@image html /user_guides/modeling_algos/images/modeling_algos_image003.png "Intersection and self-intersection of curves"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image003.png "Intersection and self-intersection of curves"
In both cases, the algorithm requires a value for the tolerance (Standard_Real) for the confusion between two points. The default tolerance value used in all constructors is *1.0e-6.*
-@image html /user_guides/modeling_algos/images/modeling_algos_image004.jpg "Intersection and tangent intersection"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image004.jpg "Intersection and tangent intersection"
+@image html /user_guides/modeling_algos/images/modeling_algos_image004.png "Intersection and tangent intersection"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image004.png "Intersection and tangent intersection"
The algorithm returns a point in the case of an intersection and a segment in the case of tangent intersection.
If you need access to a wider range of functionalities the following method will return the algorithmic object for the calculation of intersections:
~~~~~
-Geom2dInt_GInter& TheIntersector = Intersector.Intersector();
+Geom2dInt_GInter& TheIntersector = Intersector.Intersector();
~~~~~
@subsubsection occt_modalg_2_2_2 Intersection of Curves and Surfaces
GeomAPI_IntCS Intersector(C, S);
~~~~~
+To call the number of intersection points, use:
~~~~~
Standard_Integer nb = Intersector.NbPoints();
~~~~~
-Calls the number of intersection points.
+
~~~~~
-gp_Pnt& P = Intersector.Point(Index);
+gp_Pnt& P = Intersector.Point(Index);
~~~~~
Where *Index* is an integer between 1 and *nb*, calls the intersection points.
This class may be instantiated as follows:
~~~~~
Geom2dAPI_Interpolate
-(const Handle_TColgp_HArray1OfPnt2d& Points,
+(const Handle_TColgp_HArray1OfPnt2d& Points,
const Standard_Boolean PeriodicFlag,
const Standard_Real Tolerance);
This class may be instantiated as follows:
~~~~~
GeomAPI_Interpolate
-(const Handle_TColgp_HArray1OfPnt& Points,
+(const Handle_TColgp_HArray1OfPnt& Points,
const Standard_Boolean PeriodicFlag,
const Standard_Real Tolerance);
The *Geom2dGcc* package solves geometric constructions of lines and circles expressed by constraints such as tangency or parallelism, that is, a constraint expressed in geometric terms. As a simple example the following figure shows a line which is constrained to pass through a point and be tangent to a circle.
-@image html /user_guides/modeling_algos/images/modeling_algos_image005.jpg "A constrained line"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image005.jpg "A constrained line"
+@image html /user_guides/modeling_algos/images/modeling_algos_image005.png "A constrained line"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image005.png "A constrained line"
The *Geom2dGcc* package focuses on algorithms; it is useful for finding results, but it does not offer any management or modification functions, which could be applied to the constraints or their arguments. This package is designed to offer optimum performance, both in rapidity and precision. Trivial cases (for example, a circle centered on one point and passing through another) are not treated.
@subsubsection occt_modalg_2_8_1 Exterior/Interior
It is not hard to define the interior and exterior of a circle. As is shown in the following diagram, the exterior is indicated by the sense of the binormal, that is to say the right side according to the sense of traversing the circle. The left side is therefore the interior (or "material").
-@image html /user_guides/modeling_algos/images/modeling_algos_image006.jpg "Exterior/Interior of a Circle"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image006.jpg "Exterior/Interior of a Circle"
+@image html /user_guides/modeling_algos/images/modeling_algos_image006.png "Exterior/Interior of a Circle"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image006.png "Exterior/Interior of a Circle"
By extension, the interior of a line or any open curve is defined as the left side according to the passing direction, as shown in the following diagram:
-@image html /user_guides/modeling_algos/images/modeling_algos_image007.jpg "Exterior/Interior of a Line and a Curve"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image007.jpg "Exterior/Interior of a Line and a Curve"
+@image html /user_guides/modeling_algos/images/modeling_algos_image007.png "Exterior/Interior of a Line and a Curve"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image007.png "Exterior/Interior of a Line and a Curve"
@subsubsection occt_modalg_2_8_2 Orientation of a Line
It is sometimes necessary to define in advance the sense of travel along a line to be created. This sense will be from first to second argument.
The following figure shows a line, which is first tangent to circle C1 which is interior to the line, and then passes through point P1.
-@image html /user_guides/modeling_algos/images/modeling_algos_image008.jpg "An Oriented Line"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image008.jpg "An Oriented Line"
+@image html /user_guides/modeling_algos/images/modeling_algos_image008.png "An Oriented Line"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image008.png "An Oriented Line"
@subsection occt_modalg_2_9 Examples
**Example 1 Case 1**
-@image html /user_guides/modeling_algos/images/modeling_algos_image009.jpg "Both circles outside"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image009.jpg "Both circles outside"
+@image html /user_guides/modeling_algos/images/modeling_algos_image009.png "Both circles outside"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image009.png "Both circles outside"
Constraints:
Tangent and Exterior to C1.
**Example 1 Case 2**
-@image html /user_guides/modeling_algos/images/modeling_algos_image010.jpg "Both circles enclosed"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image010.jpg "Both circles enclosed"
+@image html /user_guides/modeling_algos/images/modeling_algos_image010.png "Both circles enclosed"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image010.png "Both circles enclosed"
Constraints:
Tangent and Including C1.
**Example 1 Case 3**
-@image html /user_guides/modeling_algos/images/modeling_algos_image011.jpg "C1 enclosed, C2 outside"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image011.jpg "C1 enclosed, C2 outside"
+@image html /user_guides/modeling_algos/images/modeling_algos_image011.png "C1 enclosed, C2 outside"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image011.png "C1 enclosed, C2 outside"
Constraints:
Tangent and Including C1.
**Example 1 Case 4**
-@image html /user_guides/modeling_algos/images/modeling_algos_image012.jpg "C1 outside, C2 enclosed"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image012.jpg "C1 outside, C2 enclosed"
+@image html /user_guides/modeling_algos/images/modeling_algos_image012.png "C1 outside, C2 enclosed"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image012.png "C1 outside, C2 enclosed"
Constraints:
Tangent and Exterior to C1.
Tangent and Including C2.
**Example 1 Case 5**
-@image html /user_guides/modeling_algos/images/modeling_algos_image013.jpg "With no qualifiers specified"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image013.jpg "With no qualifiers specified"
+@image html /user_guides/modeling_algos/images/modeling_algos_image013.png "With no qualifiers specified"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image013.png "With no qualifiers specified"
Constraints:
Tangent and Undefined with respect to C1.
The following four diagrams show the four cases in using qualifiers in the creation of a circle.
**Example 2 Case 1**
-@image html /user_guides/modeling_algos/images/modeling_algos_image014.jpg "Both solutions outside"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image014.jpg "Both solutions outside"
+@image html /user_guides/modeling_algos/images/modeling_algos_image014.png "Both solutions outside"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image014.png "Both solutions outside"
Constraints:
Tangent and Exterior to C1.
**Example 2 Case 2**
-@image html /user_guides/modeling_algos/images/modeling_algos_image015.jpg "C2 encompasses C1"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image015.jpg "C2 encompasses C1"
+@image html /user_guides/modeling_algos/images/modeling_algos_image015.png "C2 encompasses C1"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image015.png "C2 encompasses C1"
Constraints:
Tangent and Exterior to C1.
~~~~~
**Example 2 Case 3**
-@image html /user_guides/modeling_algos/images/modeling_algos_image016.jpg "Solutions enclose C2"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image016.jpg "Solutions enclose C2"
+@image html /user_guides/modeling_algos/images/modeling_algos_image016.png "Solutions enclose C2"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image016.png "Solutions enclose C2"
Constraints:
Tangent and Exterior to C1.
~~~~~
**Example 2 Case 4**
-@image html /user_guides/modeling_algos/images/modeling_algos_image017.jpg "Solutions enclose C1"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image017.jpg "Solutions enclose C1"
+@image html /user_guides/modeling_algos/images/modeling_algos_image017.png "Solutions enclose C1"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image017.png "Solutions enclose C1"
Constraints:
Tangent and Enclosing C1.
~~~~~
-Tangent ( point | circle ) & Parallel ( line )
-Tangent ( point | circle ) & Perpendicular ( line | circle )
-Tangent ( point | circle ) & Oblique ( line )
+Tangent ( point | circle ) & Parallel ( line )
+Tangent ( point | circle ) & Perpendicular ( line | circle )
+Tangent ( point | circle ) & Oblique ( line )
Tangent ( 2 { point | circle } )
Bisector( line | line )
~~~~~
#### Creation of a Circle
~~~~~
-Tangent ( point | line | circle ) & Center ( point )
+Tangent ( point | line | circle ) & Center ( point )
Tangent ( 3 { point | line | circle } )
-Tangent ( 2 { point | line | circle } ) & Radius ( real )
-Tangent ( 2 { point | line | circle } ) & Center ( line | circle )
-Tangent ( point | line | circle ) & Center ( line | circle ) & Radius ( real )
+Tangent ( 2 { point | line | circle } ) & Radius ( real )
+Tangent ( 2 { point | line | circle } ) & Center ( line | circle )
+Tangent ( point | line | circle ) & Center ( line | circle ) & Radius ( real )
~~~~~
For each algorithm, the tolerance (and angular tolerance if appropriate) is given as an argument. Calculation is done with the highest precision available from the hardware.
#### Creation of a Circle
~~~~~
-Tangent ( curve ) & Center ( point )
-Tangent ( curve , point | line | circle | curve ) & Radius ( real )
-Tangent ( 2 {point | line | circle} ) & Center ( curve )
-Tangent ( curve ) & Center ( line | circle | curve ) & Radius ( real )
-Tangent ( point | line | circle ) & Center ( curve ) & Radius ( real )
+Tangent ( curve ) & Center ( point )
+Tangent ( curve , point | line | circle | curve ) & Radius ( real )
+Tangent ( 2 {point | line | circle} ) & Center ( curve )
+Tangent ( curve ) & Center ( line | circle | curve ) & Radius ( real )
+Tangent ( point | line | circle ) & Center ( curve ) & Radius ( real )
~~~~~
All calculations will be done to the highest precision available from the hardware.
#### Creation of a Line
~~~~~
-Tangent ( curve ) & Oblique ( line )
+Tangent ( curve ) & Oblique ( line )
Tangent ( curve , { point | circle | curve } )
~~~~~
~~~~~
Tangent ( curve , 2 { point | circle | curve } )
Tangent ( curve , { point | circle | curve } )
-& Center ( line | circle | curve )
+& Center ( line | circle | curve )
~~~~~
@subsection occt_modalg_2_1 Curves and Surfaces from Constraints
* *Coons* - a rounded style with less depth than *Curved*
* *Curved* - the style with the most rounded patches.
-@image html /user_guides/modeling_algos/images/modeling_algos_image018.jpg "Intersecting filleted edges with different radii leave a gap, is filled by a surface"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image018.jpg "Intersecting filleted edges with different radii leave a gap, is filled by a surface"
+@image html /user_guides/modeling_algos/images/modeling_algos_image018.png "Intersecting filleted edges with different radii leave a gap, is filled by a surface"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image018.png "Intersecting filleted edges with different radii leave a gap, is filled by a surface"
@subsubsection occt_modalg_2_11_3 Surfaces from curve and point constraints
The class *MakeApprox* allows converting a *GeomPlate* surface into a *Geom_BSplineSurface*.
-@image html /user_guides/modeling_algos/images/modeling_algos_image019.jpg "Surface generated from four curves and a point"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image019.jpg "Surface generated from four curves and a point"
+@image html /user_guides/modeling_algos/images/modeling_algos_image019.png "Surface generated from four curves and a point"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image019.png "Surface generated from four curves and a point"
Let us create a Plate surface and approximate it from a polyline as a curve constraint and a point constraint
*Geom2dAPI_ProjectPointOnCurve* allows calculation of all the normals projected from a point (*gp_Pnt2d*) onto a geometric curve (*Geom2d_Curve*). The calculation may be restricted to a given domain.
-@image html /user_guides/modeling_algos/images/modeling_algos_image020.jpg "Normals from a point to a curve"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image020.jpg "Normals from a point to a curve"
+@image html /user_guides/modeling_algos/images/modeling_algos_image020.png "Normals from a point to a curve"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image020.png "Normals from a point to a curve"
The curve does not have to be a *Geom2d_TrimmedCurve*. The algorithm will function with any
If you want to use the wider range of functionalities available from the *Extrema* package, a call to the *Extrema()* method will return the algorithmic object for calculating extrema. For example:
~~~~~
-Extrema_ExtPC2d& TheExtrema = Projector.Extrema();
+Extrema_ExtPC2d& TheExtrema = Projector.Extrema();
~~~~~
@subsubsection occt_modalg_2_12_5 GeomAPI_ProjectPointOnCurve
If you want to use the wider range of functionalities available from the *Extrema* package, a call to the *Extrema()* method will return the algorithmic object for calculating the extrema. For example:
~~~~~
-Extrema_ExtPC& TheExtrema = Projector.Extrema();
+Extrema_ExtPC& TheExtrema = Projector.Extrema();
~~~~~
@subsubsection occt_modalg_2_12_6 Projection of a Point on a Surface
*GeomAPI_ProjectPointOnSurf* class allows calculation of all normals projected from a point from *gp_Pnt* onto a geometric surface from Geom_Surface.
-@image html /user_guides/modeling_algos/images/modeling_algos_image021.jpg "Projection of normals from a point to a surface"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image021.jpg "Projection of normals from a point to a surface"
+@image html /user_guides/modeling_algos/images/modeling_algos_image021.png "Projection of normals from a point to a surface"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image021.png "Projection of normals from a point to a surface"
Note that the surface does not have to be of *Geom_RectangularTrimmedSurface* type.
The algorithm will function with any class inheriting Geom_Surface.
If you want to use the wider range of functionalities available from the *Extrema* package, a call to the *Extrema()* method will return the algorithmic object for calculating the extrema as follows:
~~~~~
-Extrema_ExtPS& TheExtrema = Proj.Extrema();
+Extrema_ExtPS& TheExtrema = Proj.Extrema();
~~~~~
where C is the domain of the edge; V1 is the first vertex oriented FORWARD; V2 is the second vertex oriented REVERSED; p1 and p2 are the parameters for the vertices V1 and V2 on the curve. The default tolerance is associated with this edge.
-@image html /user_guides/modeling_algos/images/modeling_algos_image022.jpg "Basic Edge Construction"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image022.jpg "Basic Edge Construction"
+@image html /user_guides/modeling_algos/images/modeling_algos_image022.png "Basic Edge Construction"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image022.png "Basic Edge Construction"
The following rules apply to the arguments:
**The parameters**
* Must be increasing and in the range of the curve, i.e.:
+
~~~~~
C->FirstParameter() <= p1 < p2 <= C->LastParameter()
~~~~~
-* If the parameters are decreasing, the Vertices are switched, i.e. V2 becomes V1 and V1 becomes V2.
-* On a periodic curve the parameters p1 and p2 are adjusted by adding or subtracting the period to obtain p1 in the range of the curve and p2 in the range p1 < p2 <= p1+ Period. So on a parametric curve p2 can be greater than the second parameter, see the figure below.
-* Can be infinite but the corresponding vertex must be Null (see above).
-* The distance between the Vertex 3d location and the point evaluated on the curve with the parameter must be lower than the default precision.
+ * If the parameters are decreasing, the Vertices are switched, i.e. V2 becomes V1 and V1 becomes V2.
+ * On a periodic curve the parameters p1 and p2 are adjusted by adding or subtracting the period to obtain p1 in the range of the curve and p2 in the range p1 < p2 <= p1+ Period. So on a parametric curve p2 can be greater than the second parameter, see the figure below.
+ * Can be infinite but the corresponding vertex must be Null (see above).
+ * The distance between the Vertex 3d location and the point evaluated on the curve with the parameter must be lower than the default precision.
The figure below illustrates two special cases, a semi-infinite edge and an edge on a periodic curve.
-@image html /user_guides/modeling_algos/images/modeling_algos_image023.jpg "Infinite and Periodic Edges"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image023.jpg "Infinite and Periodic Edges"
+@image html /user_guides/modeling_algos/images/modeling_algos_image023.png "Infinite and Periodic Edges"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image023.png "Infinite and Periodic Edges"
#### Other Edge constructions
The following example creates a rectangle centered on the origin of dimensions H, L with fillets of radius R. The edges and the vertices are stored in the arrays *theEdges* and *theVertices*. We use class *Array1OfShape* (i.e. not arrays of edges or vertices). See the image below.
-@image html /user_guides/modeling_algos/images/modeling_algos_image024.jpg "Creating a Wire"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image024.jpg "Creating a Wire"
+@image html /user_guides/modeling_algos/images/modeling_algos_image024.png "Creating a Wire"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image024.png "Creating a Wire"
~~~~~
#include <BRepBuilderAPI_MakeEdge.hxx>
void MakeArc(Standard_Real x,Standard_Real y,
Standard_Real R,
Standard_Real ang,
-TopoDS_Shape& E,
-TopoDS_Shape& V1,
-TopoDS_Shape& V2)
+TopoDS_Shape& E,
+TopoDS_Shape& V1,
+TopoDS_Shape& V2)
{
gp_Ax2 Origin = gp::XOY();
gp_Vec Offset(x, y, 0.);
// using the MakeArc function described above.
void MakeArc(Standard_Real, Standard_Real,
Standard_Real, Standard_Real,
-TopoDS_Shape&, TopoDS_Shape&, TopoDS_Shape&);
+TopoDS_Shape&, TopoDS_Shape&, TopoDS_Shape&);
Standard_Real x = L/2 - R, y = H/2 - R;
MakeArc(x,-y,R,3.*PI/2.,theEdges(2),theVertices(2),
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <TColgp_Array1OfPnt.hxx>
-TopoDS_Wire ClosedPolygon(const TColgp_Array1OfPnt& Points)
+TopoDS_Wire ClosedPolygon(const TColgp_Array1OfPnt& Points)
{
BRepBuilderAPI_MakePolygon MP;
for(Standard_Integer i=Points.Lower();i=Points.Upper();i++)
TopoDS_Face F = BRepBuilderAPI_MakeFace(S,umin,umax,vmin,vmax);
~~~~~
-@image html /user_guides/modeling_algos/images/modeling_algos_image025.jpg "Basic Face Construction"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image025.jpg "Basic Face Construction"
+@image html /user_guides/modeling_algos/images/modeling_algos_image025.png "Basic Face Construction"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image025.png "Basic Face Construction"
To make a face from the natural boundary of a surface, the parameters are not required:
The two basic constructions (from a surface and from a surface and parameters) are implemented for all the gp package surfaces, which are transformed in the corresponding Surface from Geom.
+| gp package surface | | Geom package surface |
| :------------------- | :----------- | :------------- |
| *gp_Pln* | | *Geom_Plane* |
| *gp_Cylinder* | | *Geom_CylindricalSurface* |
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
-TopoDS_Face PolygonalFace(const TColgp_Array1OfPnt& thePnts)
+TopoDS_Face PolygonalFace(const TColgp_Array1OfPnt& thePnts)
{
BRepBuilderAPI_MakePolygon MP;
for(Standard_Integer i=thePnts.Lower();
#include <TopoDS_Wire.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
-TopoDS_Wire MergeWires (const TopoDS_Wire& W1,
-const TopoDS_Wire& W2)
+TopoDS_Wire MergeWires (const TopoDS_Wire& W1,
+const TopoDS_Wire& W2)
{
BRepBuilderAPI_MakeWire MW(W1);
MW.Add(W2);
The four methods to build a box are shown in the figure:
-@image html /user_guides/modeling_algos/images/modeling_algos_image026.jpg "Making Boxes"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image026.jpg "Making Boxes"
+@image html /user_guides/modeling_algos/images/modeling_algos_image026.png "Making Boxes"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image026.png "Making Boxes"
@subsubsection occt_modalg_4_1_2 Wedge
*BRepPrimAPI_MakeWedge* class allows building a wedge, which is a slanted box, i.e. a box with angles. The wedge is constructed in much the same way as a box i.e. from three dimensions dx,dy,dz plus arguments or from an axis system, three dimensions, and arguments.
The first method is a particular case of the second with xmin = 0, xmax = ltx, zmin = 0, zmax = dz.
To make a centered pyramid you can use xmin = xmax = dx / 2, zmin = zmax = dz / 2.
-@image html /user_guides/modeling_algos/images/modeling_algos_image027.jpg "Making Wedges"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image027.jpg "Making Wedges"
+@image html /user_guides/modeling_algos/images/modeling_algos_image027.png "Making Wedges"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image027.png "Making Wedges"
@subsubsection occt_modalg_4_1_3 Rotation object
*BRepPrimAPI_MakeOneAxis* is a deferred class used as a root class for all classes constructing rotational primitives. Rotational primitives are created by rotating a curve around an axis. They cover the cylinder, the cone, the sphere, the torus, and the revolution, which provides all other curves.
The result of the OneAxis construction is a Solid, a Shell, or a Face. The face is the face covering the rotational surface. Remember that you will not use the OneAxis directly but one of the derived classes, which provide improved constructions. The following figure illustrates the OneAxis arguments.
-@image html /user_guides/modeling_algos/images/modeling_algos_image028.jpg "MakeOneAxis arguments"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image028.jpg "MakeOneAxis arguments"
+@image html /user_guides/modeling_algos/images/modeling_algos_image028.png "MakeOneAxis arguments"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image028.png "MakeOneAxis arguments"
@subsubsection occt_modalg_4_1_4 Cylinder
*BRepPrimAPI_MakeCylinder* class allows creating cylindrical primitives. A cylinder is created either in the default coordinate system or in a given coordinate system (gp_Ax2). There are two constructions:
TopoDS_Face F =
BRepPrimAPI_MakeCylinder(axes,R,DY,PI/2.);
~~~~~
-@image html /user_guides/modeling_algos/images/modeling_algos_image029.jpg "Cylinder"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image029.jpg "Cylinder"
+@image html /user_guides/modeling_algos/images/modeling_algos_image029.png "Cylinder"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image029.png "Cylinder"
@subsubsection occt_modalg_4_1_5 Cone
*BRepPrimAPI_MakeCone* class allows creating conical primitives. Like a cylinder, a cone is created either in the default coordinate system or in a given coordinate system (gp_Ax2). There are two constructions:
TopoDS_Solid S = BRepPrimAPI_MakeCone(R1,R2,H);
~~~~~
-@image html /user_guides/modeling_algos/images/modeling_algos_image030.jpg "Cone"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image030.jpg "Cone"
+@image html /user_guides/modeling_algos/images/modeling_algos_image030.png "Cone"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image030.png "Cone"
@subsubsection occt_modalg_4_1_6 Sphere
*BRepPrimAPI_MakeSphere* class allows creating spherical primitives. Like a cylinder, a sphere is created either in the default coordinate system or in a given coordinate system (gp_Ax2). There are four constructions:
Note that we could equally well choose to create Shells instead of Solids.
-@image html /user_guides/modeling_algos/images/modeling_algos_image031.jpg "Examples of Spheres"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image031.jpg "Examples of Spheres"
+@image html /user_guides/modeling_algos/images/modeling_algos_image031.png "Examples of Spheres"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image031.png "Examples of Spheres"
@subsubsection occt_modalg_4_1_7 Torus
* Two radii and two angles - builds a wraparound torus segment between two radial planes. The angles a1, a2 must follow the relation 0 < a2 - a1 < 2*PI.
* Two radii and three angles - a combination of two previous methods builds a portion of torus segment.
-@image html /user_guides/modeling_algos/images/modeling_algos_image032.gif "Examples of Tori"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image032.gif "Examples of Tori"
+@image html /user_guides/modeling_algos/images/modeling_algos_image032.png "Examples of Tori"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image032.png "Examples of Tori"
The following code builds four toroidal shells from two radii and three angles.
It is forbidden to sweep Solids and Composite Solids. A Compound generates a Compound with the sweep of all its elements.
-@image html /user_guides/modeling_algos/images/modeling_algos_image033.jpg "Generating a sweep"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image033.jpg "Generating a sweep"
+@image html /user_guides/modeling_algos/images/modeling_algos_image033.png "Generating a sweep"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image033.png "Generating a sweep"
*BRepPrimAPI_MakeSweep class* is a deferred class used as a root of the the following sweep classes:
* *BRepPrimAPI_MakePrism* - produces a linear sweep
* A vector allows creating a finite prism;
* A direction allows creating an infinite or semi-infinite prism. The semi-infinite or infinite prism is toggled by a Boolean argument. All constructors have a boolean argument to copy the original shape or share it (by default).
-The following code creates a finite, an infinite and a semi-infinite solid using a face, a direction and a length
-.
+The following code creates a finite, an infinite and a semi-infinite solid using a face, a direction and a length.
+
~~~~~
TopoDS_Face F = ..; // The swept face
gp_Dir direc(0,0,1);
// semi-infinite
~~~~~
-@image html /user_guides/modeling_algos/images/modeling_algos_image034.jpg "Finite, infinite, and semi-infinite prisms"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image034.jpg "Finite, infinite, and semi-infinite prisms"
+@image html /user_guides/modeling_algos/images/modeling_algos_image034.png "Finite, infinite, and semi-infinite prisms"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image034.png "Finite, infinite, and semi-infinite prisms"
@subsubsection occt_modalg_4_2_3 Rotation
*BRepPrimAPI_MakeRevol* class allows creating a rotational sweep from a shape, an axis (gp_Ax1), and an angle. The angle has a default value of 2*PI which means a closed revolution.
TopoDS_Solid R2 = BRepPrimAPI_MakeRevol(F,axis,ang);
~~~~~
-@image html /user_guides/modeling_algos/images/modeling_algos_image035.jpg "Full and partial rotation"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image035.jpg "Full and partial rotation"
+@image html /user_guides/modeling_algos/images/modeling_algos_image035.png "Full and partial rotation"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image035.png "Full and partial rotation"
@section occt_modalg_5 Boolean Operations
Boolean operations are used to create new shapes from the combinations of two shapes.
+| Operation | Result |
+| :---- | :------ |
| Fuse | all points in S1 or S2 |
| Common | all points in S1 and S2 |
| Cut S1 by S2| all points in S1 and not in S2 |
BRepAlgoAPI_BooleanOperation class is the deferred root class for Boolean operations.
-@image html /user_guides/modeling_algos/images/modeling_algos_image036.jpg "Boolean Operations"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image036.jpg "Boolean Operations"
+@image html /user_guides/modeling_algos/images/modeling_algos_image036.png "Boolean Operations"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image036.png "Boolean Operations"
@subsection occt_modalg_5_1 Fuse
*BRepAlgoAPI_Fuse* performs the Fuse operation.
+
~~~~~
TopoDS_Shape A = ..., B = ...;
TopoDS_Shape S = BRepAlgoAPI_Fuse(A,B);
~~~~~
@subsection occt_modalg_5_2 Common
+
*BRepAlgoAPI_Common* performs the Common operation.
~~~~~
*BRepAlgoAPI_Section* performs the section, described as a *TopoDS_Compound* made of *TopoDS_Edge*.
-@image html /user_guides/modeling_algos/images/modeling_algos_image037.jpg "Section operation"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image037.jpg "Section operation"
+@image html /user_guides/modeling_algos/images/modeling_algos_image037.png "Section operation"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image037.png "Section operation"
~~~~~
TopoDS_Shape A = ..., TopoDS_ShapeB = ...;
A fillet description contains an edge and a radius. The edge must be shared by two faces. The fillet is automatically extended to all edges in a smooth continuity with the original edge. It is not an error to add a fillet twice, the last description holds.
-@image html /user_guides/modeling_algos/images/modeling_algos_image038.jpg "Filleting two edges using radii r1 and r2."
-@image latex /user_guides/modeling_algos/images/modeling_algos_image038.jpg "Filleting two edges using radii r1 and r2."
+@image html /user_guides/modeling_algos/images/modeling_algos_image038.png "Filleting two edges using radii r1 and r2."
+@image latex /user_guides/modeling_algos/images/modeling_algos_image038.png "Filleting two edges using radii r1 and r2."
In the following example a filleted box with dimensions a,b,c and radius r is created.
}
~~~~~
-@image html /user_guides/modeling_algos/images/modeling_algos_image039.jpg "Fillet with constant radius"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image039.jpg "Fillet with constant radius"
+@image html /user_guides/modeling_algos/images/modeling_algos_image039.png "Fillet with constant radius"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image039.png "Fillet with constant radius"
#### Changing radius
}
~~~~~
-@image html /user_guides/modeling_algos/images/modeling_algos_image040.jpg "Fillet with changing radius"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image040.jpg "Fillet with changing radius"
+@image html /user_guides/modeling_algos/images/modeling_algos_image040.png "Fillet with changing radius"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image040.png "Fillet with changing radius"
@subsection occt_modalg_6_1_2 Chamfer
Add(d1, d2, E, F) with d1 on the face F.
~~~~~
-@image html /user_guides/modeling_algos/images/modeling_algos_image041.jpg "Chamfer"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image041.jpg "Chamfer"
+@image html /user_guides/modeling_algos/images/modeling_algos_image041.png "Chamfer"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image041.png "Chamfer"
@subsection occt_modalg_6_1_3 Fillet on a planar face
TopoDS_Solid Box = BRepPrimAPI_MakeBox (a,b,c);
TopExp_Explorer ex1(Box,TopAbs_FACE);
- const TopoDS_Face& F = TopoDS::Face(ex1.Current());
+ const TopoDS_Face& F = TopoDS::Face(ex1.Current());
BRepFilletAPI_MakeFillet2d MF(F);
TopExp_Explorer ex2(F, TopAbs_VERTEX);
while (ex2.More())
Tol);
~~~~~
-@image html /user_guides/modeling_algos/images/modeling_algos_image042.jpg "Shelling"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image042.jpg "Shelling"
+@image html /user_guides/modeling_algos/images/modeling_algos_image042.png "Shelling"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image042.png "Shelling"
@subsection occt_modalg_7_2 Draft Angle
}
~~~~~
-@image html /user_guides/modeling_algos/images/modeling_algos_image043.jpg "DraftAngle"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image043.jpg "DraftAngle"
+@image html /user_guides/modeling_algos/images/modeling_algos_image043.png "DraftAngle"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image043.png "DraftAngle"
@subsection occt_modalg_7_3 Pipe Constructor
TopoDS_Shape Pipe = BRepOffsetAPI_MakePipe(Spine,Profile);
~~~~~
-@image html /user_guides/modeling_algos/images/modeling_algos_image044.jpg "Example of a Pipe"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image044.jpg "Example of a Pipe"
+@image html /user_guides/modeling_algos/images/modeling_algos_image044.png "Example of a Pipe"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image044.png "Example of a Pipe"
@subsection occt_modalg_7_4 Evolved Solid
*BRepOffsetAPI_Sewing* class allows sewing TopoDS Shapes together along their common edges. The edges can be partially shared as in the following example.
-@image html /user_guides/modeling_algos/images/modeling_algos_image045.jpg "Shapes with partially shared edges"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image045.jpg "Shapes with partially shared edges"
+@image html /user_guides/modeling_algos/images/modeling_algos_image045.png "Shapes with partially shared edges"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image045.png "Shapes with partially shared edges"
The constructor takes as arguments the tolerance (default value is 10-6) and a flag, which is used to mark the degenerate shapes.
* another Boolean indicating if the self-intersections have to be found (not used in every case).
There are six Perform methods:
-
-| ---------------------- | ------------------------------------- |
+| Method | Description |
+| :---------------------- | :------------------------------------- |
| *Perform(Height)* | The resulting prism is of the given length. |
| *Perform(Until)* | The prism is defined between the position of the base and the given face. |
| *Perform(From, Until)* | The prism is defined between the two faces From and Until. |
}
~~~~~
-@image html /user_guides/modeling_algos/images/modeling_algos_image047.jpg "Fusion with MakePrism"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image047.jpg "Fusion with MakePrism"
+@image html /user_guides/modeling_algos/images/modeling_algos_image047.png "Fusion with MakePrism"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image047.png "Fusion with MakePrism"
-@image html /user_guides/modeling_algos/images/modeling_algos_image048.jpg "Creating a prism between two faces with Perform(From, Until)"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image048.jpg "Creating a prism between two faces with Perform(From, Until)"
+@image html /user_guides/modeling_algos/images/modeling_algos_image048.png "Creating a prism between two faces with Perform(From, Until)"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image048.png "Creating a prism between two faces with Perform(From, Until)"
#### MakeDPrism
TopoDS_Shape res1 = MKDP.Shape();
~~~~~
-@image html /user_guides/modeling_algos/images/modeling_algos_image049.jpg "A tapered prism"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image049.jpg "A tapered prism"
+@image html /user_guides/modeling_algos/images/modeling_algos_image049.png "A tapered prism"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image049.png "A tapered prism"
#### MakeRevol
* another boolean indicating whether the self-intersections have to be found (not used in every case).
There are four Perform methods:
-
+| Method | Description |
+| :--------------- | :------------ |
| *Perform(Angle)* | The resulting revolution is of the given magnitude. |
| *Perform(Until)* | The revolution is defined between the actual position of the base and the given face. |
| *Perform(From, Until)* | The revolution is defined between the two faces, From and Until. |
* another Boolean indicating if self-intersections have to be found (not used in every case).
There are three Perform methods:
-
+| Method | Description |
+| :-------- | :---------- |
| *Perform()* | The pipe is defined along the entire path (spine wire) |
| *Perform(Until)* | The pipe is defined along the path until a given face |
| *Perform(From, Until)* | The pipe is defined between the two faces From and Until |
TopoDS_Shape res1 = MKPipe.Shape();
~~~~~
-@image html /user_guides/modeling_algos/images/modeling_algos_image050.jpg "Pipe depression"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image050.jpg "Pipe depression"
+@image html /user_guides/modeling_algos/images/modeling_algos_image050.png "Pipe depression"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image050.png "Pipe depression"
TopoDS_Shape res = aform.Shape();
~~~~~
-@image html /user_guides/modeling_algos/images/modeling_algos_image051.jpg "Creating a rib"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image051.jpg "Creating a rib"
+@image html /user_guides/modeling_algos/images/modeling_algos_image051.png "Creating a rib"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image051.png "Creating a rib"
@subsubsection occt_modalg_9_1_3 Gluer
TopTools_ListIteratorOfListOfShape itlb(Lfbase);
TopTools_ListIteratorOfListOfShape itlg(Lfglued);
for (; itlb.More(); itlb.Next(), itlg(Next()) {
-const TopoDS_Face& f1 = TopoDS::Face(itlg.Value());
-const TopoDS_Face& f2 = TopoDS::Face(itlb.Value());
+const TopoDS_Face& f1 = TopoDS::Face(itlg.Value());
+const TopoDS_Face& f2 = TopoDS::Face(itlb.Value());
theGlue.Bind(f1,f2);
// for example, use the class FindEdges from LocOpe to
// determine coincident edges
The class is created or initialized from a shape (the basic shape).
Three Add methods are available:
-
-| *Add(Wire, Face)* | Adds a new wire on a face of the basic shape. |
-| *Add(Edge, Face)* | Adds a new edge on a face of the basic shape. |
-| *Add(EdgeNew, EdgeOld)* | Adds a new edge on an existing one (the old edge must contain the new edge). |
+* *Add(Wire, Face)* - adds a new wire on a face of the basic shape.
+* *Add(Edge, Face)* - adds a new edge on a face of the basic shape.
+* *Add(EdgeNew, EdgeOld)* - adds a new edge on an existing one (the old edge must contain the new edge).
**Note** The added wires and edges must define closed wires on faces or wires located between two existing edges. Existing edges must not be intersected.
* Infinite faces or lines are not processed.
-@image html /user_guides/modeling_algos/images/modeling_algos_image052.jpg "Sharp, smooth and sewn edges in a simple screw shape"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image052.jpg "Sharp, smooth and sewn edges in a simple screw shape"
+@image html /user_guides/modeling_algos/images/modeling_algos_image052.png "Sharp, smooth and sewn edges in a simple screw shape"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image052.png "Sharp, smooth and sewn edges in a simple screw shape"
-@image html /user_guides/modeling_algos/images/modeling_algos_image053.jpg "Outline edges and isoparameters in the same shape"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image053.jpg "Outline edges and isoparameters in the same shape"
+@image html /user_guides/modeling_algos/images/modeling_algos_image053.png "Outline edges and isoparameters in the same shape"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image053.png "Outline edges and isoparameters in the same shape"
-@image html /user_guides/modeling_algos/images/modeling_algos_image054.jpg "A simple screw shape seen with shading"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image054.jpg "A simple screw shape seen with shading"
+@image html /user_guides/modeling_algos/images/modeling_algos_image054.png "A simple screw shape seen with shading"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image054.png "A simple screw shape seen with shading"
-@image html /user_guides/modeling_algos/images/modeling_algos_image055.jpg "An extraction showing hidden sharp edges"
-@image latex /user_guides/modeling_algos/images/modeling_algos_image055.jpg "An extraction showing hidden sharp edges"
+@image html /user_guides/modeling_algos/images/modeling_algos_image055.png "An extraction showing hidden sharp edges"
+@image latex /user_guides/modeling_algos/images/modeling_algos_image055.png "An extraction showing hidden sharp edges"
The following services are related to Hidden Lines Removal :
Modeling Data {#user_guides__modeling_data}
========================
+@tableofcontents
+
@section occt_modat_1 Introduction
Modeling Data supplies data structures to represent 2D and 3D geometric models. This manual explains how to use Modeling Data. For advanced information on modeling data, see our offerings on our web site at <a href="http://www.opencascade.org/support/training/">www.opencascade.org/support/training/</a>
The class *Interpolate* from *GeomAPI* package allows building a constrained 3D BSpline curve, defined by a table of points through which the curve passes. If required, the parameter values and vectors of the tangents can be given for each point in the table.
-@image html /user_guides/modeling_data/images/modeling_data_image003.jpg "Approximation of a BSpline from scattered points"
-@image latex /user_guides/modeling_data/images/modeling_data_image003.jpg "Approximation of a BSpline from scattered points"
+@image html /user_guides/modeling_data/images/modeling_data_image003.png "Approximation of a BSpline from scattered points"
+@image latex /user_guides/modeling_data/images/modeling_data_image003.png "Approximation of a BSpline from scattered points"
This class may be instantiated as follows:
~~~~~
~~~~~
From this object, the BSpline curve may be requested as follows:
+
~~~~~
Handle(Geom_BSplineCurve) K = Approx.Curve();
~~~~~
*AppDef* package provides low-level tools to allow parallel approximation of groups of points into Bezier or B-Spline curves using multiple point constraints.
The following low level services are provided:
+
* Definition of an array of point constraints:
-The class *MultiLine* allows defining a given number of multipoint constraints in order to build the multi-line, multiple lines passing through ordered multiple point constraints.
-@image html /user_guides/modeling_data/images/modeling_data_image004.jpg "Definition of a MultiLine using Multiple Point Constraints"
-@image latex /user_guides/modeling_data/images/modeling_data_image004.jpg "Definition of a MultiLine using Multiple Point Constraints"
+ The class *MultiLine* allows defining a given number of multipoint constraints in order to build the multi-line, multiple lines passing through ordered multiple point constraints.
+
+ @image html /user_guides/modeling_data/images/modeling_data_image004.png "Definition of a MultiLine using Multiple Point Constraints"
+ @image latex /user_guides/modeling_data/images/modeling_data_image004.png "Definition of a MultiLine using Multiple Point Constraints"
-In this image:
- * *Pi*, *Qi*, *Ri* ... *Si* can be 2D or 3Dpoints.
+ In this image:
+ * *Pi*, *Qi*, *Ri* ... *Si* can be 2D or 3D points.
* Defined as a group: *Pn*, *Qn*, *Rn,* ... *Sn* form a MultipointConstraint. They possess the same passage, tangency and curvature constraints.
* *P1*, *P2*, ... *Pn*, or the *Q*, *R*, ... or *S* series represent the lines to be approximated.
* Definition of a set of point constraints:
-The class **MultiPointConstraint** allows defining a multiple point constraint and computing the approximation of sets of points to several curves.
+
+ The class **MultiPointConstraint** allows defining a multiple point constraint and computing the approximation of sets of points to several curves.
* Computation of an approximation of a Bezier curve from a set of points:
-The class *Compute* allows making an approximation of a set of points to a Bezier curve
+
+ The class *Compute* allows making an approximation of a set of points to a Bezier curve
* Computation of an approximation of a BSpline curve from a set of points:
+
The class **BSplineCompute** allows making an approximation of a set of points to a BSpline curve.
* Definition of Variational Criteria:
+
The class *TheVariational* allows fairing the approximation curve to a given number of points using a least squares method in conjunction with a variational criterion, usually the weights at each constraint point.
#### Approximation by parametric or geometric constraints
The following low-level services are provided:
* Association of an index to an object:
+
The class *ConstraintCouple* allows you associating an index to an object to compute faired curves using *AppDef_TheVariational*.
* Definition of a set of approximations of Bezier curves:
+
The class *MultiCurve* allows defining the approximation of a multi-line made up of multiple Bezier curves.
* Definition of a set of approximations of BSpline curves:
+
The class *MultiBSpCurve* allows defining the approximation of a multi-line made up of multiple BSpline curves.
* Definition of points making up a set of point constraints
+
The class *MultiPoint* allows defining groups of 2D or 3D points making up a multi-line.
@subsection occt_modat_1_2 Direct Construction
- *TopLoc_Datum3D* class provides the elementary reference coordinate, represented by a right-handed orthonormal system of axes or by a right-handed unitary transformation.
- *TopLoc_Location* class provides the composite reference coordinate made from elementary ones. It is a marker composed of a chain of references to elementary markers. The resulting cumulative transformation is stored in order to avoid recalculating the sum of the transformations for the whole list.
-@image html /user_guides/modeling_data/images/modeling_data_image005.jpg "Structure of TopLoc_Location"
-@image latex /user_guides/modeling_data/images/modeling_data_image005.jpg "Structure of TopLoc_Location"
+@image html /user_guides/modeling_data/images/modeling_data_image005.png "Structure of TopLoc_Location"
+@image latex /user_guides/modeling_data/images/modeling_data_image005.png "Structure of TopLoc_Location"
Two reference coordinates are equal if they are made up of the same elementary coordinates in the same order. There is no numerical comparison. Two coordinates can thus correspond to the same transformation without being equal if they were not built from the same elementary coordinates.
A topological model can be considered as a graph of objects with adjacency relationships. When modeling a part in 2D or 3D space it must belong to one of the categories listed in the ShapeEnum enumeration. The TopAbspackage lists all the objects, which can be found in any model. It cannot be extended but a subset can be used. For example, the notion of solid is useless in 2D.
The terms of the enumeration appear in order from the most complex to the most simple, because objects can contain simpler objects in their description. For example, a face references its wires, edges, and vertices.
-@image html /user_guides/modeling_data/images/modeling_data_image006.jpg "ShapeEnum"
-@image latex /user_guides/modeling_data/images/modeling_data_image006.jpg "ShapeEnum"
+@image html /user_guides/modeling_data/images/modeling_data_image006.png "ShapeEnum"
+@image latex /user_guides/modeling_data/images/modeling_data_image006.png "ShapeEnum"
@subsubsection occt_modat_5_2_2 Orientation
Based on this default region the orientation allows definition of the region to be kept, which is called the *interior* or *material*. There are four orientations defining the interior.
+| Orientation | Description |
+| :--------- | :--------------------------------- |
| FORWARD | The interior is the default region. |
| REVERSED | The interior is the region complementary to the default. |
| INTERNAL | The interior includes both regions. The boundary lies inside the material. For example a surface inside a solid. |
| EXTERNAL | The interior includes neither region. The boundary lies outside the material. For example an edge in a wire-frame model. |
-@image html /user_guides/modeling_data/images/modeling_data_image007.jpg "Four Orientations"
-@image latex /user_guides/modeling_data/images/modeling_data_image007.jpg "Four Orientations"
+@image html /user_guides/modeling_data/images/modeling_data_image007.png "Four Orientations"
+@image latex /user_guides/modeling_data/images/modeling_data_image007.png "Four Orientations"
The notion of orientation is a very general one, and it can be used in any context where regions or boundaries appear. Thus, for example, when describing the intersection of an edge and a contour it is possible to describe not only the vertex of intersection but also how the edge crosses the contour considering it as a boundary. The edge would therefore be divided into two regions - exterior and interior - with the intersection vertex as the boundary. Thus an orientation can be associated with an intersection vertex as in the following figure:
+| Orientation | Association |
+| :-------- | :-------- |
| FORWARD | Entering |
| REVERSED | Exiting |
| INTERNAL | Touching from inside |
| EXTERNAL | Touching from outside |
-@image html /user_guides/modeling_data/images/modeling_data_image008.jpg "Four orientations of intersection vertices"
-@image latex /user_guides/modeling_data/images/modeling_data_image008.jpg "Four orientations of intersection vertices"
+@image html /user_guides/modeling_data/images/modeling_data_image008.png "Four orientations of intersection vertices"
+@image latex /user_guides/modeling_data/images/modeling_data_image008.png "Four orientations of intersection vertices"
Along with the Orientation enumeration the *TopAbs* package defines four methods:
The **TopAbs_State** enumeration described the position of a vertex or a set of vertices with respect to a region. There are four terms:
+|Position | Description |
+| :------ | :------- |
|IN | The point is interior. |
|OUT | The point is exterior. |
|ON | The point is on the boundary(within tolerance). |
The UNKNOWN term has been introduced because this enumeration is often used to express the result of a calculation, which can fail. This term can be used when it is impossible to know if a point is inside or outside, which is the case with an open wire or face.
-@image html /user_guides/modeling_data/images/modeling_data_image009.jpg "The four states"
-@image latex /user_guides/modeling_data/images/modeling_data_image009.jpg "The four states"
+@image html /user_guides/modeling_data/images/modeling_data_image009.png "The four states"
+@image latex /user_guides/modeling_data/images/modeling_data_image009.png "The four states"
The State enumeration can also be used to specify various parts of an object. The following figure shows the parts of an edge intersecting a face.
-@image html /user_guides/modeling_data/images/modeling_data_image010.jpg "State specifies the parts of an edge intersecting a face"
-@image latex /user_guides/modeling_data/images/modeling_data_image010.jpg "State specifies the parts of an edge intersecting a face"
+@image html /user_guides/modeling_data/images/modeling_data_image010.png "State specifies the parts of an edge intersecting a face"
+@image latex /user_guides/modeling_data/images/modeling_data_image010.png "State specifies the parts of an edge intersecting a face"
@subsection occt_modat_5_3 Manipulating shapes and sub-shapes
The information specific to each shape (the geometric support) is always added by inheritance to classes deriving from **TopoDS_TShape**. The following figures show the example of a shell formed from two faces connected by an edge.
-@image html /user_guides/modeling_data/images/modeling_data_image011.jpg "Structure of a shell formed from two faces"
-@image latex /user_guides/modeling_data/images/modeling_data_image011.jpg "Structure of a shell formed from two faces"
+@image html /user_guides/modeling_data/images/modeling_data_image011.png "Structure of a shell formed from two faces"
+@image latex /user_guides/modeling_data/images/modeling_data_image011.png "Structure of a shell formed from two faces"
-@image html /user_guides/modeling_data/images/modeling_data_image012.jpg "Data structure of the above shell"
-@image latex /user_guides/modeling_data/images/modeling_data_image012.jpg "Data structure of the above shell"
+@image html /user_guides/modeling_data/images/modeling_data_image012.png "Data structure of the above shell"
+@image latex /user_guides/modeling_data/images/modeling_data_image012.png "Data structure of the above shell"
In the previous diagram, the shell is described by the underlying shape TS, and the faces by TF1 and TF2. There are seven edges from TE1 to TE7 and six vertices from TV1 to TV6.
The following figure shows a data structure containing two versions of a solid. The second version presents a series of identical holes bored at different positions. The data structure is compact and yet keeps all information on the sub-elements.
The three references from *TSh2* to the underlying face *TFcyl* have associated local coordinate systems, which correspond to the successive positions of the hole.
-@image html /user_guides/modeling_data/images/modeling_data_image013.jpg "Data structure containing two versions of a solid"
-@image latex /user_guides/modeling_data/images/modeling_data_image013.jpg "Data structure containing two versions of a solid"
+@image html /user_guides/modeling_data/images/modeling_data_image013.png "Data structure containing two versions of a solid"
+@image latex /user_guides/modeling_data/images/modeling_data_image013.png "Data structure containing two versions of a solid"
Classes inheriting TopoDS_Shape
------------------------------
#include TopoDS_Shape.hxx
- voidProcessEdge(const TopoDS_Edge&);
+ void ProcessEdge(const TopoDS_Edge&);
- voidProcess(const TopoDS_Shape& aShape) {
+ void Process(const TopoDS_Shape& aShape) {
if (aShape.Shapetype() == TopAbs_VERTEX) {
TopoDS_Vertex V;
V = TopoDS::Vertex(aShape); // Also correct
TopoDS_Vertex V3 = TopoDS::Vertex(aShape); // Correct
}
else if (aShape.ShapeType() == TopAbs_EDGE){
- ProcessEdge(aShape) ;// Thisis rejected
+ ProcessEdge(aShape) ;// This is rejected
ProcessEdge(TopoDS::Edge(aShape)) ; // Correct
}
else {
**Example **
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- void TopExp::MapShapes (const TopoDS_Shape& S,
+ void TopExp::MapShapes (const TopoDS_Shape& S,
const TopAbs_ShapeEnum T,
- TopTools_IndexedMapOfShape& M)
+ TopTools_IndexedMapOfShape& M)
{
TopExp_Explorer Ex(S,T);
while (Ex.More()) {
4. From the Map of edges, drawing each edge with the color corresponding to the number of faces.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
- void DrawShape ( const TopoDS_Shape& aShape,
+ void DrawShape ( const TopoDS_Shape& aShape,
const Standard_Integer nbIsos,
const Color FaceIsocolor,
const Color FreeEdgeColor,
**TopTools** package contains tools for exploiting the *TopoDS* data structure. It is an instantiation of the tools from *TCollection* package with the Shape classes of *TopoDS*.
-| *TopTools_Array1OfShape, HArray1OfShape* | Instantiation of the *TCollection_Array1* and *TCollection_HArray1* with *TopoDS_Shape*. |
-| *TopTools_SequenceOfShape* | Instantiation of the *TCollection_Sequence* with *TopoDS_Shape*. |
-| *TopTools_MapOfShape* | Instantiation of the *TCollection_Map*. Allows the construction of sets of shapes. |
-| *TopTools_IndexedMapOfShape* | Instantiation of the *TCollection_IndexedMap*. Allows the construction of tables of shapes and other data structures. |
+
+* *TopTools_Array1OfShape, HArray1OfShape* - Instantiation of the *TCollection_Array1* and *TCollection_HArray1* with *TopoDS_Shape*.
+* *TopTools_SequenceOfShape* - Instantiation of the *TCollection_Sequence* with *TopoDS_Shape*.
+* *TopTools_MapOfShape* - Instantiation of the *TCollection_Map*. Allows the construction of sets of shapes.
+* *TopTools_IndexedMapOfShape* - Instantiation of the *TCollection_IndexedMap*. Allows the construction of tables of shapes and other data structures.
With a *TopTools_Map*, a set of references to Shapes can be kept without duplication.
The following example counts the size of a data structure as a number of *TShapes*.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
#include TopoDS_Iterator.hxx
- Standard_Integer Size(const TopoDS_Shape& aShape)
+ Standard_Integer Size(const TopoDS_Shape& aShape)
{
// This is a recursive method.
// The size of a shape is1 + the sizes of the subshapes.
#include TopoDS_Iterator.hxx
#includeTopTools_MapOfShape.hxx
- void MapShapes(const TopoDS_Shape& aShape,
- TopTools_MapOfShape& aMap)
+ void MapShapes(const TopoDS_Shape& aShape,
+ TopTools_MapOfShape& aMap)
{
//This is a recursive auxiliary method. It stores all subShapes of aShape in a Map.
if (aMap.Add(aShape)) {
}
}
- Standard_Integer Size(const TopoDS_Shape& aShape)
+ Standard_Integer Size(const TopoDS_Shape& aShape)
{
// Store Shapes in a Mapand return the size.
TopTools_MapOfShape M;
#include TopTools_Array1OfShape.hxx
#include TopoDS_Location.hxx
- TopoDS_Shape Copy(const TopoDS_Shape& aShape,
- const TopoDS_Builder& aBuilder)
+ TopoDS_Shape Copy(const TopoDS_Shape& aShape,
+ const TopoDS_Builder& aBuilder)
{
// Copies the wholestructure of aShape using aBuilder.
// Stores all thesub-Shapes in an IndexedMap.
// Use a recursivefunction to copy the first element.
void AuxiliaryCopy (Standard_Integer,
- const TopTools_IndexedMapOfShape &,
- TopTools_Array1OfShape &,
- const TopoDS_Builder&);
+ const TopTools_IndexedMapOfShape &,
+ TopTools_Array1OfShape &,
+ const TopoDS_Builder&);
AuxiliaryCopy(1,theMap,theCopies,aBuilder);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
void AuxiliaryCopy(Standard_Integer index,
- const TopTools_IndexedMapOfShapes&sources,
- TopTools_Array1OfShape&copies,
- const TopoDS_Builder&aBuilder)
+ const TopTools_IndexedMapOfShapes& sources,
+ TopTools_Array1OfShape& copies,
+ const TopoDS_Builder& aBuilder)
{
//If the copy is a null Shape the copy is not done.
if (copies(index).IsNull()) {
For example, in the wire in the image we want to recuperate the edges in the order {e1, e2, e3,e4, e5} :
-@image html /user_guides/modeling_data/images/modeling_data_image014.jpg "A wire composed of 6 edges."
-@image latex /user_guides/modeling_data/images/modeling_data_image014.jpg "A wire composed of 6 edges.
+@image html /user_guides/modeling_data/images/modeling_data_image014.png "A wire composed of 6 edges."
+@image latex /user_guides/modeling_data/images/modeling_data_image014.png "A wire composed of 6 edges.
*TopExp_Explorer*, however, recuperates the lines in any order.
OCAF {#user_guides__ocaf}
========================
+@tableofcontents
+
@section occt_ocaf_1 Introduction
This manual explains how to use the Open CASCADE Application Framework (OCAF).
Shape Healing {#user_guides__shape_healing}
===================
-
+
+@tableofcontents
+
@section occt_shg_1 Overview
This manual explains how to use Shape Healing. It provides basic documentation on its operation. For advanced information on Shape Healing and its applications, see our offerings on our web site at <a href="http://www.opencascade.org/support/training/">www.opencascade.org/support/training/</a>
Each fixing and upgrading tool has its own status, which is reset when their methods are called. The status can contain several flags, which give the information about how the method was performed. For exploring the statuses, a set of methods named *Status...()* is provided. These methods accept enumeration *ShapeExtend_Status* and return True if the status has the corresponding flag set. The meaning of flags for each method is described below.
The status may contain a set of Boolean flags (internally represented by bits). Flags are coded by enumeration ShapeExtend_Status. This enumeration provides the following families of statuses:
-
-| *ShapeExtend_OK* | The situation is OK, no operation is necessary and has not been performed. |
-| *ShapeExtend_DONE* | The operation has been successfully performed. |
-| *ShapeExtend_FAIL* | An error has occurred during operation. |
+* *ShapeExtend_OK* - The situation is OK, no operation is necessary and has not been performed.
+* *ShapeExtend_DONE* - The operation has been successfully performed.
+* *ShapeExtend_FAIL* - An error has occurred during operation.
It is possible to test the status for the presence of some flag(s), using Status...() method(s) provided by the class:
~~~~~
8 'DONE' and 8 'FAIL' flags, named ShapeExtend_DONE1 ... ShapeExtend_FAIL8, are defined for a detailed analysis of the encountered situation. Each method assigns its own meaning to each flag, documented in the CDL for that method. There are also three enumerative values used for testing several flags at a time:
-
-| *ShapeExtend_OK* | if no flags have been set; |
-| *ShapeExtend_DONE* | if at least one ShapeExtend_DONEi has been set; |
-| *ShapeExtend_FAIL* | if at least one ShapeExtend_FAILi has been set; |
+* *ShapeExtend_OK* - if no flags have been set;
+* *ShapeExtend_DONE* - if at least one ShapeExtend_DONEi has been set;
+* *ShapeExtend_FAIL* - if at least one ShapeExtend_FAILi has been set.
@section occt_shg_2 Repair
tool.SetMaxTolerance(maxTol);
Standard_Integer NbSplitPoints = …;
tool.SetNbSplitPoints(num);
-if ( ! tool.Perform() && tool.Status (ShapeExtend_FAIL) ) {
+if ( ! tool.Perform() && tool.Status (ShapeExtend_FAIL) ) {
cout;Splitting of closed faces failed;endl;
. . .
}
An example of using this tool is presented in the figures below:
-@image html /user_guides/shape_healing/images/shape_healing003.jpg "Source Face"
-@image latex /user_guides/shape_healing/images/shape_healing003.jpg "Source Face"
+@image html /user_guides/shape_healing/images/shape_healing_image003.png "Source Face"
+@image latex /user_guides/shape_healing/images/shape_healing_image003.png "Source Face"
-@image html /user_guides/shape_healing/images/shape_healing004.jpg "Resulting shape"
-@image latex /user_guides/shape_healing/images/shape_healing004.jpg "Resulting shape"
+@image html /user_guides/shape_healing/images/shape_healing_image004.png "Resulting shape"
+@image latex /user_guides/shape_healing/images/shape_healing_image004.png "Resulting shape"
*ShapeUpgrade_ShapeDivideArea* is inherited from the base class *ShapeUpgrade_ShapeDivide* and should be used in the following way:
The method with all parameters looks as follows:
~~~~~
ShapeCustom::BsplineRestriction
- TopoDS_Shape ShapeCustom::BSplineRestriction (const TopoDS_Shape& S,
+ TopoDS_Shape ShapeCustom::BSplineRestriction (const TopoDS_Shape& S,
const Standard_Real Tol3d, const Standard_Real Tol2d,
const Standard_Integer MaxDegree,
const Standard_Integer MaxNbSegment,
const GeomAbs_Shape Continuity2d,
const Standard_Boolean Degree,
const Standard_Boolean Rational,
- const Handle(ShapeCustom_RestrictionParameters)& aParameters)
+ const Handle(ShapeCustom_RestrictionParameters)& aParameters)
~~~~~
It returns a new shape with all surfaces, curves and 2D curves of BSpline/Bezier type or based on them, converted with a degree less than *MaxDegree* or with a number of spans less then *NbMaxSegment* depending on the priority parameter *Degree*. If this parameter is equal to True then *Degree* will be increased to the value *GmaxDegree*, otherwise *NbMaxSegments* will be increased to the value *GmaxSegments*. *GmaxDegree* and *GMaxSegments* are the maximum possible degree and the number of spans correspondingly. These values will be used in cases when an approximation with specified parameters is impossible and either *GmaxDegree* or *GMaxSegments* is selected depending on the priority.
~~~~~
ShapeCustom::ConvertToBSpline()
- TopoDS_Shape ShapeCustom::ConvertToBSpline( const TopoDS_Shape& S,
+ TopoDS_Shape ShapeCustom::ConvertToBSpline( const TopoDS_Shape& S,
const Standard_Boolean extrMode,
const Standard_Boolean revolMode,
const Standard_Boolean offsetMode);
An example of using this tool is presented in the figures below:
-@image html /user_guides/shape_healing/images/shape_healing005.jpg "Source Face"
-@image latex /user_guides/shape_healing/images/shape_healing005.jpg "Source Face"
-@image html /user_guides/shape_healing/images/shape_healing006.jpg "Resulting shape"
-@image latex /user_guides/shape_healing/images/shape_healing006.jpg "Resulting shape"
+@image html /user_guides/shape_healing/images/shape_healing_image005.png "Source Face"
+@image latex /user_guides/shape_healing/images/shape_healing_image005.png "Source Face"
+@image html /user_guides/shape_healing/images/shape_healing_image006.png "Resulting shape"
+@image latex /user_guides/shape_healing/images/shape_healing_image006.png "Resulting shape"
After the processing three internal wires with contour area less than the specified minimal area have been removed. One internal face has been removed. The outer wire of this face consists of the edges belonging to the removed internal wires and a seam edge.
Two other internal faces have not been removed because their outer wires consist not only of edges belonging to the removed wires.
-@image html /user_guides/shape_healing/images/shape_healing007.jpg "Source Face"
-@image latex /user_guides/shape_healing/images/shape_healing007.jpg "Source Face"
+@image html /user_guides/shape_healing/images/shape_healing_image007.png "Source Face"
+@image latex /user_guides/shape_healing/images/shape_healing_image007.png "Source Face"
-@image html /user_guides/shape_healing/images/shape_healing008.jpg "Resulting shape"
-@image latex /user_guides/shape_healing/images/shape_healing008.jpg "Resulting shape"
+@image html /user_guides/shape_healing/images/shape_healing_image008.png "Resulting shape"
+@image latex /user_guides/shape_healing/images/shape_healing_image008.png "Resulting shape"
After the processing six internal wires with contour area less than the specified minimal area have been removed. Six internal faces have been removed. These faces can be united into groups of faces. Each group of faces has an outer wire consisting only of edges belonging to the removed internal wires. Such groups of faces are also removed.
}
if(aTool-Status(ShapeExtend_DONE1)) {
- const TopTools_SequenceOfShape& aRemovedWires =aTool-RemovedWires();
+ const TopTools_SequenceOfShape& aRemovedWires =aTool-RemovedWires();
coutaRemovedWires.Length(); internal wires were removed;;\n;;
}
if(aTool-Status(ShapeExtend_DONE2)) {
- const TopTools_SequenceOfShape& aRemovedFaces =aTool-RemovedFaces();
+ const TopTools_SequenceOfShape& aRemovedFaces =aTool-RemovedFaces();
coutaRemovedFaces.Length(); small faces were removed;;\n;;
}
*ShapExtend_Status* is used to report the status after executing some methods that can either fail, do something, or do nothing. The status is a set of flags DONEi, FAILi, any combination of them can be set at the same time. For exploring the status, enumeration is used.
The values have the following meaning:
+| Value | Meaning |
+| :----- | :----------------- |
|*OK,* | Nothing is done, everything OK |
|*DONE1,* | Something was done, case 1 |
|*DONE8*, | Something was done, case 8 |
Handle(Standard_Transient) ent ..
MessageReg-Send(ent,msg,Message_WARNING);
//gets messages attached to shape
-const ShapeExtend_DataMapOfShapeListOfMsg& msgmap =
+const ShapeExtend_DataMapOfShapeListOfMsg& msgmap =
MessageReg-MapShape();
if (msgmap.IsBound (Shape1)) {
- const Message_ListOfMsg &msglist = msgmap.Find (Shape1);
+ const Message_ListOfMsg &msglist = msgmap.Find (Shape1);
for (Message_ListIteratorOfListOfMsg iter (msglist);
iter.More(); iter.Next()) {
Message_Msg msg = iter.Value();
~~~~~
The result of *DumpTimer()* after translation of a file is as follows:
-
-| TIMER: *IGES_LoadFile* | Elapsed: 1.0 sec CPU User: 0.9 sec CPU Sys: 0.0 sec hits: 1 |
-| TIMER: IGESToBRep_Transfer | Elapsed: 14.5 sec CPU User: 4.4 sec CPU Sys: 0.1 sec hits: 1311 |
+* TIMER: *IGES_LoadFile* Elapsed: 1.0 sec CPU User: 0.9 sec CPU Sys: 0.0 sec hits: 1
+* TIMER: *IGESToBRep_Transfer* Elapsed: 14.5 sec CPU User: 4.4 sec CPU Sys: 0.1 sec hits: 1311
@section occt_shg_6 Shape Processing
4. Create this function in *ShapeProcess_OperLibrary* as follows:
~~~~~
static Standard_Boolean myfunction (const
- Handle(ShapeProcess_Context)& context)
+ Handle(ShapeProcess_Context)& context)
{
Handle(ShapeProcess_ShapeContext) ctx =
Handle(ShapeProcess_ShapeContext)::DownCast(context);
### SplitClosedEdges
This operator handles closed edges i.e. edges with one vertex. Such edges are not supported in some receiving systems. This operator splits topologically closed edges (i.e. edges having one vertex) into two edges. Degenerated edges and edges with a size of less than Tolerance are not processed.
-@section occt_shg_7_ Messaging mechanism
+@section occt_shg_7 Messaging mechanism
Various messages about modification, warnings and fails can be generated in the process of shape fixing or upgrade. The messaging mechanism allows generating messages, which will be sent to the chosen target medium a file or the screen. The messages may report failures and/or warnings or provide information on events such as analysis, fixing or upgrade of shapes.
//fills out the code areas
~~~~~
-
@subsection occt_shg_7_4 Tool for managing trace files
Class *Message_TraceFile* is intended to manage the trace file (or stream) for outputting messages and the current trace level. Trace level is an integer number, which is used when messages are sent. Generally, 0 means minimum, 0 various levels. If the current trace level is lower than the level of the message it is not output to the trace file. The trace level is to be managed and used by the users.
STEP processor {#user_guides__step}
========================
+@tableofcontents
+
@section occt_step_1 Overview
This manual is intended to provide technical documentation on the Open CASCADE Technology (**OCCT**) STEP processor and to help Open CASCADE Technology users with the use of the STEP processor (to read and write STEP files). STEP files conforming to AP 214, AP 203 and partially AP 209 can be read. STEP files that are produced by this interface conform to STEP AP 214 or AP 203, according to the user option.
* *step214-placed-items* - selects all mapped_items or context_depended_shape_representations.
* *step214-shape-def-repr* - selects all shape_definition_representations.
* *step214-shape-repr* - selects all shape_representations.
- * *step214-type(<entity_type>)* - selects all entities of a given type
+ * *step214-type(\<entity_type\>)* - selects all entities of a given type
* *step214-faces* - selects all faces_surface, advanced_face entities and the surface entity or any sub type if these entities are not shared by any face entity or shared by geometric_set entity.
- * *step214-derived(<entity_type>)* - selects entities of a given type or any subtype.
+ * *step214-derived(\<entity_type\>)* - selects entities of a given type or any subtype.
* *step214-GS-curves* - selects all curve entities or any subtype except the composite_curve if these entities are shared by the geometric_set entity.
* *step214-assembly* - selects all mapped_items or context_depended_shape_representations involved into the assembly structure.
* *xst-model-all* - selects all entities.
* *xst-model-roots* - selects all roots.
- * *xst-shared + <selection>* - selects all entities shared by at least one entity selected by selection.
- * *xst-sharing + <selection>* - selects all entities sharing at least one entity selected by selection.
+ * *xst-shared + \<selection\>* - selects all entities shared by at least one entity selected by selection.
+ * *xst-sharing + \<selection\>* - selects all entities sharing at least one entity selected by selection.
* *xst-transferrable-all* - selects all transferable entities.
* *xst-transferrable-roots* selects all translatable roots.
Cumulative lists can be used as well.
The following diagram illustrates the structure of calls in reading STEP. The highlighted classes are intended to translate geometry
-@image html /user_guides/step/images/step_image003.jpg "The structure of calls in reading STEP"
-@image latex /user_guides/step/images/step_image003.jpg "The structure of calls in reading STEP"
+@image html /user_guides/step/images/step_image003.png "The structure of calls in reading STEP"
+@image latex /user_guides/step/images/step_image003.png "The structure of calls in reading STEP"
@subsection occt_step_2_7 Example
~~~~~
The highlighted classes are intended to translate geometry.
-@image html /user_guides/step/images/step_image004.jpg "The structure of calls in writing STEP"
-@image latex /user_guides/step/images/step_image004.jpg "The structure of calls in writing STEP"
+@image html /user_guides/step/images/step_image004.png "The structure of calls in writing STEP"
+@image latex /user_guides/step/images/step_image004.png "The structure of calls in writing STEP"
@subsection occt_step_3_7 Example
To get information on the result of translation of a given STEP entity use the command *Draw:> tpent \#*.
To create an OCCT shape, corresponding to a STEP entity, use the command *Draw:> tpdraw \#*.
-To get the number of a STEP entity, corresponding to an OCCT shape, use the command *Draw:> fromshape <shape_name>*.
+To get the number of a STEP entity, corresponding to an OCCT shape, use the command *Draw:> fromshape \<shape_name\>*.
To clear the map of correspondences between STEP entities and OCCT shapes use the command *Draw:> tpclear*.
@subsubsection occt_step_6_4_1 Checking file contents
General statistics on the loaded data can be obtained by using the command
-Draw:> data <symbol>
+Draw:> data \<symbol\>
Information printed by this command depends on the symbol specified:
* *g* - Prints the information contained in the header of the file;
Two commands are used to calculate statistics on the entities in the model:
~~~~~
-Draw:> count <counter> [<selection>]
-Draw:> listcount <counter> [<selection>]
+Draw:> count <counter> [\<selection\>]
+Draw:> listcount <counter> [\<selection\>]
~~~~~
The former only prints a count of entities while the latter also gives a list of them.
@subsubsection occt_step_6_4_2 Estimating the results of reading STEP
All the following commands are available only after data is converted into OCCT shapes (i.e. after command 214read).
-Command *Draw:> tpstat [*|?]<symbol> [<selection>]* is provided to get all statistics on the last transfer, including a list of transferred entities with mapping from STEP to OCCT types, as well as fail and warning messages. The parameter symbol defines what information will be printed:
+Command *Draw:> tpstat [*|?]\<symbol\> [\<selection\>]* is provided to get all statistics on the last transfer, including a list of transferred entities with mapping from STEP to OCCT types, as well as fail and warning messages. The parameter symbol defines what information will be printed:
* *g* - General statistics (a list of results and messages)
* *c* - Count of all warning and fail messages
The sign ? before *n, s, b, t* limits the scope of information to invalid entities.
-Optional argument <selection> can limit the action of the command to the selection, not to all entities.
+Optional argument \<selection\> can limit the action of the command to the selection, not to all entities.
To get help, run this command without arguments.
The command *Draw:> tpstat \*1* gives statistics on the result of translation of different types of entities (taking check messages into account) and calculates summary translation ratios.
-To get information on OCCT shape contents use command *Draw:> statshape <shape_name>* . It outputs the number of each kind of shapes (vertex, edge, wire, etc.) in the shape and some geometrical data (number of C0 surfaces, curves, indirect surfaces, etc.).
+To get information on OCCT shape contents use command *Draw:> statshape \<shape_name\>* . It outputs the number of each kind of shapes (vertex, edge, wire, etc.) in the shape and some geometrical data (number of C0 surfaces, curves, indirect surfaces, etc.).
The number of faces is returned as a number of references. To obtain the number of single instances, the standard command (from TTOPOLOGY executable) nbshapes can be used.
-To analyze the internal validity of the shape, use command *Draw:> checkbrep <shape_name> <expurged_shape_name>*. It checks shape geometry and topology for different cases of inconsistency, like self-intersecting wires or wrong orientation of trimming contours. If an error is found, it copies bad parts of the shape with the names <i>expurged_subshape_name _\#</i> and generates an appropriate message. If possible this command also tries to find STEP entities the OCCT shape was produced from.
+To analyze the internal validity of the shape, use command *Draw:> checkbrep \<shape_name\> \<expurged_shape_name\>*. It checks shape geometry and topology for different cases of inconsistency, like self-intersecting wires or wrong orientation of trimming contours. If an error is found, it copies bad parts of the shape with the names <i>expurged_subshape_name _\#</i> and generates an appropriate message. If possible this command also tries to find STEP entities the OCCT shape was produced from.
-<i><expurged_shape_name></i> will contain the original shape without invalid subshapes.
-To get information on tolerances of the shape use command <i>Draw:> tolerance <shape_name> [<min> [<max>] [<symbol>]] </i>. It outputs maximum, average and minimum values of tolerances for each kind of subshapes having tolerances and for the whole shape in general.
+<i>\<expurged_shape_name\></i> will contain the original shape without invalid subshapes.
+To get information on tolerances of the shape use command <i>Draw:> tolerance \<shape_name\> [\<min\> [\<max\>] [<symbol>]] </i>. It outputs maximum, average and minimum values of tolerances for each kind of subshapes having tolerances and for the whole shape in general.
When specifying min and max arguments this command saves shapes with tolerances in the range [min, max] with names shape_name_... and gives their total number.
Several shapes can be written in one file. To start writing a new file, enter command *Draw:> newmodel*.
Actually, command *newmodel* will clear the *InterfaceModel* to empty it, and the next command will convert the specified shape to STEP entities and add them to the *InterfaceModel*:
~~~~~
-Draw:> stepwrite <mode> <shape_name> [<file_name>]
+Draw:> stepwrite <mode> \<shape_name\> [<file_name>]
~~~~~
The available modes are following:
* *a* - as is;
TObj Package {#user_guides__tobj}
==================
-
+
+@tableofcontents
+
@section occt_tobj_1 Introduction
This document describes the package TObj, which is an add-on
Generally the structure of the OCAF tree of the *TObj* data
model corresponds to the logical structure of the model and can be presented as in the following picture:
-@image html /user_guides/tobj/images/tobj_image004.jpgb "TObj Data Model mapped on OCAF document"
-@image latex /user_guides/tobj/images/tobj_image004.jpg "TObj Data Model mapped on OCAF document"
+@image html /user_guides/tobj/images/tobj_image004.png "TObj Data Model mapped on OCAF document"
+@image latex /user_guides/tobj/images/tobj_image004.png "TObj Data Model mapped on OCAF document"
All data of the model are stored in the root label (0:1) of the OCAF document.
An attribute *TObj_TModel* is located in this root label. It
User Guides {#user_guides}
===========
-## Foundation Classes
-**short description**
-
-\subpage user_guides__foundation_classes
-
-## Modeling Data
-**short description**
-
-\subpage user_guides__modeling_data
-
-## Modeling Algorithms
-**short description**
-
-\subpage user_guides__modeling_algos
-
-## Visualization
-**short description**
-
-\subpage user_guides__visualization
-
-## IGES Support
-**short description**
-
-\subpage user_guides__iges
-
-## STEP processor
-**short description**
-
-\subpage user_guides__step
-
-## Extended Data Exchange (XDE)
-**short description**
-
-\subpage user_guides__xde
-
-## OCAF
-**short description**
-
-\subpage user_guides__ocaf
-
-## TObj Package
-**short description**
-
-\subpage user_guides__tobj
-
-## Shape Healing
-**short description**
-
-\subpage user_guides__shape_healing
-
-## Draw Test Harness
-**short description**
-
-\subpage user_guides__test_harness
\ No newline at end of file
+OCCT User Guides are organized by OCCT modules:
+
+* @subpage user_guides__foundation_classes "Foundation Classes"
+* @subpage user_guides__modeling_data "Modeling Data"
+ * BRep File Format
+* @subpage user_guides__modeling_algos "Modeling Algorithms"
+ * @subpage user_guides__shape_healing "Shape Healing"
+* @subpage user_guides__visualization "Visualization"
+ * Voxel package
+* Data Exchange
+ * @subpage user_guides__iges "IGES translator"
+ * @subpage user_guides__step "STEP translator"
+ * @subpage user_guides__xde "Extended Data Exchange (XDE)"
+* @subpage user_guides__ocaf "Open CASCADE Application Framework (OCAF)"
+ * OCAF Whitepaper
+ * OCAF Function Mechanism
+ * OCAF Tree
+ * @subpage user_guides__tobj "TObj package"
+* @subpage user_guides__test_harness "DRAW Test Harness"
\ No newline at end of file
Visualization {#user_guides__visualization}
===================
+
+@tableofcontents
@section occt_1621831385_591811643 Introduction
Figure 1 below presents a schematic overview of the relations between the key concepts and packages in visualization. AIS stands for both AIS and AIS2D packages. Naturally, *Geometry & Topology* is just an example of application data that can be handled by AIS, and application-specific interactive objects can deal with any kind of data.
-@image html /user_guides/visualization/images/visualization_image003.jpg
-@image latex /user_guides/visualization/images/visualization_image003.jpg
+@image html /user_guides/visualization/images/visualization_image003.png
+@image latex /user_guides/visualization/images/visualization_image003.png
**Figure 1. Key concepts and packages in visualization**
To answer different needs of CASCADE users, this user’s guide offers the following three paths in reading it.
Objects that may be selected graphically, are displayed as sets of sensitive primitives, which provide sensitive zones in 2D graphic space. These zones are sorted according to their position on the screen when starting the selection process.
The position of the mouse is also associated with a sensitive zone. When moving within the window where objects are displayed, the areas touched by the zone of the mouse are analyzed. The owners of these areas are then highlighted or signaled by other means such as the name of the object highlighted in a list. That way, you are informed of the identity of the element detected.
-@image html /user_guides/visualization/images/visualization_image006.jpg
-@image latex /user_guides/visualization/images/visualization_image006.jpg
+@image html /user_guides/visualization/images/visualization_image006.png
+@image latex /user_guides/visualization/images/visualization_image006.png
**Figure 3. A model **
-@image html /user_guides/visualization/images/visualization_image007.jpg
-@image latex /user_guides/visualization/images/visualization_image007.jpg
+@image html /user_guides/visualization/images/visualization_image007.png
+@image latex /user_guides/visualization/images/visualization_image007.png
**Figure 4. Modeling faces with sensitive primitives **
-@image html /user_guides/visualization/images/visualization_image008.jpg
-@image latex /user_guides/visualization/images/visualization_image008.jpg
+@image html /user_guides/visualization/images/visualization_image008.png
+@image latex /user_guides/visualization/images/visualization_image008.png
**Figure 5. In a dynamic selection, each sensitive polygon is represented by its bounding rectangle**
-@image html /user_guides/visualization/images/visualization_image009.jpg
-@image latex /user_guides/visualization/images/visualization_image009.jpg
+@image html /user_guides/visualization/images/visualization_image009.png
+@image latex /user_guides/visualization/images/visualization_image009.png
Figure 6. Reference to the sensitive primitive, then to the owner
@subsubsection occt_1621831385_163370828222 The Sensitive Primitive
The sensitive line segment below proposes a bounding box to the selector. During selection, positions 1 and 2 of the mouse detect the box but after sorting, only position 2 retains the line segment as selected by the algorithm.
-@image html /user_guides/visualization/images/visualization_image010.jpg
-@image latex /user_guides/visualization/images/visualization_image010.jpg
+@image html /user_guides/visualization/images/visualization_image010.png
+@image latex /user_guides/visualization/images/visualization_image010.png
**Figure 7. Example of sensitive primitives **
When the 2D box associated with the position of the mouse intersects the 2D box of a sensitive primitive, the owner of the sensitive primitive is called and its presentation is highlighted.
You have to write the method, which calculates the four selections above, i.e. the sensitive primitives which are activated when the mode is.
You must define the class *Owner* specific to your application. This class will contain the reference to the house element it represents: wall, door or room. It inherits from *EntityOwner* from *SelectMgr*.
For example, let’s consider a house with the following representation:
-@image html /user_guides/visualization/images/visualization_image011.jpg
-@image latex /user_guides/visualization/images/visualization_image011.jpg
+@image html /user_guides/visualization/images/visualization_image011.png
+@image latex /user_guides/visualization/images/visualization_image011.png
**Figure 8. Selection of the rooms of a house**
To build the selection, which corresponds to the mode *selection of the rooms* (selection 2 in the list of selection modes) use the following procedure:
) // ComputeSelection
-@image html /user_guides/visualization/images/visualization_image012.jpg
-@image latex /user_guides/visualization/images/visualization_image012.jpg
+@image html /user_guides/visualization/images/visualization_image012.png
+@image latex /user_guides/visualization/images/visualization_image012.png
**Figure 9. Activated sensitive boxes corresponding to selection mode 0 (selection of the rooms)**
-@image html /user_guides/visualization/images/visualization_image013.jpg
-@image latex /user_guides/visualization/images/visualization_image013.jpg
+@image html /user_guides/visualization/images/visualization_image013.png
+@image latex /user_guides/visualization/images/visualization_image013.png
-@image html /user_guides/visualization/images/visualization_image014.jpg
-@image latex /user_guides/visualization/images/visualization_image014.jpg
+@image html /user_guides/visualization/images/visualization_image014.png
+@image latex /user_guides/visualization/images/visualization_image014.png
**Figure 11. Activated sensitive polygons corresponding to selection mode 1.**
**(selection of the doors)**
-@image html /user_guides/visualization/images/visualization_image015.jpg
-@image latex /user_guides/visualization/images/visualization_image015.jpg
+@image html /user_guides/visualization/images/visualization_image015.png
+@image latex /user_guides/visualization/images/visualization_image015.png
**Figure 12. Sensitive rectangles in the selector during dynamic selection in view 2**
@section occt_1621831385_810308609 AIS: Application Interactive Services
@subsubsection occt_1621831385_81030860913 Graphic Attributes Manager or *Drawer*
-@image html /user_guides/visualization/images/visualization_image016.jpg
-@image latex /user_guides/visualization/images/visualization_image016.jpg
+@image html /user_guides/visualization/images/visualization_image016.png
+@image latex /user_guides/visualization/images/visualization_image016.png
An Interactive Object can have a certain number of graphic attributes specific to it (such as visualization mode, color and material) By the same token, the Interactive Context has a drawer which is valid by default for the objects it controls. When an interactive object is visualized, the required graphic attributes are first taken from its own Drawer if it has the ones required, or from the context drawer if it does not have them.
@subsubsection occt_1621831385_81030860914 Selection Filters
-@image html /user_guides/visualization/images/visualization_image017.jpg
-@image latex /user_guides/visualization/images/visualization_image017.jpg
+@image html /user_guides/visualization/images/visualization_image017.png
+@image latex /user_guides/visualization/images/visualization_image017.png
An important need in selection is the filtering of entities, which you want to select. Consequently there are FILTER entities, which allow you to refine the dynamic detection context, which you want to put into effect. Some of these filters can be used at the Neutral Point, others only in an open local context. A user will be able to program his own filters and load them into the interactive context.
@subsubsection occt_1621831385_81030860921 Presentations:
-@image html /user_guides/visualization/images/visualization_image018.jpg
-@image latex /user_guides/visualization/images/visualization_image018.jpg
+@image html /user_guides/visualization/images/visualization_image018.png
+@image latex /user_guides/visualization/images/visualization_image018.png
*Conventions *
* Either in 2D or in 3D, an interactive object can have as many presentations as its creator wants to give it.
* 3D presentations are managed by PresentationManager3D; 2D presentations by PresentationManager2D. As this is transparent in AIS, the user does not have to worry about it.
* In the *AIS_InteractiveObject* abstract class, several standard attributes have been privileged. These include: color, thickness of line, material, and transparency. Consequently, a certain number of virtual functions, which allow us to act on these attributes, have been proposed. Each new class of interactive object can redefine these functions in order to bring about the changes it should produce in the behavior of the class.
-@image html /user_guides/visualization/images/visualization_image019.jpg
-@image latex /user_guides/visualization/images/visualization_image019.jpg
+@image html /user_guides/visualization/images/visualization_image019.png
+@image latex /user_guides/visualization/images/visualization_image019.png
**Figure 13. Redefinition of virtual functions for changes in AIS_Point **
-@image html /user_guides/visualization/images/visualization_image020.jpg
-@image latex /user_guides/visualization/images/visualization_image020.jpg
+@image html /user_guides/visualization/images/visualization_image020.png
+@image latex /user_guides/visualization/images/visualization_image020.png
**Figure 14. **Redefinition** of virtual functions for changes in AIS_Shape.**
The virtual functions concerned here allow you to provide settings for:
For the presentation of planes and trihedra, the default unit of length is millimeter, and the default value for the representation of axes is 100. If you modify these dimensions, you must temporarily recover the object DRAWER. From inside it, take the Aspects in which the values for length are stocked (PlaneAspect for the plane, FirstAxisAspect for trihedra), and change these values inside these Aspects. Finally, recalculate the presentation.
@subsubsection occt_1621831385_8103086092222 OBJECTS
+
AIS_Shape : 3 visualization modes :
+
* mode 0 : Line (default mode)
* mode 1 : Shading (depending on the type of shape)
* mode 2 : Bounding Box
-7 maximum selection modes, depending on the complexity of the shape :
- * * mode 0 : selection of the AIS_Shape
- * * mode 1 : selection of the vertices
- * * mode 2 : selection of the edges
- * * mode 3 : selection of the wires
- * * mode 4 : selection of the faces
- * * mode 5 : selection of the shells
- * * mode 6 : selection of the constituent solids.
+Seven maximum selection modes, depending on the complexity of the shape:
+ * mode 0 : selection of the AIS_Shape
+ * mode 1 : selection of the vertices
+ * mode 2 : selection of the edges
+ * mode 3 : selection of the wires
+ * mode 4 : selection of the faces
+ * mode 5 : selection of the shells
+ * mode 6 : selection of the constituent solids.
AIS_Triangulation: Simple interactive object for displaying triangular mesh contained in Poly_Triangulation container.
A set of standard sensitive primitives exists in Select3D packages for 3D primitives, and Select2D for 2D primitives.
The owner is the entity, which makes it possible to link the sensitive primitives and the objects that you really wanted to detect. It stocks the diverse information, which makes it possible to find objects. An owner has a priority (*5* by default), which you can modulate, so as to make one entity more selectable than another.
-@image html /user_guides/visualization/images/visualization_image021.jpg
-@image latex /user_guides/visualization/images/visualization_image021.jpg
+@image html /user_guides/visualization/images/visualization_image021.png
+@image latex /user_guides/visualization/images/visualization_image021.png
@subsubsection occt_1621831385_81030860912341 Implementation in an interactive/selectable object
SM-Deactivate(box1);
// deactivate all active modes of box1
-@image html /user_guides/visualization/images/visualization_image022.jpg
-@image latex /user_guides/visualization/images/visualization_image022.jpg
+@image html /user_guides/visualization/images/visualization_image022.png
+@image latex /user_guides/visualization/images/visualization_image022.png
1st activation of the box’s mode 1: calculation of sensitive primitives + 3D/2D projection + sorting
deactivation of mode: only updated by sorting
const Aspect_FormatOfSheetPaper theFormat,
const Image_TypeOfImage theBufferType)
These methods dump the 3D scene into an image file passed by its name and path as theFile.
-The raster image data handling algorithm is based on the Image_PixMap class. The supported extensions are *.png*, *.bmp*, *.jpg*, *.png*.
+The raster image data handling algorithm is based on the Image_PixMap class. The supported extensions are *.png*, *.bmp*, *.png*, *.png*.
The first method dumps the scene into an image file with the view dimensions. The second method allows you to make the dimensions of the output image compatible to a certain format of printing paper passed by theFormat argument.
The value passed as theBufferType argument defines the type of the buffer for an output image (RGB, RGBA, floating-point, RGBF, RGBAF). Both methods return Standard_True if the scene has been successfully dumped.
**Please note** that dumping the image for a paper format with large dimensions is a memory consuming operation, it might be necessary to take care of preparing enough free memory to perform this operation.
new Graphic3d_WNTGraphicDevice ();
**// create a window**
+
+~~~~~{c++}
Standard_Integer aDefWidth = 800;
Standard_Integer aDefHeight = 600;
Handle (WNT_WClass) aWClass =
new WNT_Window (aDevice, *VirtualWnd*, aWClass,
WS_OVERLAPPEDWINDOW, 0, 0,
aDefWidth, aDefHeight);
+~~~~~
**// set up the window as virtual**
aWindow-SetVirtual (Standard_True);
const Standard_Real Precision,
const Standard_Address ProgressBarFunc,
const Standard_Address ProgressObject)
+
The FileName defines the output image file name and the Format argument defines the output file format:
* Graphic3d_EF_PostScript (PS),
* Graphic3d_EF_EhnPostScript (EPS),
* Rendering large scenes could be slow and can lead to large output files;
* Transparency is only supported for PDF and SVG output;
* Textures and some effects are not supported by the GL2PS library.
+
@section occt_1621831385_1090976821 2D Presentations
@subsection occt_1621831385_10909768211 Glossary of 2D terms
The marker map defines a set of markers available to the application. Markers may be predefined, Aspect_Tom_X for example, or user-defined.
-@image html /user_guides/visualization/images/visualization_image025.jpg
-@image latex /user_guides/visualization/images/visualization_image025.jpg
+@image html /user_guides/visualization/images/visualization_image025.png
+@image latex /user_guides/visualization/images/visualization_image025.png
Figure 15. Markers.
The markers are manipulated by an index.
Maps are created for color, line type, line width, and text font. A map is used to reference a given attribute by an integer value.
-@image html /user_guides/visualization/images/visualization_image026.jpg
-@image latex /user_guides/visualization/images/visualization_image026.jpg
+@image html /user_guides/visualization/images/visualization_image026.png
+@image latex /user_guides/visualization/images/visualization_image026.png
Figure 16. Attributes
The color map
rectangle-SetTypeOfPolygonFilling(Graphic2d_TOPF_FILLED); rectangle-SetDrawEdge(Standard_True);
*A given primitive can only be assigned to a single graphic object.*
-@image html /user_guides/visualization/images/visualization_image027.jpg
-@image latex/user_guides/visualization/images/visualization_image027.jpg
+@image html /user_guides/visualization/images/visualization_image027.png
+@image latex /user_guides/visualization/images/visualization_image027.png
Figure 17. Graphic object and view mapping in the space model.
@subsection occt_1621831385_10909768213 Dealing with images
(aGrObj, 0.03, -0.03, 0.01, 0.0, 0.01);
window-Clear ();
-@image html /user_guides/visualization/images/visualization_image028.jpg
-@image latex /user_guides/visualization/images/visualization_image028.jpg
+@image html /user_guides/visualization/images/visualization_image028.png
+@image latex /user_guides/visualization/images/visualization_image028.png
Figure 18. Figure of zoom and attachment point of a marker.
The **Aspect** package provides classes to implement:
* Color maps,
* Pixels,
- * Groups of graphic attributes,
- * Edges, lines, background,
- * Font classes,
- * Width map classes,
- * Marker map classes,
- * Type of Line map classes,
- * Window,
- * Driver, PlotterDriver (inherited by PS_Driver), WindowDriver,
- * Graphic device (inherited by Xw_GraphicDevice, Graphic3d_GraphicDevice),
- * Enumerations for many of the above,
- * Array instantiations for edges,
- * Array instantiations for map entries for color, type, font, width, and marker.
-
-
+ * Groups of graphic attributes,
+ * Edges, lines, background,
+ * Font classes,
+ * Width map classes,
+ * Marker map classes,
+ * Type of Line map classes,
+ * Window,
+ * Driver, PlotterDriver (inherited by PS_Driver), WindowDriver,
+ * Graphic device (inherited by Xw_GraphicDevice, Graphic3d_GraphicDevice),
+ * Enumerations for many of the above,
+ * Array instantiations for edges,
+ * Array instantiations for map entries for color, type, font, width, and marker.
Extended Data Exchange (XDE) {#user_guides__xde}
============================
-
+
+@tableofcontents
+
@section occt_xde_1_ Introduction
@subsection occt_xde_1_1 Overview of the Extended Data Exchange (XDE)
This manual explains how to use the Extended Data Exchange (XDE). It provides basic documentation on setting up and using XDE. For advanced information on XDE and its applications, see our offerings at <a href="http://www.opencascade.com/services/support/">on our web site</a>.
XDE supports assemblies by separating shape definitions and their locations. Shapes are simple OCAF objects without a location definition. An assembly consists of several components. Each of these components references one and the same specified shape with different locations. All this provides an increased flexibility in working on multi-level assemblies.
For example, a mechanical assembly can be defined as follows:
-@image html /user_guides/xde/images/xde_image003.jpg "Assembly Description"
-@image latex /user_guides/xde/images/xde_image003.jpg "Assembly Description"
+@image html /user_guides/xde/images/xde_image003.png "Assembly Description"
+@image latex /user_guides/xde/images/xde_image003.png "Assembly Description"
-@image html /user_guides/xde/images/xde_image004.jpg "Assembly View"
-@image latex /user_guides/xde/images/xde_image004.jpg "Assembly View"
+@image html /user_guides/xde/images/xde_image004.png "Assembly View"
+@image latex /user_guides/xde/images/xde_image004.png "Assembly View"
XDE defines the specific organization of the assembly content. Shapes are stored on sub-labels of label 0:1:1. There can be one or more roots (called free shapes) whether they are true trees or simple shapes. A shape can be considered to be an Assembly (such as AS1 under 0:1:1:1 in Figure1) if it is defined with Components (sub-shapes, located or not).
Advanced Data Exchange supports both reading and writing of validation properties, and provides a tool to check them.
- @image html /user_guides/xde/images/xde_image005.jpg "Validation Property Descriptions"
- @image latex /user_guides/xde/images/xde_image005.jpg "Validation Property Descriptions"
+ @image html /user_guides/xde/images/xde_image005.png "Validation Property Descriptions"
+ @image latex /user_guides/xde/images/xde_image005.png "Validation Property Descriptions"
* surface color *(XCAFDoc_ColorSurf)*
* curve color *(XCAFDoc_ColorCurv)*
- @image html /user_guides/xde/images/xde_image006.jpg "Colors and Layers"
- @image latex /user_guides/xde/images/xde_image006.jpg "Colors and Layers"
+ @image html /user_guides/xde/images/xde_image006.png "Colors and Layers"
+ @image latex /user_guides/xde/images/xde_image006.png "Colors and Layers"
rem Running it requires that Tcl, Doxygen, and MikTex (for PDF generation)
rem should be in the PATH
+SET "OLD_PATH=%PATH%"
+
if exist "%~dp0env.bat" (
call "%~dp0env.bat"
)
-if not ["%1"] == ["-h"] (
- tclsh.exe %~dp0dox/start.tcl %*
-) else (
- echo.
- echo gen.bat options:
- echo -html : To generate HTML files ^(cannot be used with -pdf^)
- echo -pdf : To generate PDF files ^(cannot be used with -html^)
- echo -m^=^<modules_list^> : Specifies list of articles to generate. If it is not specified, all files, mentioned in FILES.txt are processed
- echo "-l=<document_name> : Specifies the article caption for a single document"
- echo -h : Prints help message
- echo -v : Specifies the Verbose mode ^(info on all script actions is shown^)
- echo.
-)
+tclsh.exe %~dp0dox/start.tcl %*
+SET "PATH=%OLD_PATH%"
--- /dev/null
+#!/bin/bash
+
+# Helper script to run generation of OCCT documentation on Linux.
+# Running it requires that Tcl, Doxygen, and MikTex (for PDF generation) should be in the PATH
+
+anArgs=$*
+anOldPath="$PATH"
+anOldLd="$LD_LIBRARY_PATH"
+anOldDyLd="$DYLD_LIBRARY_PATH"
+
+# go to the script directory
+aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
+if [ -e "${aScriptPath}/env.sh" ]; then source "${aScriptPath}/env.sh"; fi
+
+tclsh "${aScriptPath}/dox/start.tcl" $anArgs
+
+export PATH="$anOldPath"
+export LD_LIBRARY_PATH="$anOldLd"
+export DYLD_LIBRARY_PATH="$anOldDyLd"