Opencascade 帮助手册学习1 Overview

Documentation

This overview provides general description of OCCT structure, functionality, modules, and features. It includes User and Developer Guides.
User and Developer Guides describing in details OCCT modules and development tools
Full reference documentation covering all OCCT classes. Reference documentation is presented in Modules –> Toolkits –> Packages –> Classes logic structure

Third-party libs

Graphic library: OpenGL3.3+, OpenGL ES 2.0+
Qt : for samples and demos
TCL: for testing tools
Freetype : for text rendering
FreeImage : optional, for support of common 2D graphic formats
FFmpeg : optional, for video recording
gl2ps: optional, for export contents of OCCT viewer to vector formats [an OpenGL to PostScript printing library.]
Inter TBB : optional, for multithreaded algorithms
VTK : for VTK integration sevices
Doxygen : optional for building documention

Contens of OCCT-7.3.0 dir (OCCT root)

  1. adm This folder contains administration files, which allow rebuilding OCCT
  2. adm/cmake This folder contains files of CMake building procedure;
  3. adm/msvc This folder contains Visual Studio projects for Visual C++ 2010, 2012, 2013, 2015 and 2017 which allow rebuilding OCCT under Windows platform in 32 and 64-bit mode;
  4. data This folder contains CAD files in different formats, which can be used to test the OCCT functionality.
  5. doc This folder contains OCCT documentation in HTML and PDF format
  6. dox This folder contains sources of OCCT documentation in plain text (MarkDown) format
  7. inc This folder contains copies of all OCCT header files;
  8. samples This folder contains sample applications.
  9. src This folder contains OCCT source files. They are organized in folders, one per development unit;
  10. tests This folder contains scripts for OCCT testing.
  11. tools This folder contains sources of Inspector tool.
  12. win64/vc10 This folder contains executable and library files built in optimize mode for Windows platform by Visual C++ 2010;

Environment Variables (Windows)

  1. env.bat : edit this script with versio of VS (vs10-vs141) and architecture(win32 or win64)
  2. custom.bat : this is necessary for compiling OCCT libs and samples. edit it to correct the paths to third-party libs
  3. msvc.bat : can be used with the same args for immediate launch of VS for (re)compiling OCCT.

NOTE: 若是想要在自己的系统上重新编译OCCT,打开VS的开发人员命令提示符工具,将msvc.bat拖入回车即可。

Getting Started

Draw Test Harness

Draw contains :

  • A command interpreter based on TCL command language.
  • A 2D an 3D graphic viewer with support of operations such as zoom, pan, rotation and full-screen views.
  • An optional set of geometric commands to create and modify curves and surfaces and to use OCCT geometry algorithms.
  • A set of topological commands to create and modify BRep shapes and to use OCCT topology algorithms.
  • A set of graphic commands for view and display operations including Mesh Visualization Service.
  • A set of Application framework commands for handling of
    files and attributes.
  • A set of Data Exchange commands for translation of files from various formats (IGES,STEP) into OCCT shapes.
  • A set of Shape Healing commands: check of overlapping edges, approximation of a shape to BSpline, etc.

You can add new custom test harness commands to Draw in order to test or demonstrate a new functionality, which you are developing.

Experimenting with Draw.bat

pload ALL 
axo			// to creat an axonometric view
box b -10 -10 20 20 20 		// to create a cube b of size 20,parallel to the X Y Z axis and centered on the origin, will be displayed in wireframe mode.
fit 			// to fill the viewer with the cube  
pcylinder c 2 30 			// to create a cylinder c of radius 2 and height 30.
clear 		// erase the view
donly c		// display the cylinder only
donly b	// display the cube only
hlr hlr b 	// display the cube in the hidden line removal mode
source <demo_file.tcl>		// to upload demonstration file provided with OCC

demo_files.tcl:

  • DataExchangeDemo.tcl: demonstrates sample sequence of operations with writing and reading IGES file
  • ModelingDemo.tcl: demonstrates creation of simple shape and displaying it in HLR mode
  • VisualizationDemo.tcl: demonstrates use of 3d viewer
  • cad.tcl: creates solid shape looking like abbreviation “CAD”
  • bottle.tcl: creates bottle as in OCCT Tutorial
  • drill.tcl: creates twist drill bit shape
  • cutter.tcl: creates milling cutter shape
  • xde.tcl: demonstrates creation of simple assembly in XDE
  • materials.tcl: demonstrates visual properties of materials supported by 3d viewer
  • raytrace.tcl: demonstrates use of ray tracing display in 3d viewer
  • dimensions.tcl: demonstrates use of dimensions, clipping, and capping in 3d viewer
help 		// see all available commands
help <command_name> 	// to find out the argus for a given command

Programming Samples

MFC

10 VC++ projects to illustrate how to use a particular module ro functionality

  • Geometry
  • Modeling
  • Viewer2d
  • Viewer3d
  • ImportExport
  • Ocaf
  • Triangulation
  • HLR
  • Animation
  • Convert

Note : read carefully readme.txt to learn about launching and compilation options.

Qt

OCCT contains three samples based on Qt application framework:

  • IEsample
    Import Export programming sample contains 3D Viewer and Import / Export functionality.
  • Tutorial
    The Qt programming tutorial teaches how to use Open CASCADE Technology services to model a 3D object.

猜你喜欢

转载自blog.csdn.net/weixin_41243045/article/details/88192071