mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f542f0c4ff |
@@ -45,7 +45,6 @@ user_guides/visualization/visualization.md
|
||||
user_guides/iges/iges.md
|
||||
user_guides/step/step.md
|
||||
user_guides/xde/xde.md
|
||||
user_guides/de_wrapper/de_wrapper.md
|
||||
user_guides/ocaf/ocaf.md
|
||||
user_guides/draw_test_harness/draw_test_harness.md
|
||||
user_guides/inspector/inspector.md
|
||||
|
@@ -20,7 +20,6 @@ user_guides/vis/vis.md
|
||||
user_guides/iges/iges.md
|
||||
user_guides/step/step.md
|
||||
user_guides/xde/xde.md
|
||||
user_guides/de_wrapper/de_wrapper.md
|
||||
user_guides/inspector/inspector.md
|
||||
user_guides/draw_test_harness/draw_test_harness.md
|
||||
|
||||
|
@@ -1,413 +0,0 @@
|
||||
Data Exchange Wrapper (DE_Wrapper) {#occt_user_guides__de_wrapper}
|
||||
============================
|
||||
|
||||
@tableofcontents
|
||||
|
||||
@section occt_de_wrapper_1 Introduction
|
||||
|
||||
This guide explains how to use the **Data Exchange Wrapper** (DE Wrapper).
|
||||
It provides basic directions on setup, usage and file creation via DE_Wrapper.
|
||||
|
||||
The Data Exchange Wrapper (DE Wrapper) module allows reading and writing supported CAD formats to shape objects or special XDE documents, setting up the transfer process for all CAD files.
|
||||
|
||||
It is also possible to add support for new CAD formats by prototyping existing tools.
|
||||
|
||||
The DE Wrapper component requires @ref occt_user_guides__xde "XDE" toolkit for operation.
|
||||
|
||||
This guide mainly explains how to convert CAD files to Open CASCADE Technology (OCCT) shapes and vice versa.
|
||||
This guide principally deals with the following OCCT classes:
|
||||
* The Provider class, which loads CAD files and translates their contents to OCCT shapes or XDE documents, or translates OCCT shapes or XDE documents to CAD entities and then writes those entities to a CAD file.
|
||||
* The Configuration class, which contains all information for the transfer process, such as the units, tolerance, and all internal information for the OCC readers or writers.
|
||||
* The wrapper class, which contains all loaded configuration objects with own CAD format, reads or writes CAD files in the format derived from file extension or contents and saves or loads configuration settings for loaded configuration objects.
|
||||
|
||||
@section occt_de_wrapper_2 Supported CAD formats
|
||||
|
||||
| CAD format | Extensions | RW support | Thread Safety | Presentation | Package |
|
||||
| :--------- | :--------- | :--------- | :----------- | :----------- | :------ |
|
||||
| STEP | .stp, .step .stepz | RW | No | BRep, Mesh | STEPCAFControl |
|
||||
| XCAF | .xbf | RW | Yes | BRep, Mesh | DEXCAFCascade |
|
||||
| BREP | .brep | RW | Yes | BRep, Mesh | DEBRepCascade |
|
||||
| IGES | .igs, .iges | RW | No | BRep | IGESCAFControl |
|
||||
| OBJ | .obj | RW | Yes | Mesh | RWObj |
|
||||
| STL | .stl | RW | Yes | Mesh | RWStl |
|
||||
| PLY | .ply | W | Yes | Mesh | RWPly |
|
||||
| GLTF | .glTF .glb | RW | Yes | Mesh | RWGltf |
|
||||
| VRML | .wrl .vrml | RW | Yes | Mesh | Vrml |
|
||||
|
||||
**Note** :
|
||||
* The format names in the first column match the FormatName values used for configuration nodes.
|
||||
* The VendorName for all listed CAD formats is "OCC".
|
||||
|
||||
@section occt_de_wrapper_3 DE Session Configuration
|
||||
|
||||
Any providers can have their own read/write parameters. The transfer process is set up using DE configuration nodes, which hold all relevant parameters. There are two ways to change the parameter values: directly from code or by an external resource file/string.
|
||||
The session is a global or static DE_Wrapper object that stores registered DE configuration nodes and wraps DE commands to work with them. It has some configuration parameters of its own and also keeps track of loaded nodes and specilal global parameters.
|
||||
|
||||
@subsection occt_de_wrapper_3_1 Getting a DE session. Code sample
|
||||
|
||||
Working with a DE session requires a DE_Wrapper object to be loaded or created first.
|
||||
|
||||
Getting the global DE_Wrapping object:
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
~~~~
|
||||
Creating a local DE_Wrapper:
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = new DE_Wrapper();
|
||||
~~~~
|
||||
It is recommended to create a local one-time copy to work with the session, if no global changes are intended.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aOneTimeSession = aSession->Copy();
|
||||
~~~~
|
||||
@subsection occt_de_wrapper_3_2 Configuration resource
|
||||
|
||||
Configuration resource is an external file or string of the following format:
|
||||
~~~~{.cpp}
|
||||
global.priority.STEP : OCC DTK
|
||||
global.general.length.unit : 1
|
||||
provider.STEP.OCC.read.precision.val : 0.0001
|
||||
~~~~
|
||||
|
||||
@subsubsection occt_de_wrapper_3_2_1 Configuration resource: graph of scopes
|
||||
* **global.** is a scope of global parameters
|
||||
* **priority.** is a scope of priority to use vendors with their providers.
|
||||
* **general.** is a scope of global configuration parameter values
|
||||
* <strong>"..."</strong> is an internal configuration with any internal scopes
|
||||
* <strong>". : "</strong> is a separator of key-value
|
||||
* __...__ parameter value, can't contain new line symbols.
|
||||
* **provider.** is a scope of configuration providers
|
||||
* **STEP.** is a scope of CAD format to configure
|
||||
* **OCC.** is a scope of a vendor or provider
|
||||
* <strong>"..."</strong> is an internal configuration with any internal scopes
|
||||
* <strong>". : "</strong> is a separator of key-value
|
||||
* <strong>"..."</strong> parameter value, can't contain new line symbols.
|
||||
|
||||
@subsubsection occt_de_wrapper_3_2_2 Loading configuration resources. Configuring DE Session
|
||||
|
||||
The resource should be loaded after the registration of all providers that should be configured. The resource only impacts registered parameters. To configure a new registered provider it is necessary to load the resource again. Parameters not present in the resource will remain unchanged.
|
||||
|
||||
There are two ways to check what parameters are available:
|
||||
* C++: Open ConfigureNode file and check the InternalParameter field. Each parameter will be described with a comment. To check the global parameters, use the DE_Wrapper class public methods.
|
||||
* Resource: Register all available Nodes to the session, then save the configuration and view all existing parameters.
|
||||
|
||||
There are two options for loading a resource: recursive and global parameters only. Recursive is the default option to configure all global parameters (units, priority, enable status) and all registered providers. Non-recursive configures only global parameters and ignores all provider settings. This option is the best for updating provider priority.
|
||||
|
||||
@subsubsection occt_de_wrapper_3_2_3 Loading configuration resources. Code sample
|
||||
|
||||
Configuring using a resource string:
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TCollection_AsciiString aString =
|
||||
"global.priority.STEP : OCC DTK\n"
|
||||
"global.general.length.unit : 1\n"
|
||||
"provider.STEP.OCC.read.precision.val : 0.\n";
|
||||
Standard_Boolean aIsRecursive = Standard_True;
|
||||
if (!aSession->Load(aString, aIsRecursive))
|
||||
{
|
||||
Message::SendFail() << "Error: configuration is incorrect";
|
||||
}
|
||||
~~~~
|
||||
Configuring using a resource file:
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TCollection_AsciiString aPathToFile = "";
|
||||
Standard_Boolean aIsRecursive = Standard_True;
|
||||
if (!aSession->Load(aPathToFile, aIsRecursive))
|
||||
{
|
||||
Message::SendFail() << "Error: configuration is incorrect";
|
||||
}
|
||||
~~~~
|
||||
@subsubsection occt_de_wrapper_3_2_4 Loading configuration resources. DRAW sample
|
||||
|
||||
Configuring using a resource string:
|
||||
~~~~{.cpp}
|
||||
set conf "
|
||||
global.priority.STEP : OCC
|
||||
global.general.length.unit : 1
|
||||
provider.STEP.OCC.read.iges.bspline.continuity : 1
|
||||
provider.STEP.OCC.read.precision.mode : 0
|
||||
provider.STEP.OCC.read.precision.val : 0.0001
|
||||
"
|
||||
LoadConfiguration ${conf} -recursive on
|
||||
~~~~
|
||||
|
||||
Configuring using a resource file:
|
||||
~~~~{.cpp}
|
||||
set pathToFile ""
|
||||
LoadConfiguration ${pathToFile} -recursive on
|
||||
~~~~
|
||||
|
||||
@subsubsection occt_de_wrapper_3_2_5 Saving configuration resources. Dump of configuration DE Session
|
||||
|
||||
Saving the configuration of a DE Session involves dumping all parameters of registered providers.
|
||||
If a parameter did not change during the session, its value remains as default.
|
||||
|
||||
There are two ways to save a resource: recursive and global parameters only. Recursive is the way to dump all registered provider information. Non-recursive dumps only global parameters, for example, save priority of vendors or the length unit.
|
||||
|
||||
It is possible to filter what vendors or providers to save by providing the correct name of the vendor or provider.
|
||||
|
||||
@subsubsection occt_de_wrapper_3_2_6 Saving configuration resources. Code sample
|
||||
|
||||
Dump to resource string. If the vendors list is empty, saves all vendors. If the providers list is empty, saves all providers of valid vendors.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TColStd_ListOfAsciiString aFormats;
|
||||
TColStd_ListOfAsciiString aVendors;
|
||||
aFormats.Appends("STEP");
|
||||
aVendors.Appends("OCC");
|
||||
Standard_Boolean aIsRecursive = Standard_True;
|
||||
TCollection_AsciiString aConf = aSession->aConf->Save(aIsRecursive, aFormats, aVendors);
|
||||
~~~~
|
||||
Configure using a resource file. If the vendors list is empty, saves all vendors. If the providers list is empty, saves all providers of valid vendors.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TCollection_AsciiString aPathToFile = "";
|
||||
TColStd_ListOfAsciiString aFormats;
|
||||
TColStd_ListOfAsciiString aVendors;
|
||||
aFormats.Appends("STEP");
|
||||
aVendors.Appends("OCC");
|
||||
Standard_Boolean aIsRecursive = Standard_True;
|
||||
if (!aSession->Save(aPathToFile, aIsRecursive, aFormats,aVendors))
|
||||
{
|
||||
Message::SendFail() << "Error: configuration is not saved";
|
||||
}
|
||||
~~~~
|
||||
@subsubsection occt_de_wrapper_3_2_7 Saving configuration resources. DRAW sample
|
||||
|
||||
Dump configuration to string. If no list of vendors is passed or it is empty, all vendors are saved. If no providers list is passed or it is empty, all providers of valid vendors are saved.
|
||||
~~~~{.cpp}
|
||||
set vendors "OCC"
|
||||
set format "STEP"
|
||||
set dump_conf [DumpConfiguration -recursive on -format ${format} -vendor ${vendors}]
|
||||
~~~~
|
||||
|
||||
Dump configuration to file. If no vendors list are set as an argument or it is empty, saves all vendors. If no providers list as argument or it is empty, saves all providers of valid vendors:
|
||||
~~~~{.cpp}
|
||||
set vendors "OCC"
|
||||
set format "STEP"
|
||||
set pathToFile ""
|
||||
DumpConfiguration -path ${pathToFile} -recursive on -format ${format} -vendor ${vendors}
|
||||
~~~~
|
||||
|
||||
@subsection occt_de_wrapper_3_3 Registering providers
|
||||
|
||||
To transfer a CAD file using DE Wrapper, it is necessary to register a CAD provider.
|
||||
The provider contains internal and global parameters that have default values in the creation stage.
|
||||
All registered providers are set to the map with information about its vendor and kept as smart handles. Therefore, it is possible to change the values via handle from external code.
|
||||
|
||||
@subsubsection occt_de_wrapper_3_3_1 Registering providers. Code sample
|
||||
|
||||
It is nesessary to register only one ConfigurationNode for all needed formats.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
Handle(DE_ConfigurationNode) aNode = new STEPCAFControl_ConfigurationNode();
|
||||
aSession->Bind(aNode);
|
||||
~~~~
|
||||
@subsubsection occt_de_wrapper_3_3_2 Registering providers. DRAW Sample
|
||||
|
||||
Use DRAW with all providers registered by the following command:
|
||||
~~~~{.cpp}
|
||||
pload XDE
|
||||
~~~~
|
||||
|
||||
@subsubsection occt_de_wrapper_3_3_3 Realtime initialization. Code sample
|
||||
|
||||
It is possible to change a paramater from code using a smart pointer.
|
||||
|
||||
~~~~{.cpp}
|
||||
// global variable
|
||||
static Handle(STEPCAFControl_ConfigurationNode) THE_STEP_NODE;
|
||||
|
||||
static Handle(DE_ConfigurationNode) RegisterStepNode()
|
||||
{
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
if (!THE_STEP_NODE.IsNull())
|
||||
{
|
||||
return THE_STEP_NODE;
|
||||
}
|
||||
|
||||
THE_STEP_NODE = new STEPCAFControl_ConfigurationNode();
|
||||
aSession->Bind(THE_STEP_NODE);
|
||||
return THE_STEP_NODE;
|
||||
}
|
||||
|
||||
// Change parameter value
|
||||
THE_STEP_NODE->InternalParameters.ReadRelationship = false;
|
||||
THE_STEP_NODE->InternalParameters.ReadName = false;
|
||||
THE_STEP_NODE->InternalParameters.ReadProps = false;
|
||||
~~~~
|
||||
|
||||
@subsection occt_de_wrapper_3_4 Priority of Vendors
|
||||
|
||||
DE session is able to work with several vendors with the same supported CAD format. To choose the preffered vendor for each format, use a special priority list.
|
||||
|
||||
If the high priority vendor's provider is not supported, a transfer operation is needed (write/read), then the next vendor will be chosen.
|
||||
|
||||
@subsubsection occt_de_wrapper_3_4_1 Priority of Vendors. Code sample
|
||||
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TCollection_AsciiString aFormat = "STEP";
|
||||
TColStd_ListOfAsciiString aVendors;
|
||||
aVendors.Appends("OCC"); // high priority
|
||||
aVendors.Appends("DTK");
|
||||
// Flag to disable not choosen vendors, in this case configuration is possible
|
||||
// otherwise, lower their priority and continue to check ability to transfer
|
||||
Standard_Boolean aToDisable = Standard_True;
|
||||
aSession->ChangePriority(aFormat, aVendors, aToDisable);
|
||||
~~~~
|
||||
|
||||
@subsubsection occt_de_wrapper_3_4_2 Priority of Vendors. DRAW Sample
|
||||
|
||||
It is recommended to disable recursion and update only global parameters.
|
||||
~~~~{.cpp}
|
||||
set conf "
|
||||
global.priority.STEP : OCC DTK
|
||||
"
|
||||
LoadConfiguration ${conf} -recursive off
|
||||
~~~~
|
||||
|
||||
@section occt_de_wrapper_4 Transfer of CAD files
|
||||
|
||||
To transfer from a CAD file to OCC or from OCC to a CAD file, it is necessary to use a configured DE_Wrapper object. It can be local, one-time or global. Global configuration of DE_Wrapper propagates to all nodes via transfer. There are two options for transferring: using OCC shape or XCAF document. It is possible to work only with real path to/from the file. Streaming is not supported (yet).
|
||||
|
||||
The format of input/output file is automatically determined by its extension or contents.
|
||||
|
||||
@subsection occt_de_wrapper_4_1 Transfer of CAD files. Code samples
|
||||
|
||||
Reading STEP file to Shape.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TCollection_AsciiString aPathToFile = "example.stp";
|
||||
TopoDS_Shape aShRes;
|
||||
if (!aSession->Read(aPathToFile, aShRes))
|
||||
{
|
||||
Message::SendFail() << "Error: Can't read file";
|
||||
}
|
||||
~~~~
|
||||
|
||||
Writing Shape to STEP file.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TCollection_AsciiString aPathToFile = "example.stp";
|
||||
TopoDS_Shape aShFrom = ...;
|
||||
if (!aSession->Write(aPathToFile, aShRes))
|
||||
{
|
||||
Message::SendFail() << "Error: Can't write file";
|
||||
}
|
||||
~~~~
|
||||
|
||||
Reading STEP file into XCAF document.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TCollection_AsciiString aPathToFile = "example.stp";
|
||||
Handle(TDocStd_Document) aDoc = ...;
|
||||
if (!aSession->Read(aPathToFile, aDoc))
|
||||
{
|
||||
Message::SendFail() << "Error: Can't read file";
|
||||
}
|
||||
~~~~
|
||||
|
||||
Writing XCAF document into STEP.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
TCollection_AsciiString aPathToFile = "example.stp";
|
||||
Handle(TDocStd_Document) aDoc = ...;
|
||||
if (!aSession->Write(aPathToFile, aDoc))
|
||||
{
|
||||
Message::SendFail() << "Error: Can't write file";
|
||||
}
|
||||
~~~~
|
||||
|
||||
@subsection occt_de_wrapper_4_2 Transfer of CAD files. DRAW samples
|
||||
|
||||
Reading a STEP file into a Shape.
|
||||
~~~~{.cpp}
|
||||
set fileName "sample.stp"
|
||||
readfile shape ${fileName}
|
||||
~~~~
|
||||
|
||||
Writing a Shape into STEP.
|
||||
~~~~{.cpp}
|
||||
set fileName "sample.stp"
|
||||
writefile shape ${fileName}
|
||||
~~~~
|
||||
|
||||
Reading STEP into XCAF document.
|
||||
~~~~{.cpp}
|
||||
set fileName "sample.stp"
|
||||
ReadFile D ${fileName}
|
||||
~~~~
|
||||
|
||||
Writing XCAF document into STEP.
|
||||
~~~~{.cpp}
|
||||
set fileName "sample.stp"
|
||||
WriteFile D ${fileName}
|
||||
~~~~
|
||||
|
||||
@subsection occt_de_wrapper_4_3 Transfer using DE Provider. Code sample
|
||||
|
||||
It is possible to read and write CAD files directly from a special provider.
|
||||
|
||||
~~~~{.cpp}
|
||||
// Creating or getting node
|
||||
Handle(STEPCAFControl_ConfigurationNode) aNode = new STEPCAFControl_ConfigurationNode();
|
||||
// Creationg an one-time provider
|
||||
Handle(DE_Provider) aProvider = aNode->BuildProvider();
|
||||
// Setting configuration with all parameters
|
||||
aProvider->SetNode(aNode);
|
||||
if (!aProvider->Read(...))
|
||||
{
|
||||
Message::SendFail() << "Error: Can't read STEP file";
|
||||
}
|
||||
if (!aProvider->Write(...))
|
||||
{
|
||||
Message::SendFail() << "Error: Can't write STEP file";
|
||||
}
|
||||
~~~~
|
||||
|
||||
@subsection occt_de_wrapper_4_4 Temporary configuration via transfer
|
||||
|
||||
It is possible to change the configuration of only one transfer operation. To avoid changing parameters in a session, one-time clone of the session can be created and used for transfer. This way is recommended for use in multithreaded mode.
|
||||
|
||||
@subsubsection occt_de_wrapper_4_4_1 Temporary configuration via transfer. Code sample
|
||||
|
||||
Code sample to configure via transfer.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper()->Copy();
|
||||
TCollection_AsciiString aString =
|
||||
"global.priority.STEP : OCC DTK\n"
|
||||
"global.general.length.unit : 1\n"
|
||||
"provider.STEP.OCC.read.precision.val : 0.\n";
|
||||
if (!aSession->Load(aString, aIsRecursive))
|
||||
{
|
||||
Message::SendFail() << "Error: configuration is incorrect";
|
||||
}
|
||||
TCollection_AsciiString aPathToFile = "example.stp";
|
||||
TopoDS_Shape aShRes;
|
||||
if (!aSession->Read(aPathToFile, aShRes))
|
||||
{
|
||||
Message::SendFail() << "Error: Can't read file";
|
||||
}
|
||||
~~~~
|
||||
|
||||
@subsubsection occt_de_wrapper_4_4_2 Temporary configuration via transfer. DRAW sample
|
||||
|
||||
Code sample to configure via transfer within DRAW command.
|
||||
~~~~{.cpp}
|
||||
set fileName "sample.stp"
|
||||
readfile S5 $filename -conf "global.general.length.unit : 1000 "
|
||||
~~~~
|
||||
|
||||
Code sample to configure via transfer as variable.
|
||||
~~~~{.cpp}
|
||||
set fileName "sample.stp"
|
||||
set conf "
|
||||
global.priority.STEP : OCC
|
||||
global.general.length.unit : 1
|
||||
provider.STEP.OCC.read.iges.bspline.continuity : 1
|
||||
provider.STEP.OCC.read.precision.mode : 0
|
||||
provider.STEP.OCC.read.precision.val : 0.0001
|
||||
"
|
||||
readfile S5 $filename -conf ${conf}
|
||||
~~~~
|
@@ -13,7 +13,6 @@ OCCT User Guides are organized by OCCT modules:
|
||||
* @subpage occt_user_guides__iges "IGES Translator"
|
||||
* @subpage occt_user_guides__step "STEP Translator"
|
||||
* @subpage occt_user_guides__xde "Extended Data Exchange (XDE)"
|
||||
* @subpage occt_user_guides__de_wrapper "Data Exchange Wrapper (DE Wrapper)"
|
||||
* @subpage occt_user_guides__ocaf "Open CASCADE Application Framework (OCAF)"
|
||||
* @subpage occt_user_guides__test_harness "DRAW Test Harness"
|
||||
* @subpage occt_user_guides__inspector "Inspector"
|
||||
|
@@ -3,8 +3,6 @@
|
||||
#
|
||||
#Create 3 torus
|
||||
|
||||
puts "TODO CR33225 Linux: Error : The area of result shape is 138625, expected 197700"
|
||||
|
||||
ptorus a0 100 20
|
||||
tcopy a0 a1
|
||||
tcopy a0 a2
|
||||
|
24
tests/bugs/caf/bug114
Executable file
24
tests/bugs/caf/bug114
Executable file
@@ -0,0 +1,24 @@
|
||||
puts "==========="
|
||||
puts "OCC114"
|
||||
puts "==========="
|
||||
|
||||
# Max number of iterations for computing memory leackage
|
||||
set i_max 10
|
||||
puts "Amount of iterations is $i_max"
|
||||
|
||||
NewDocument D BinOcaf
|
||||
UndoLimit D 10
|
||||
|
||||
restore [locate_data_file OCC294.brep] s
|
||||
|
||||
set listmem {}
|
||||
for {set i 1} {${i} <= ${i_max}} {incr i} {
|
||||
|
||||
OpenCommand D
|
||||
SetShape D 0:1 s
|
||||
AbortCommand D
|
||||
|
||||
# check memory usage (with tolerance equal to half page size)
|
||||
lappend listmem [meminfo h]
|
||||
checktrend $listmem 50 50 "Memory leak detected"
|
||||
}
|
17
tests/bugs/caf/bug26293_2
Normal file
17
tests/bugs/caf/bug26293_2
Normal file
@@ -0,0 +1,17 @@
|
||||
puts "==========="
|
||||
puts "OCC26293"
|
||||
puts "==========="
|
||||
puts ""
|
||||
#################################
|
||||
# Error opening the document
|
||||
#################################
|
||||
|
||||
Open [locate_data_file bug26293_all_geom.sgd] D
|
||||
vinit
|
||||
for {set i 1} {$i < 1065} {incr i} {
|
||||
if { ![catch {GetShape D 0:1:$i:1:1:2 res$i}] } {
|
||||
vdisplay res$i
|
||||
}
|
||||
}
|
||||
vfit
|
||||
checkview -screenshot -3d -path ${imagedir}/${test_image}.png
|
@@ -1,5 +1,3 @@
|
||||
puts "TODO ?CR33225 Windows: Failed class "
|
||||
|
||||
pload QAcommands
|
||||
|
||||
QANTestStlIterators
|
||||
|
@@ -1,4 +1,3 @@
|
||||
puts "TODO ?СК33225 Linux: Checking trend failed "
|
||||
puts "TODO ?OCC7287 Linux: Tcl Exception: Memory leak detected"
|
||||
puts "TODO ?OCC7287 Linux: TEST INCOMPLETE"
|
||||
puts "TODO ?OCC7287 MacOS: Tcl Exception: Memory leak detected"
|
||||
|
@@ -1,4 +1,3 @@
|
||||
puts "TODO ?CR332257287 Linux: Checking trend failed: mean delta per step = 9432.0, sigma = 4220.013270121316, expected delta = 0"
|
||||
puts "TODO ?OCC7287 Linux: Tcl Exception: Memory leak detected"
|
||||
puts "TODO ?OCC7287 Linux: TEST INCOMPLETE"
|
||||
puts "TODO ?OCC7287 MacOS: Tcl Exception: Memory leak detected"
|
||||
|
@@ -1,4 +1,3 @@
|
||||
puts "TODO ?CR33225 Linux: Checking trend failed: mean delta per step = 7408.0, sigma = 2737.917456754312, expected delta = 0"
|
||||
puts "TODO ?OCC7287 Linux: Tcl Exception: Memory leak detected"
|
||||
puts "TODO ?OCC7287 Linux: TEST INCOMPLETE"
|
||||
puts "TODO ?OCC7287 MacOS: Tcl Exception: Memory leak detected"
|
||||
|
18
tests/bugs/mesh/bug32424
Normal file
18
tests/bugs/mesh/bug32424
Normal file
@@ -0,0 +1,18 @@
|
||||
puts "======="
|
||||
puts "0032424: Mesh - Slow triangulation of a simple shape."
|
||||
puts "======="
|
||||
puts ""
|
||||
cpulimit 3
|
||||
|
||||
restore [locate_data_file bug32424.brep] result
|
||||
|
||||
incmesh result 0.17 -a 20
|
||||
|
||||
checktrinfo result -tri 2360 -nod 1302
|
||||
|
||||
vinit
|
||||
vdefaults -autoTriang 0
|
||||
vsetdispmode 1
|
||||
vdisplay result
|
||||
vfit
|
||||
checkview -screenshot -3d -path ${imagedir}/${test_image}.png
|
@@ -1,12 +1,7 @@
|
||||
puts "TODO CR33225 Linux: Error : The command is not valid. The area is 0."
|
||||
puts "TODO CR33225 Linux: Error : The area of result shape is 0, expected 177462"
|
||||
puts "TODO CR33225 Linux: is WRONG because number of "
|
||||
|
||||
puts "============"
|
||||
puts "OCC19071"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
#######################################################################
|
||||
# The MakeFuse or the MakePartition function crash together on 2 torus
|
||||
#######################################################################
|
||||
|
@@ -1,5 +1,4 @@
|
||||
puts "TODO CR30351 Windows: Faulty OCC25199: Bad tolerance edge generated by blend algorithm"
|
||||
puts "TODO CR33225 Linux: Faulty OCC25199: Bad tolerance edge generated by blend algorithm"
|
||||
|
||||
puts "============"
|
||||
puts "OCC25199"
|
||||
|
20
tests/bugs/modalg_6/bug26616
Normal file
20
tests/bugs/modalg_6/bug26616
Normal file
@@ -0,0 +1,20 @@
|
||||
puts "========"
|
||||
puts "OCC26616"
|
||||
puts "========"
|
||||
puts ""
|
||||
############################################
|
||||
# Memory leak in IntTools_Context::Hatcher
|
||||
############################################
|
||||
|
||||
restore [locate_data_file OCC26635_t0.brep] t0
|
||||
restore [locate_data_file OCC26635_t1.brep] t1
|
||||
|
||||
bfuse res t0 t1
|
||||
|
||||
set listmem {}
|
||||
for {set i 1} {$i < 10} {incr i} {
|
||||
bfuse res t0 t1
|
||||
|
||||
lappend listmem [meminfo h]
|
||||
checktrend $listmem 0 64 "Memory leak detected"
|
||||
}
|
@@ -3,8 +3,6 @@ puts "OCC27884: Modeling Algorithms - Possible improvement for 2d classifier"
|
||||
puts "================================================================="
|
||||
puts ""
|
||||
|
||||
puts "TODO ?CR33225 Windows: Error: algorithm slowed down"
|
||||
|
||||
pload ALL
|
||||
pload QAcommands
|
||||
|
||||
|
@@ -1,5 +1,3 @@
|
||||
puts "TODO ?CR33225 Windows: extra characters after close-quote "
|
||||
|
||||
puts "========"
|
||||
puts "OCC29293"
|
||||
puts "========"
|
||||
|
48
tests/bugs/modalg_7/bug29843_1
Normal file
48
tests/bugs/modalg_7/bug29843_1
Normal file
@@ -0,0 +1,48 @@
|
||||
puts "========"
|
||||
puts "0029843: Modeling Algorithms - Boolean FUSE produces incorrect result"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug29843.brep] s
|
||||
|
||||
explode s
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects s_1
|
||||
baddtools s_2
|
||||
bfillds
|
||||
|
||||
bbop r_0 0
|
||||
bbop r_1 1
|
||||
bbop r_2 2
|
||||
bbop r_3 3
|
||||
bbop r_4 4
|
||||
bbuild r_5
|
||||
|
||||
foreach i { 0 1 2 3 4 5} {
|
||||
checkshape r_$i
|
||||
if {![regexp "OK" [bopcheck r_$i]]} {
|
||||
puts "Error: r_$i is self-intersecting shape"
|
||||
}
|
||||
}
|
||||
|
||||
checkprops r_0 -s 9.84429 -v 0.639311
|
||||
checknbshapes r_0 -wire 7 -face 5 -shell 1 -solid 1 -t
|
||||
|
||||
checkprops r_1 -s 2121.39 -v 612.41
|
||||
checknbshapes r_1 -wire 38 -face 32 -shell 2 -solid 1 -t
|
||||
|
||||
checkprops r_2 -s 2113.85 -v 611.569
|
||||
checknbshapes r_2 -wire 32 -face 26 -shell 2 -solid 1 -t
|
||||
|
||||
checkprops r_3 -s 15.9893 -v 0.215264
|
||||
checknbshapes r_3 -wire 11 -face 9 -shell 2 -solid 2 -t
|
||||
|
||||
checkprops r_4 -l 24.9725
|
||||
checksection r_4 -r 2
|
||||
|
||||
checkprops r_5 -s 2139.68 -v 612.402
|
||||
checknbshapes r_5 -wire 44 -face 36 -shell 5 -solid 4 -t
|
||||
|
||||
checkview -display r_0 -2d -path ${imagedir}/${test_image}.png
|
||||
|
@@ -2,9 +2,6 @@ puts "========"
|
||||
puts "OCC162"
|
||||
puts "========"
|
||||
|
||||
puts "TODO ?CR33225 Linux: Checking trend failed "
|
||||
puts "TODO ?CR33225 Linux: Tcl Exception: Memory leak detected"
|
||||
|
||||
pload QAcommands
|
||||
pload XDE
|
||||
|
||||
|
@@ -1,5 +1,4 @@
|
||||
puts "TODO OCC24156 MacOS: Error: unsupported locale specification"
|
||||
puts "TODO CR33225 Linux: Error: unsupported locale specification"
|
||||
|
||||
# Test for issue #22898 and other functionality that can be affected by locale.
|
||||
# Just run multiple conversions of the shape to and from different formats and
|
||||
|
16
tests/de_mesh/gltf_write/010
Normal file
16
tests/de_mesh/gltf_write/010
Normal file
@@ -0,0 +1,16 @@
|
||||
puts "========"
|
||||
puts "0032867: Data Exchange - Implement Draco compression for writing glTF"
|
||||
puts "Test case exporting model into glb (binary glTF) file."
|
||||
puts "========"
|
||||
|
||||
Close D0 -silent
|
||||
ReadGltf D0 [locate_data_file bug32867_010.glb]
|
||||
|
||||
set aGltfFile1 "${imagedir}/${casename}_tmp1.glb"
|
||||
set aGltfFile2 "${imagedir}/${casename}_tmp2.glb"
|
||||
|
||||
WriteGltf D0 "$aGltfFile1" -draco on -mergefaces
|
||||
WriteGltf D0 "$aGltfFile2" -draco on
|
||||
|
||||
ReadGltf D1 "$aGltfFile1"
|
||||
ReadGltf D "$aGltfFile2"
|
16
tests/de_mesh/gltf_write/Diamond
Normal file
16
tests/de_mesh/gltf_write/Diamond
Normal file
@@ -0,0 +1,16 @@
|
||||
puts "========"
|
||||
puts "0032867: Data Exchange - Implement Draco compression for writing glTF"
|
||||
puts "Test case exporting model into glb (binary glTF) file."
|
||||
puts "========"
|
||||
|
||||
Close D0 -silent
|
||||
ReadGltf D0 [locate_data_file bug32867_Diamond.glb]
|
||||
|
||||
set aGltfFile1 "${imagedir}/${casename}_tmp1.glb"
|
||||
set aGltfFile2 "${imagedir}/${casename}_tmp2.glb"
|
||||
|
||||
WriteGltf D0 "$aGltfFile1" -draco on
|
||||
WriteGltf D0 "$aGltfFile2" -draco on -mergefaces
|
||||
|
||||
ReadGltf D1 "$aGltfFile1"
|
||||
ReadGltf D "$aGltfFile2"
|
18
tests/de_mesh/gltf_write/as1draco
Normal file
18
tests/de_mesh/gltf_write/as1draco
Normal file
@@ -0,0 +1,18 @@
|
||||
puts "========"
|
||||
puts "0032867: Data Exchange - Implement Draco compression for writing glTF"
|
||||
puts "Test case exporting model into glb (binary glTF) file."
|
||||
puts "========"
|
||||
|
||||
Close D0 -silent
|
||||
ReadStep D0 [locate_data_file as1-oc-214-mat.stp]
|
||||
XGetOneShape ss D0
|
||||
incmesh ss 1.0
|
||||
|
||||
set aGltfFile1 "${imagedir}/${casename}_tmp1.glb"
|
||||
set aGltfFile2 "${imagedir}/${casename}_tmp2.glb"
|
||||
|
||||
WriteGltf D0 "$aGltfFile1" -draco on
|
||||
WriteGltf D0 "$aGltfFile2" -draco on -mergefaces
|
||||
|
||||
ReadGltf D1 "$aGltfFile1"
|
||||
ReadGltf D "$aGltfFile2"
|
16
tests/de_mesh/gltf_write/bearing
Normal file
16
tests/de_mesh/gltf_write/bearing
Normal file
@@ -0,0 +1,16 @@
|
||||
puts "========"
|
||||
puts "0032867: Data Exchange - Implement Draco compression for writing glTF"
|
||||
puts "Test case exporting model into glb (binary glTF) file."
|
||||
puts "========"
|
||||
|
||||
restore [locate_data_file bearing.brep] b
|
||||
incmesh b 0.1
|
||||
|
||||
set aGltfFile1 "${imagedir}/${casename}_tmp1.glb"
|
||||
set aGltfFile2 "${imagedir}/${casename}_tmp2.glb"
|
||||
|
||||
WriteGltf b "$aGltfFile1" -draco on
|
||||
WriteGltf b "$aGltfFile2" -draco on -mergefaces
|
||||
|
||||
ReadGltf D0 "$aGltfFile1"
|
||||
ReadGltf D "$aGltfFile2"
|
16
tests/de_mesh/gltf_write/bull
Normal file
16
tests/de_mesh/gltf_write/bull
Normal file
@@ -0,0 +1,16 @@
|
||||
puts "========"
|
||||
puts "0032867: Data Exchange - Implement Draco compression for writing glTF"
|
||||
puts "Test case exporting model into glb (binary glTF) file."
|
||||
puts "========"
|
||||
|
||||
Close D0 -silent
|
||||
ReadGltf D0 [locate_data_file bug32867_bull.glb]
|
||||
|
||||
set aGltfFile1 "${imagedir}/${casename}_tmp1.glb"
|
||||
set aGltfFile2 "${imagedir}/${casename}_tmp2.glb"
|
||||
|
||||
WriteGltf D0 "$aGltfFile1" -draco on
|
||||
WriteGltf D0 "$aGltfFile2" -draco on -mergefaces
|
||||
|
||||
ReadGltf D1 "$aGltfFile1"
|
||||
ReadGltf D "$aGltfFile2"
|
13
tests/de_mesh/gltf_write/bull_parallel
Normal file
13
tests/de_mesh/gltf_write/bull_parallel
Normal file
@@ -0,0 +1,13 @@
|
||||
puts "========"
|
||||
puts "0032867: Data Exchange - Implement Draco compression for writing glTF"
|
||||
puts "Test case exporting model into glb (binary glTF) file."
|
||||
puts "========"
|
||||
|
||||
Close D0 -silent
|
||||
ReadGltf D0 [locate_data_file bug32867_bull.glb]
|
||||
|
||||
set aGltfFile1 "${imagedir}/${casename}_tmp1.glb"
|
||||
|
||||
WriteGltf D0 "$aGltfFile1" -draco on -parallel
|
||||
|
||||
ReadGltf D "$aGltfFile1"
|
18
tests/de_mesh/gltf_write/screw
Normal file
18
tests/de_mesh/gltf_write/screw
Normal file
@@ -0,0 +1,18 @@
|
||||
puts "========"
|
||||
puts "0032867: Data Exchange - Implement Draco compression for writing glTF"
|
||||
puts "Test case exporting model into glb (binary glTF) file."
|
||||
puts "========"
|
||||
|
||||
Close D0 -silent
|
||||
ReadStep D0 [locate_data_file screw.step]
|
||||
XGetOneShape ss D0
|
||||
incmesh ss 1.0
|
||||
|
||||
set aGltfFile1 "${imagedir}/${casename}_tmp1.glb"
|
||||
set aGltfFile2 "${imagedir}/${casename}_tmp2.glb"
|
||||
|
||||
WriteGltf D0 "$aGltfFile1" -draco on -mergefaces
|
||||
WriteGltf D0 "$aGltfFile2" -draco on
|
||||
|
||||
ReadGltf D1 "$aGltfFile1"
|
||||
ReadGltf D "$aGltfFile2"
|
17
tests/de_mesh/gltf_write/soapbox
Normal file
17
tests/de_mesh/gltf_write/soapbox
Normal file
@@ -0,0 +1,17 @@
|
||||
puts "========"
|
||||
puts "0032867: Data Exchange - Implement Draco compression for writing glTF"
|
||||
puts "Test case exporting model into glb (binary glTF) file."
|
||||
puts "========"
|
||||
|
||||
ReadStep D0 [locate_data_file ec_soapbox-A.stp]
|
||||
XGetOneShape ss D0
|
||||
incmesh ss 1.0
|
||||
|
||||
set aGltfFile1 "${imagedir}/${casename}_tmp1.glb"
|
||||
set aGltfFile2 "${imagedir}/${casename}_tmp2.glb"
|
||||
|
||||
WriteGltf D0 "$aGltfFile1" -draco on
|
||||
WriteGltf D0 "$aGltfFile2" -draco on -mergefaces
|
||||
|
||||
ReadGltf D1 "$aGltfFile1"
|
||||
ReadGltf D "$aGltfFile2"
|
20
tests/de_mesh/gltf_write/test
Normal file
20
tests/de_mesh/gltf_write/test
Normal file
@@ -0,0 +1,20 @@
|
||||
puts "========"
|
||||
puts "0032867: Data Exchange - Implement Draco compression for writing glTF"
|
||||
puts "Test case exporting model into glb (binary glTF) file."
|
||||
puts "========"
|
||||
|
||||
Close D0 -silent
|
||||
ReadGltf D0 [locate_data_file bug32867_test.glb]
|
||||
|
||||
set aGltfFile1 "${imagedir}/${casename}_tmp1.glb"
|
||||
set aGltfFile2 "${imagedir}/${casename}_tmp2.glb"
|
||||
|
||||
WriteGltf D0 "$aGltfFile1" -draco on
|
||||
WriteGltf D0 "$aGltfFile2" -draco on -mergefaces
|
||||
|
||||
ReadGltf D1 "$aGltfFile1"
|
||||
XGetOneShape s1 D1
|
||||
checktrinfo s1 -tri 9366
|
||||
ReadGltf D "$aGltfFile2"
|
||||
XGetOneShape s2 D
|
||||
checktrinfo s2 -tri 9366
|
8
tests/heal/checkshape/bug32448_10
Normal file
8
tests/heal/checkshape/bug32448_10
Normal file
@@ -0,0 +1,8 @@
|
||||
puts "REQUIRED All: Faulty shapes in variables faulty_1 to faulty_6101"
|
||||
puts "=========="
|
||||
puts "0032448: Provide exact validating (as option) using GeomLib_CheckCurveOnSurface"
|
||||
puts "=========="
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file OCC54.brep] b
|
||||
checkshape b -exact -parallel
|
@@ -1,5 +1,5 @@
|
||||
puts "TODO OCC30286 Windows: Error : The length of result shape is 404.004, expected 404.386"
|
||||
puts "TODO CR33225 Linux: Error : The length of result shape is 404.004, expected 404.386"
|
||||
puts "TODO OCC30286 Linux: Error : The length of result shape is 404.492, expected 404.386"
|
||||
|
||||
polyline f1 0 0 0 0 -10 0 100 -10 0 100 0 0 0 0 0
|
||||
polyline f2 100 0 0 110 0 0 110 100 0 100 100 0 100 0 0
|
||||
|
43
tests/opengl/data/background/skydome
Normal file
43
tests/opengl/data/background/skydome
Normal file
@@ -0,0 +1,43 @@
|
||||
puts "============"
|
||||
puts "0032606: Visualization - add a shader for sky"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
set THE_DIM 256
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
psphere s 1
|
||||
|
||||
vinit View1 -width 768 -height 512
|
||||
vcamera -persp -fovy 120
|
||||
|
||||
chrono t restart
|
||||
vbackground -skydome -size $THE_DIM -cloud 0.3 -sunDir 1.0 0.5 0.0 -time 10 -fog 0.3
|
||||
chrono t show
|
||||
vaxo
|
||||
vdump $imagedir/${casename}_day.png
|
||||
|
||||
chrono t restart
|
||||
vbackground -skydome -size $THE_DIM -cloud 0.3 -sunDir 1.0 -0.5 0.0 -time -10 -fog 0.05
|
||||
chrono t show
|
||||
vaxo
|
||||
vdump $imagedir/${casename}_night.png
|
||||
|
||||
chrono t restart
|
||||
vbackground -skydome -size $THE_DIM -cloud 0.15 -sunDir 1.0 0.15 0.0 -time 10
|
||||
chrono t show
|
||||
vaxo
|
||||
vdump $imagedir/${casename}_sunset.png
|
||||
|
||||
chrono t restart
|
||||
vbackground -skydome -size $THE_DIM
|
||||
chrono t show
|
||||
vaxo
|
||||
vdump $imagedir/${casename}_defaults.png
|
||||
|
||||
vdisplay -dispMode 1 s
|
||||
vfit
|
||||
vaspects s -material SILVER
|
||||
vrenderparams -shadingModel pbr
|
||||
vlight headlight -enabled 0
|
||||
vdump $imagedir/${casename}_pbr.png
|
33
tests/opengl/data/general/bug25679
Normal file
33
tests/opengl/data/general/bug25679
Normal file
@@ -0,0 +1,33 @@
|
||||
puts "========"
|
||||
puts "OCC25679: Visualization, TKOpenGl - View frustum culling clips wrong objects"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
set LINES_IN_ROW 50
|
||||
|
||||
set aNoCulling $imagedir/${casename}_without.png
|
||||
set aWithCulling $imagedir/${casename}_with.png
|
||||
set aDiff $imagedir/${casename}_diff.png
|
||||
|
||||
vinit View1
|
||||
|
||||
for {set i 0} {$i < $LINES_IN_ROW} {incr i} {
|
||||
for {set j 0} {$j < $LINES_IN_ROW} {incr j} {
|
||||
set aLineName "line"
|
||||
append aLineName [expr $i * $LINES_IN_ROW + $j]
|
||||
vline $aLineName 0 0 0 1 0 0
|
||||
vsetlocation $aLineName [expr $i * 3] [expr $j * 3] 0
|
||||
}
|
||||
}
|
||||
|
||||
vfit
|
||||
|
||||
vrenderparams -frustumculling on
|
||||
vdump $aWithCulling
|
||||
vrenderparams -frustumculling off
|
||||
vdump $aNoCulling
|
||||
|
||||
set aDiffRes [diffimage $aWithCulling $aNoCulling 0.1 0 0 $aDiff]
|
||||
if {$aDiffRes != 0} { puts "ERROR : Test failed: there is a difference between images rendered with and without frustum culling" }
|
53
tests/opengl/data/raytrace/bug25201
Normal file
53
tests/opengl/data/raytrace/bug25201
Normal file
@@ -0,0 +1,53 @@
|
||||
puts "========"
|
||||
puts "OCC25201: Visualization - Implementing soft shadows and ambient occlusion in OCCT ray-tracing core"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# custom shapes
|
||||
set aShape1 [locate_data_file occ/Top.brep]
|
||||
set aShape2 [locate_data_file occ/Bottom.brep]
|
||||
|
||||
# setup 3D viewer content
|
||||
vinit name=View1 w=512 h=512
|
||||
vglinfo
|
||||
|
||||
vvbo 0
|
||||
vsetdispmode 1
|
||||
vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
|
||||
vtextureenv on 4
|
||||
restore $aShape1 s1
|
||||
restore $aShape2 s2
|
||||
vdisplay s1 s2
|
||||
vsetmaterial s1 Gold
|
||||
vsetmaterial s2 Silver
|
||||
vsetlocation s1 0.0 0.1 0.0
|
||||
vlight -change 0 -dir 0.667 -0.667 -0.333 -smoothAngle 6 -intensity 100
|
||||
vturnview 3.0 -1.2 -0.1
|
||||
vfit
|
||||
|
||||
# activate path tracing
|
||||
vrenderparams -raytrace
|
||||
vrenderparams -gi
|
||||
vrenderparams -rayDepth 12
|
||||
|
||||
set aModeNum 0
|
||||
|
||||
vbsdf s1 roughness 6400
|
||||
|
||||
vfps 200
|
||||
vdump $imagedir/${casename}_${aModeNum}.png
|
||||
incr aModeNum
|
||||
|
||||
vsetmaterial s1 glass
|
||||
vbsdf s1 absorpcoeff 1.0
|
||||
|
||||
vfps 200
|
||||
vdump $imagedir/${casename}_${aModeNum}.png
|
||||
incr aModeNum
|
||||
|
||||
vsetmaterial s2 plaster
|
||||
|
||||
vfps 200
|
||||
vdump $imagedir/${casename}_${aModeNum}.png
|
||||
incr aModeNum
|
10
tests/opengl/data/raytrace/dof_mono
Normal file
10
tests/opengl/data/raytrace/dof_mono
Normal file
@@ -0,0 +1,10 @@
|
||||
puts "========"
|
||||
puts "Ray Tracing - check depth-of-field"
|
||||
puts "========"
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_cube.tcl
|
||||
|
||||
vrenderparams -ray -gi -rayDepth 10 -iss
|
||||
vrenderparams -aperture 0.1 -focal 2.0
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}.png
|
16
tests/opengl/data/raytrace/dof_stereo
Normal file
16
tests/opengl/data/raytrace/dof_stereo
Normal file
@@ -0,0 +1,16 @@
|
||||
puts "========"
|
||||
puts "Ray Tracing - check depth-of-field"
|
||||
puts "========"
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_cube.tcl
|
||||
|
||||
vrenderparams -ray -gi -rayDepth 10 -iss
|
||||
vrenderparams -aperture 0.1 -focal 2.0
|
||||
|
||||
# activate stereo
|
||||
vstereo on
|
||||
vstereo -mode anaglyph
|
||||
vcamera -iod 0.1
|
||||
vfit
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}.png -stereo blend
|
34
tests/opengl/data/raytrace/normal_map
Normal file
34
tests/opengl/data/raytrace/normal_map
Normal file
@@ -0,0 +1,34 @@
|
||||
puts "========"
|
||||
puts "0031275: Visualization, TKOpenGl - handle normal-map texture with Path-Tracing"
|
||||
puts "========"
|
||||
|
||||
pload XDE OCAF MODELING VISUALIZATION
|
||||
Close D -silent
|
||||
ReadGltf D [locate_data_file bug31275_SphereWithNormalMap.glb]
|
||||
|
||||
vclear
|
||||
vinit v -w 1024 -h 1024
|
||||
vbackground -cubemap [locate_data_file Circus_CubeMap_V.png]
|
||||
vcamera -persp
|
||||
vlight -clear
|
||||
vlight -add ambient
|
||||
XDisplay -dispmode 1 D
|
||||
vback
|
||||
vfit
|
||||
|
||||
vrenderparams -ignoreNormalMap on
|
||||
vrenderparams -ray -gi -rayDepth 10
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}_without_normal_map.png
|
||||
|
||||
vrenderparams -ignoreNormalMap off
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}_with_normal_map_back.png
|
||||
|
||||
vfront
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}_with_normal_map_front.png
|
||||
|
||||
vlight -add positional -pos 0 0 0 -head 1 -intensity 10
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}_point_light.png
|
43
tests/opengl/data/raytrace/pbr_spheres
Normal file
43
tests/opengl/data/raytrace/pbr_spheres
Normal file
@@ -0,0 +1,43 @@
|
||||
puts "========"
|
||||
puts "0031225: Visualization, TKOpenGl - support cubemap for environment texture within Ray-Tracing"
|
||||
puts "Spheres grid with different roughness values"
|
||||
puts "========"
|
||||
|
||||
cpulimit 600
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vclose ALL
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/vis_pbr_spheres.tcl
|
||||
|
||||
vrenderparams -ray -gi -rayDepth 10
|
||||
vcamera -ortho
|
||||
vfit
|
||||
vlight -change 1 -intensity 0.0001
|
||||
vfps 200
|
||||
vdump $::imagedir/${::casename}_ortho0.png
|
||||
|
||||
vlight -change 1 -intensity 0.3
|
||||
vfps 200
|
||||
vdump $::imagedir/${::casename}_ortho30.png
|
||||
|
||||
vcamera -persp
|
||||
vfit
|
||||
vlight -change 1 -intensity 0.0001
|
||||
vfps 200
|
||||
vdump $::imagedir/${::casename}_persp0.png
|
||||
|
||||
vlight -change 1 -intensity 0.3
|
||||
vfps 200
|
||||
vdump $::imagedir/${::casename}_persp30.png
|
||||
|
||||
set aCubeMap [locate_data_file Circus_CubeMap_V.png]
|
||||
vlight -change 1 -intensity 1
|
||||
vbackground -cubemap $aCubeMap
|
||||
vcamera -ortho
|
||||
vfps 200
|
||||
vdump $::imagedir/${::casename}_orthoenv.png
|
||||
|
||||
vcamera -persp
|
||||
vfps 200
|
||||
vdump $::imagedir/${::casename}_perspenv.png
|
13
tests/opengl/data/raytrace/sample_ball_alpha
Normal file
13
tests/opengl/data/raytrace/sample_ball_alpha
Normal file
@@ -0,0 +1,13 @@
|
||||
puts "============"
|
||||
puts "Visualization - Path Tracing, Ball sample"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_ball.tcl
|
||||
|
||||
vtexture ball 21 -scale 0.1 0.1
|
||||
vsetmaterial ball plaster
|
||||
vbsdf ball -coatFresnel Constant 0.0
|
||||
|
||||
vfps 100
|
||||
vdump $imagedir/${casename}_zoom.png
|
20
tests/opengl/data/raytrace/sample_ball_iss
Normal file
20
tests/opengl/data/raytrace/sample_ball_iss
Normal file
@@ -0,0 +1,20 @@
|
||||
puts "============"
|
||||
puts "Visualization - Path Tracing, Ball sample (ISS mode)"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
cpulimit 1000
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_ball.tcl
|
||||
|
||||
vrenderparams -iss -nbtiles 64
|
||||
vfps 1024
|
||||
vdump $imagedir/${casename}_iss_64.png
|
||||
|
||||
vrenderparams -iss -nbtiles 256
|
||||
vfps 256
|
||||
vdump $imagedir/${casename}_iss_256.png
|
||||
|
||||
vrenderparams -iss -nbtiles 1024
|
||||
vfps 64
|
||||
vdump $imagedir/${casename}_iss_1024.png
|
13
tests/opengl/data/raytrace/sample_ball_wood
Normal file
13
tests/opengl/data/raytrace/sample_ball_wood
Normal file
@@ -0,0 +1,13 @@
|
||||
puts "============"
|
||||
puts "0031135: Visualization, TKOpenGl - texture sRGB -> linear conversion is applied twice by Path Tracer"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_ball.tcl
|
||||
|
||||
vtexture ball 11 -scale 0.1 0.1
|
||||
vsetmaterial ball plaster
|
||||
vbsdf ball -coatFresnel Constant 0.0
|
||||
|
||||
vfps 100
|
||||
vdump $imagedir/${casename}_zoom.png
|
8
tests/opengl/data/raytrace/sample_cube
Normal file
8
tests/opengl/data/raytrace/sample_cube
Normal file
@@ -0,0 +1,8 @@
|
||||
puts "============"
|
||||
puts "Visualization - Path Tracing, Cube sample"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_cube.tcl
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}.png
|
22
tests/opengl/data/raytrace/sample_cube_clamp
Normal file
22
tests/opengl/data/raytrace/sample_cube_clamp
Normal file
@@ -0,0 +1,22 @@
|
||||
puts "============"
|
||||
puts "Visualization - Path Tracing, Cube sample with radiance clamping"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_cube.tcl
|
||||
|
||||
vrenderparams -maxrad 1.0
|
||||
vfps 100
|
||||
vdump $imagedir/${casename}_1.png
|
||||
|
||||
vrenderparams -maxrad 2.0
|
||||
vfps 100
|
||||
vdump $imagedir/${casename}_2.png
|
||||
|
||||
vrenderparams -maxrad 10.0
|
||||
vfps 100
|
||||
vdump $imagedir/${casename}_10.png
|
||||
|
||||
vrenderparams -maxrad 100.0
|
||||
vfps 100
|
||||
vdump $imagedir/${casename}_100.png
|
19
tests/opengl/data/raytrace/sample_cube_twosided
Normal file
19
tests/opengl/data/raytrace/sample_cube_twosided
Normal file
@@ -0,0 +1,19 @@
|
||||
puts "============"
|
||||
puts "Visualization - Path Tracing, Cube sample"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_cube.tcl
|
||||
|
||||
vaxo
|
||||
vfit
|
||||
vfps 100
|
||||
|
||||
# Dump image produced with one-sided BSDFs
|
||||
vdump $imagedir/${casename}_onesided.png
|
||||
|
||||
vrenderparams -twoside
|
||||
vfps 100
|
||||
|
||||
# Dump image produced with two-sided BSDFs
|
||||
vdump $imagedir/${casename}_twosided.png
|
7
tests/opengl/data/raytrace/sample_materials
Normal file
7
tests/opengl/data/raytrace/sample_materials
Normal file
@@ -0,0 +1,7 @@
|
||||
puts "============"
|
||||
puts "Visualization - Path Tracing, Materials sample"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_materials.tcl
|
||||
vdump $imagedir/${casename}_materials.png
|
14
tests/opengl/data/raytrace/tone_mapping
Normal file
14
tests/opengl/data/raytrace/tone_mapping
Normal file
@@ -0,0 +1,14 @@
|
||||
puts "========"
|
||||
puts "Ray Tracing - check tone mapping"
|
||||
puts "========"
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_cube.tcl
|
||||
|
||||
vrenderparams -ray -gi -rayDepth 10 -iss
|
||||
|
||||
vrenderparams -tonemapping filmic
|
||||
vrenderparams -exposure -1.0
|
||||
vrenderparams -whitepoint 7.0
|
||||
vfit
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}.png
|
34
tests/opengl/data/shading/pbr_spheres
Normal file
34
tests/opengl/data/shading/pbr_spheres
Normal file
@@ -0,0 +1,34 @@
|
||||
puts "========"
|
||||
puts "0030700: Visualization, TKOpenGl - support PBR Metallic-Roughness shading model"
|
||||
puts "Spheres grid with different roughness values"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# PBR doesn't work with Compatible Profile on macOS
|
||||
if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
|
||||
|
||||
vclear
|
||||
vclose ALL
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/vis_pbr_spheres.tcl
|
||||
|
||||
vcamera -ortho
|
||||
vfit
|
||||
vlight -change 1 -intensity 0.0001
|
||||
vdump $::imagedir/${::casename}_ortho0.png
|
||||
vlight -change 1 -intensity 0.3
|
||||
vdump $::imagedir/${::casename}_ortho30.png
|
||||
vcamera -persp
|
||||
vfit
|
||||
vlight -change 1 -intensity 0.0001
|
||||
vdump $::imagedir/${::casename}_persp0.png
|
||||
vlight -change 1 -intensity 0.3
|
||||
vdump $::imagedir/${::casename}_persp30.png
|
||||
|
||||
set aCubeMap [locate_data_file Circus_CubeMap_V.png]
|
||||
vlight -change 1 -intensity 1
|
||||
vbackground -cubemap $aCubeMap
|
||||
vcamera -ortho
|
||||
vdump $::imagedir/${::casename}_orthoenv.png
|
||||
vcamera -persp
|
||||
vdump $::imagedir/${::casename}_perspenv.png
|
68
tests/opengl/data/shading/shading_models
Normal file
68
tests/opengl/data/shading/shading_models
Normal file
@@ -0,0 +1,68 @@
|
||||
puts "========"
|
||||
puts "Test various Shading Models assigned per-object"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# PBR doesn't work with Compatible Profile on macOS
|
||||
#if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
|
||||
|
||||
# setup viewer
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1 -width 912 -height 912
|
||||
|
||||
# define spheres with a rough triangulation to easily distinguish Shading Models
|
||||
psphere p0 10
|
||||
copytranslate p11 p0 0 0 0
|
||||
copytranslate p12 p0 40 0 0
|
||||
copytranslate p21 p0 0 20 0
|
||||
copytranslate p22 p0 40 20 0
|
||||
copytranslate p31 p0 0 40 0
|
||||
copytranslate p32 p0 40 40 0
|
||||
compound p11 p12 p21 p22 p31 p32 ss
|
||||
incmesh ss 1
|
||||
vdefaults -autoTriang 0
|
||||
|
||||
# display objects
|
||||
vdisplay -dispMode 1 p11 p12 p21 p22 p31 p32
|
||||
vdrawparray p41 triangles v 0 55 0 v 0 75 0 v 20 55 0 v 0 55 0 v 0 75 0 v 0 55 20 v 0 55 0 v 0 55 20 v 20 55 0 v 0 75 0 v 0 55 20 v 20 55 0
|
||||
vdrawparray p42 triangles v 40 55 0 v 40 75 0 v 60 55 0 v 40 55 0 v 40 75 0 v 40 55 20 v 40 55 0 v 40 55 20 v 60 55 0 v 40 75 0 v 40 55 20 v 60 55 0
|
||||
vtop
|
||||
vrotate -0.9 0.1 0
|
||||
vfit
|
||||
|
||||
vcaps -ffp 1
|
||||
vdump $::imagedir/${::casename}_defaults_ffp.png
|
||||
|
||||
vcaps -ffp 0
|
||||
vdump $::imagedir/${::casename}_defaults.png
|
||||
|
||||
# customize shading models
|
||||
vaspects p11 -setShadingModel VERTEX
|
||||
vdrawtext t11 Graphic3d_TOSM_VERTEX -pos 10 5 10 -color RED -aspect BOLD
|
||||
vaspects p12 -setShadingModel FRAGMENT
|
||||
vdrawtext t12 Graphic3d_TOSM_FRAGMENT -pos 50 5 10 -color RED -aspect BOLD
|
||||
|
||||
vaspects p21 -setShadingModel PBR
|
||||
vdrawtext t21 Graphic3d_TOSM_PBR -pos 10 25 10 -color RED -aspect BOLD
|
||||
vaspects p22 -setShadingModel PBR_FACET
|
||||
vdrawtext t22 Graphic3d_TOSM_PBR_FACET -pos 50 25 10 -color RED -aspect BOLD
|
||||
|
||||
vaspects p31 -setShadingModel UNLIT
|
||||
vdrawtext t31 Graphic3d_TOSM_UNLIT -pos 10 45 10 -color RED -aspect BOLD
|
||||
vaspects p32 -setShadingModel FACET
|
||||
vdrawtext t32 Graphic3d_TOSM_FACET -pos 50 45 10 -color RED -aspect BOLD
|
||||
vaspects p41 -setShadingModel VERTEX
|
||||
vdrawtext t41 Graphic3d_TOSM_VERTEX -pos 10 65 10 -color RED -aspect BOLD
|
||||
vaspects p42 -setShadingModel FACET
|
||||
vdrawtext t42 Graphic3d_TOSM_FACET -pos 50 65 10 -color RED -aspect BOLD
|
||||
vdisplay -topmost t11 t12 t21 t22 t31 t32 t41 t42
|
||||
|
||||
vcaps -ffp 1
|
||||
vdump $::imagedir/${::casename}_ffp.png
|
||||
|
||||
vcaps -ffp 0
|
||||
vlight -change 1 -intensity 0.1
|
||||
vrenderparams -shadingModel pbr
|
||||
vdump $::imagedir/${::casename}.png
|
36
tests/opengl/data/textures/cubemap_dds
Normal file
36
tests/opengl/data/textures/cubemap_dds
Normal file
@@ -0,0 +1,36 @@
|
||||
puts "============"
|
||||
puts "0031478: Visualization, TKOpenGl - allow uploading Cubemap in compressed DDS format when supported by GPU"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
if { $::tcl_platform(os) == "Darwin" } {
|
||||
# PBR doesn't work with Compatible Profile on macOS
|
||||
vcaps -core
|
||||
}
|
||||
if { [vdriver -default] == "TKOpenGles" } {
|
||||
puts "Skipping test case 'DDS texture': OpenGL ES does not support sRGB S3TC_DXT1 texture format"
|
||||
return
|
||||
}
|
||||
|
||||
set aCubeMapPNG [locate_data_file cubemap_labels.png]
|
||||
set aCubeMapDDS [locate_data_file cubemap_labels.dds]
|
||||
|
||||
box b 1 2 3
|
||||
psphere s 1
|
||||
|
||||
vclear
|
||||
vinit View1 -w 512 -h 512
|
||||
vcamera -fovy 100
|
||||
vzbufftrihedron
|
||||
#vdisplay -dispMode 1 b
|
||||
vdisplay -dispMode 1 s
|
||||
vfit
|
||||
|
||||
vrenderparams -shadingModel pbr
|
||||
vbackground -cubemap $aCubeMapPNG -invertedz
|
||||
vdump $imagedir/${casename}_png.png
|
||||
|
||||
vbackground -cubemap $aCubeMapDDS -invertedz
|
||||
vdump $imagedir/${casename}_dds.png
|
25
tests/opengl/data/textures/cubemap_ibl
Normal file
25
tests/opengl/data/textures/cubemap_ibl
Normal file
@@ -0,0 +1,25 @@
|
||||
puts "============"
|
||||
puts "0032590: Visualization, V3d_View - improve API for setting Image Based Lighting"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
set aCubeMapLabs [locate_data_file cubemap_labels.png]
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# PBR doesn't work with Compatible Profile on macOS
|
||||
if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
|
||||
|
||||
vclear
|
||||
vclose ALL
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/vis_pbr_spheres.tcl
|
||||
vcamera -fovy 100
|
||||
|
||||
vbackground -cubemap $aCubeMapLabs -pbrEnv noIBL
|
||||
vdump $imagedir/${casename}_1.png
|
||||
|
||||
vbackground -pbrEnv IBL
|
||||
vdump $imagedir/${casename}_2.png
|
||||
|
||||
vbackground BLACK -pbrEnv KEEP
|
||||
vdump $imagedir/${casename}_3.png
|
31
tests/opengl/data/textures/pbr_tangent_normal
Normal file
31
tests/opengl/data/textures/pbr_tangent_normal
Normal file
@@ -0,0 +1,31 @@
|
||||
puts "========"
|
||||
puts "0031302: Visualization, TKOpenGl - wrong tangent space calculation for normal maps"
|
||||
puts "Test for tangent space orientation."
|
||||
puts "========"
|
||||
|
||||
pload XDE OCAF MODELING VISUALIZATION
|
||||
|
||||
# PBR doesn't work with Compatible Profile on macOS
|
||||
if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
|
||||
|
||||
vclear
|
||||
vclose ALL
|
||||
|
||||
vinit v -w 1024 -h 1024
|
||||
vcamera -persp
|
||||
vbackground -cubemap [locate_data_file Circus_CubeMap_V.png]
|
||||
vrenderparams -shadingModel PBR
|
||||
|
||||
vlight -clear
|
||||
vlight -add ambient
|
||||
|
||||
Close D -silent
|
||||
ReadGltf D [locate_data_file bug31302_NormalTangentTest.gltf]
|
||||
XDisplay -dispmode 1 D
|
||||
|
||||
vfront
|
||||
vfit
|
||||
vdump $imagedir/${casename}_front.png
|
||||
|
||||
vback
|
||||
vdump $imagedir/${casename}_back.png
|
51
tests/opengl/data/transparency/ior
Normal file
51
tests/opengl/data/transparency/ior
Normal file
@@ -0,0 +1,51 @@
|
||||
puts "========"
|
||||
puts "0031284: Visualization - XCAFDoc_VisMaterialPBR lacks Index of Refraction"
|
||||
puts "========"
|
||||
|
||||
pload MODELING XDE OCAF VISUALIZATION
|
||||
if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
|
||||
|
||||
box b 0.5 1.0 -0.5 3 1 1
|
||||
psphere s1 0.5
|
||||
psphere s2 0.5
|
||||
psphere s3 0.5
|
||||
ttranslate s1 1 0 0
|
||||
ttranslate s2 2 0 0
|
||||
ttranslate s3 3 0 0
|
||||
Close D -silent
|
||||
XNewDoc D
|
||||
set l0 [XAddShape D b 0]
|
||||
set l1 [XAddShape D s1 0]
|
||||
set l2 [XAddShape D s2 0]
|
||||
set l3 [XAddShape D s3 0]
|
||||
XAddVisMaterial D m1 -baseColor GREEN -refractionIndex 1.0 -transparency 0.5 -metallic 0 -roughness 0
|
||||
XAddVisMaterial D m2 -baseColor GREEN -refractionIndex 1.3 -transparency 0.5 -metallic 0 -roughness 0
|
||||
XAddVisMaterial D m3 -baseColor GREEN -refractionIndex 2.5 -transparency 0.5 -metallic 0 -roughness 0
|
||||
XSetVisMaterial D $l1 m1
|
||||
XSetVisMaterial D $l2 m2
|
||||
XSetVisMaterial D $l3 m3
|
||||
|
||||
vclear
|
||||
vinit View1
|
||||
vcamera -persp
|
||||
vfront
|
||||
XDisplay -dispMode 1 D
|
||||
vfit
|
||||
vviewparams -scale 245 -proj -0 -0.75 -0.66 -up 0 -0.66 0.75 -at 2.0 0.84 0.04
|
||||
vlight -change 0 -intensity 2.5
|
||||
vlight -change 1 -intensity 1.0
|
||||
set aCubeMap [locate_data_file Circus_CubeMap_V.png]
|
||||
vbackground -cubemap $aCubeMap
|
||||
|
||||
vrenderparams -shadingModel PBR -raster
|
||||
vdump $imagedir/${casename}_pbr.png
|
||||
|
||||
if { ![string match "OpenGL ES 2.0*" [vglinfo VERSION]] && ![string match "OpenGL ES 3.0*" [vglinfo VERSION]] } {
|
||||
vrenderparams -raytrace -gi 0 -reflections 1 -rayDepth 10
|
||||
vfps 200
|
||||
vdump $imagedir/${casename}_rt.png
|
||||
|
||||
vrenderparams -raytrace -gi 1
|
||||
vfps 200
|
||||
vdump $imagedir/${casename}_pt.png
|
||||
}
|
@@ -3,8 +3,6 @@ puts "Testing performance of Strtod() vs. standard strtod()"
|
||||
puts "================================================================="
|
||||
puts ""
|
||||
|
||||
puts "TODO ?CR33225 Linux: is expected to be at least "
|
||||
|
||||
pload QAcommands
|
||||
|
||||
# Check that performance of Strtod() and Atof() is at least twice better
|
||||
|
3
tests/tools/begin
Normal file
3
tests/tools/begin
Normal file
@@ -0,0 +1,3 @@
|
||||
if { [array get Draw_Groups "TOOLS Check commands"] == "" } {
|
||||
pload TOOLS
|
||||
}
|
12
tests/tools/dfbrowser/A1
Normal file
12
tests/tools/dfbrowser/A1
Normal file
@@ -0,0 +1,12 @@
|
||||
pload DCAF
|
||||
pload INSPECTOR
|
||||
|
||||
NewDocument Doc BinOcaf
|
||||
|
||||
set aSetAttr1 100
|
||||
set aLabel 0:2
|
||||
SetInteger Doc ${aLabel} ${aSetAttr1}
|
||||
|
||||
tinspector -plugins dfbrowser
|
||||
tinspector -update
|
||||
|
23
tests/tools/dfbrowser/A2
Normal file
23
tests/tools/dfbrowser/A2
Normal file
@@ -0,0 +1,23 @@
|
||||
pload DCAF VISUALIZATION INSPECTOR
|
||||
|
||||
NewDocument D BinOcaf
|
||||
tinspector -plugins dfbrowser
|
||||
|
||||
cpulimit 300
|
||||
UndoLimit D 100
|
||||
|
||||
NewCommand D
|
||||
|
||||
NewCommand D
|
||||
|
||||
set B2 [AddObject D]
|
||||
set F2 [AddFunction D $B2 Box]
|
||||
BoxDX D $B2 190
|
||||
BoxDY D $B2 290
|
||||
BoxDZ D $B2 390
|
||||
|
||||
InitLogBook D
|
||||
AddDriver D Box Attach Cyl
|
||||
ComputeFun D $F2
|
||||
|
||||
tinspector -update
|
2
tests/tools/dfbrowser/A3
Normal file
2
tests/tools/dfbrowser/A3
Normal file
@@ -0,0 +1,2 @@
|
||||
pload INSPECTOR
|
||||
tinspector -plugins dfbrowser -open $env(CSF_OCCTDataPath)/step/screw.step -select 0:1:1:1
|
150
tests/tools/dfbrowser/A4
Normal file
150
tests/tools/dfbrowser/A4
Normal file
@@ -0,0 +1,150 @@
|
||||
pload DCAF INSPECTOR TOPTEST
|
||||
|
||||
# Create the first document and set UndoLimit
|
||||
NewDocument Doc1 BinOcaf
|
||||
UndoLimit Doc1 100
|
||||
|
||||
# Add an attribute to a data framework
|
||||
set aSetAttr1 100
|
||||
set aLabel 0:2
|
||||
SetInteger Doc1 ${aLabel} ${aSetAttr1}
|
||||
|
||||
|
||||
# Create the second document
|
||||
set test_name "OCC26961"
|
||||
set test_int 123
|
||||
set test_real 123.456e-7
|
||||
set test_int_arr {10 20}
|
||||
set test_real_arr {1.1 3.14 5.4e18}
|
||||
set test_extstr_arr {"sample string 1" "string 2"}
|
||||
set test_bool_arr {0 1}
|
||||
set test_ref_arr {"0:1:2:3:2" "0:1:2:3:1"}
|
||||
set test_byte_arr {15 25}
|
||||
set test_map {1 5 2 10}
|
||||
set test_map_sorted {1 2 5 10}
|
||||
set test_named_ints {i1 1 i2 2}
|
||||
set test_named_reals {r1 1.1 r2 2.2}
|
||||
set test_named_strings {s1 string1 s2 string2 s3 string3_string_extended s4 string4_double_extended s5 string5}
|
||||
set test_named_bytes {b1 65 b2 66}
|
||||
set test_ref "0:1:1"
|
||||
set test_guid "00000000-0000-0000-2222-000000000000"
|
||||
set test_comment "Sample document containing various attributes"
|
||||
set test_string "Sample string"
|
||||
set test_expr "2*pi*r"
|
||||
set test_var1 "0:1:2:3:2"
|
||||
set test_var2 "0:1:2:3:1"
|
||||
set test_point "111 222 333"
|
||||
set test_axisPos "10 10 30"
|
||||
set test_axisDir "11 22 33"
|
||||
set test_plane "15 25 35"
|
||||
set test_boxXYZ "10 20 30"
|
||||
set test_boxDX 100
|
||||
set test_boxDY 200
|
||||
set test_boxDZ 300
|
||||
set test_geom_t "cir"
|
||||
set test_failure 1
|
||||
set test_driver "G"
|
||||
set test_driver_id "2a96b604-ec8b-11d0-bee7-080009dc3333"
|
||||
set test_transp 0.5
|
||||
set test_color AQUAMARINE4
|
||||
set test_material 22
|
||||
set test_positionX 100
|
||||
set test_positionY 200
|
||||
set test_positionZ 300
|
||||
|
||||
puts "Creating document"
|
||||
NewDocument D BinOcaf
|
||||
|
||||
# Simple values
|
||||
SetInteger D 0:1:1 $test_int
|
||||
SetReal D 0:1:1 $test_real
|
||||
SetName D 0:1:1 $test_name
|
||||
SetComment D 0:1:1 $test_comment
|
||||
SetAsciiString D 0:1:1 $test_string
|
||||
|
||||
# TagSource
|
||||
SetTagger D 0:1:2
|
||||
|
||||
# Reference
|
||||
SetReference D 0:1:3 $test_ref
|
||||
|
||||
# Directory
|
||||
#NewDirectory D 0:1:2:1
|
||||
|
||||
# UAttribute
|
||||
#SetUAttribute D 0:1:2:2 $test_guid
|
||||
|
||||
# Variable
|
||||
SetVariable D $test_var2 0 mm
|
||||
SetVariable D $test_var1 1 ""
|
||||
|
||||
# Relation
|
||||
SetRelation D 0:1:2:3 "2*pi*r" $test_var1 $test_var2
|
||||
|
||||
# TreeNode
|
||||
SetNode D 0:1:2:4
|
||||
|
||||
# Arrays
|
||||
eval SetIntArray D 0:1:1 1 1 2 $test_int_arr
|
||||
eval SetRealArray D 0:1:1 1 1 3 $test_real_arr
|
||||
eval SetExtStringArray D 0:1:1 1 1 2 $test_extstr_arr
|
||||
eval SetRefArray D 0:1:1 1 2 $test_ref_arr
|
||||
eval SetByteArray D 0:1:1 1 1 2 $test_byte_arr
|
||||
|
||||
# Lists
|
||||
eval SetIntegerList D 0:1:1 $test_int_arr
|
||||
eval SetRealList D 0:1:1 $test_real_arr
|
||||
eval SetExtStringList D 0:1:1 $test_extstr_arr
|
||||
eval SetBooleanList D 0:1:1 $test_bool_arr
|
||||
eval SetReferenceList D 0:1:1 $test_ref_arr
|
||||
|
||||
# IntPackedMap
|
||||
eval SetIntPackedMap D 0:1:1 1 $test_map
|
||||
|
||||
# NamedData
|
||||
eval SetNDataIntegers D 0:1:4 2 $test_named_ints
|
||||
eval SetNDataReals D 0:1:4 2 $test_named_reals
|
||||
eval SetNDataStrings D 0:1:4 5 $test_named_strings
|
||||
eval SetNDataBytes D 0:1:4 2 $test_named_bytes
|
||||
eval SetNDataIntArrays D 0:1:4 ia 2 $test_int_arr
|
||||
eval SetNDataRealArrays D 0:1:4 ra 3 $test_real_arr
|
||||
|
||||
# NamedShape
|
||||
eval box Box $test_boxXYZ $test_boxDX $test_boxDY $test_boxDZ
|
||||
SetShape D 0:1:6 Box
|
||||
|
||||
# Point
|
||||
eval point Point $test_point
|
||||
SetPoint D 0:1:5:1 Point
|
||||
|
||||
# Axis
|
||||
eval line Axis $test_axisPos $test_axisDir
|
||||
SetAxis D 0:1:5:2 Axis
|
||||
|
||||
# Plane
|
||||
eval plane Plane $test_plane
|
||||
SetPlane D 0:1:5:3 Plane
|
||||
|
||||
# Geometry
|
||||
SetGeometry D 0:1:6 $test_geom_t
|
||||
|
||||
# Constraint
|
||||
SetConstraint D 0:1:1 equal 0:1:6
|
||||
|
||||
# PatternStd
|
||||
SetPattern D 0:1:1 5 0:1:6
|
||||
|
||||
# Function
|
||||
SetFunction D 0:1:1 $test_guid $test_failure
|
||||
|
||||
# AISPresentation
|
||||
AISInitViewer D
|
||||
AISSet D 0:1:1 $test_driver
|
||||
AISTransparency D 0:1:1 $test_transp
|
||||
AISColor D 0:1:1 $test_color
|
||||
AISMaterial D 0:1:1 $test_material
|
||||
|
||||
# Position
|
||||
SetPosition D 0:1:1 $test_positionX $test_positionY $test_positionZ
|
||||
|
||||
tinspector -plugins dfbrowser
|
78
tests/tools/dfbrowser/A5
Normal file
78
tests/tools/dfbrowser/A5
Normal file
@@ -0,0 +1,78 @@
|
||||
pload TOPTEST
|
||||
pload VISUALIZATION
|
||||
pload XDE
|
||||
pload QAcommands
|
||||
pload DCAF
|
||||
|
||||
set Test "TNaming_Builder test"
|
||||
set IsDone 1
|
||||
set TestError ""
|
||||
|
||||
puts "Creating document"
|
||||
NewDocument D MDTV-Standard
|
||||
set TestLab 0:1
|
||||
|
||||
#################### PRIMITIVE EVOLUTION ####################
|
||||
box b 100 200 300
|
||||
|
||||
explode b E
|
||||
if {[catch {BuildNamedShape D $TestLab:1 PRIMITIVE b}] == 1} {
|
||||
set IsDone 0
|
||||
set TestError "$TestError # Can't build solid as primitive"
|
||||
}
|
||||
if {[catch {BuildNamedShape D [set TestLab]:1:1 PRIMITIVE b_1}] == 1} {
|
||||
set IsDone 0
|
||||
set TestError "$TestError # Can't build edge as alone primitive"
|
||||
}
|
||||
if {[catch {BuildNamedShape D [set TestLab]:1:1 PRIMITIVE b_1 b_2 b_3}] == 1} {
|
||||
set IsDone 0
|
||||
set TestError "$TestError # Can't build several edges as primitive over the old one"
|
||||
}
|
||||
if {[catch {BuildNamedShape D [set TestLab]:1:2 PRIMITIVE b_4 b_5 b_6}] == 1} {
|
||||
set IsDone 0
|
||||
set TestError "$TestError # Can't build several edges as primitive"
|
||||
}
|
||||
|
||||
|
||||
#################### GENERATED EVOLUTION ####################
|
||||
box b2 200 300 400
|
||||
explode b2 F
|
||||
if {[catch {BuildNamedShape D $TestLab:2 GENERATED b b2}] == 1} {
|
||||
set IsDone 0
|
||||
set TestError "$TestError # Can't build solid as generation"
|
||||
}
|
||||
if {[catch {BuildNamedShape D [set TestLab]:2:1 GENERATED b_1 b2_1}] == 1} {
|
||||
set IsDone 0
|
||||
set TestError "$TestError # Can't build face as alone generation"
|
||||
}
|
||||
if {[catch {BuildNamedShape D [set TestLab]:2:2 GENERATED b_2 b2_2 b_2 b2_3 b_3 b2_4}] == 1} {
|
||||
set IsDone 0
|
||||
set TestError "$TestError # Can't build face as generation n:m"
|
||||
}
|
||||
if {[catch {BuildNamedShape D [set TestLab]:2:1 GENERATED b_3 b2_1 b_3 b2_3 b_4 b2_4}] == 1} {
|
||||
set IsDone 0
|
||||
set TestError "$TestError # Can't build face as generation n:m to the exists named shape"
|
||||
}
|
||||
|
||||
#################### MODIFY EVOLUTION ####################
|
||||
box b3 300 400 500
|
||||
explode b3 F
|
||||
if {[catch {BuildNamedShape D $TestLab:3 MODIFY b2 b3}] == 1} {
|
||||
set IsDone 0
|
||||
set TestError "$TestError # Can't build solid as modification"
|
||||
}
|
||||
if {[catch {BuildNamedShape D [set TestLab]:3:1 MODIFY b2_1 b3_1}] == 1} {
|
||||
set IsDone 0
|
||||
set TestError "$TestError # Can't build face as alone modification"
|
||||
}
|
||||
if {[catch {BuildNamedShape D [set TestLab]:3:2 MODIFY b2_5 b3_2 b2_2 b3_3 b2_3 b3_4}] == 1} {
|
||||
set IsDone 0
|
||||
set TestError "$TestError # Can't build face as modification n:m"
|
||||
}
|
||||
if {[catch {BuildNamedShape D [set TestLab]:3:1 MODIFY b2_3 b3_1 b_3 b3_3 b2_4 b3_4}] == 1} {
|
||||
set IsDone 0
|
||||
set TestError "$TestError # Can't build face as modification n:m to the exists named shape"
|
||||
}
|
||||
|
||||
pload INSPECTOR
|
||||
tinspector -select 0:1:3:2 TNaming_NamedShape
|
76
tests/tools/dfbrowser/A6
Normal file
76
tests/tools/dfbrowser/A6
Normal file
@@ -0,0 +1,76 @@
|
||||
pload DCAF
|
||||
|
||||
chrono qat start
|
||||
# Create a new document and set UndoLimit
|
||||
NewDocument D BinOcaf
|
||||
|
||||
#NewDocument D
|
||||
cpulimit 300
|
||||
UndoLimit D 100
|
||||
|
||||
# Open a transaction
|
||||
NewCommand D
|
||||
|
||||
puts "caf005-I3"
|
||||
set QA_DUP 0
|
||||
|
||||
# Add an attribute to a data framework
|
||||
set aLabel_Root 0:2
|
||||
set aName_Root Label_1
|
||||
Label D ${aLabel_Root}
|
||||
SetName D ${aLabel_Root} ${aName_Root}
|
||||
|
||||
set aName1 Label_1_1
|
||||
###set aChild1 [NewChild D ${aLabel_Root}]
|
||||
set aChild1 0:2:1
|
||||
Label D ${aChild1}
|
||||
SetName D ${aChild1} ${aName1}
|
||||
|
||||
set aName2 Label_1_2
|
||||
###set aChild2 [NewChild D ${aLabel_Root}]
|
||||
set aChild2 0:2:2
|
||||
Label D ${aChild2}
|
||||
SetName D ${aChild2} ${aName2}
|
||||
|
||||
set aName3 Label_1_1_1
|
||||
###set aChild3 [NewChild D ${aLabel_Root}]
|
||||
set aChild3 0:2:3
|
||||
Label D ${aChild3}
|
||||
SetName D ${aChild3} ${aName3}
|
||||
|
||||
set aName4 Label_1_1_2
|
||||
###set aChild4 [NewChild D ${aLabel_Root}]
|
||||
set aChild4 0:2:4
|
||||
Label D ${aChild4}
|
||||
SetName D ${aChild4} ${aName4}
|
||||
|
||||
set aName5 Label_1_1_3
|
||||
###set aChild5 [NewChild D ${aLabel_Root}]
|
||||
set aChild5 0:2:5
|
||||
Label D ${aChild5}
|
||||
SetName D ${aChild5} ${aName5}
|
||||
|
||||
set aName6 Label_1_2_1
|
||||
###set aChild6 [NewChild D ${aLabel_Root}]
|
||||
set aChild6 0:2:6
|
||||
Label D ${aChild6}
|
||||
SetName D ${aChild6} ${aName6}
|
||||
|
||||
set aName7 Label_1_2_2
|
||||
###set aChild7 [NewChild D ${aLabel_Root}]
|
||||
set aChild7 0:2:7
|
||||
Label D ${aChild7}
|
||||
SetName D ${aChild7} ${aName7}
|
||||
|
||||
SetNode D ${aLabel_Root}
|
||||
AppendNode D ${aLabel_Root} ${aChild1}
|
||||
AppendNode D ${aLabel_Root} ${aChild2}
|
||||
AppendNode D ${aChild1} ${aChild3}
|
||||
AppendNode D ${aChild1} ${aChild4}
|
||||
AppendNode D ${aChild1} ${aChild5}
|
||||
AppendNode D ${aChild2} ${aChild6}
|
||||
AppendNode D ${aChild2} ${aChild7}
|
||||
|
||||
pload INSPECTOR
|
||||
|
||||
tinspector -plugins dfbrowser -select 0:2:6 TDataStd_TreeNode
|
6
tests/tools/dfbrowser/A7
Normal file
6
tests/tools/dfbrowser/A7
Normal file
@@ -0,0 +1,6 @@
|
||||
puts "========"
|
||||
puts "0029743: Samples - Inspector tool - crash by selecting TNaming_UsedShapes tree item"
|
||||
puts "========"
|
||||
|
||||
pload INSPECTOR
|
||||
tinspector -plugins dfbrowser -open [locate_data_file bug29743.cbf] -select 0 TNaming_UsedShapes
|
7
tests/tools/dfbrowser/A8
Normal file
7
tests/tools/dfbrowser/A8
Normal file
@@ -0,0 +1,7 @@
|
||||
puts "========"
|
||||
puts "0029733: TInspector can't open several cbf files"
|
||||
puts "========"
|
||||
|
||||
pload INSPECTOR
|
||||
tinspector -plugins dfbrowser -open [locate_data_file bug29743.cbf]
|
||||
tinspector -open [locate_data_file bug29733.cbf]
|
12
tests/tools/dfbrowser/A9
Normal file
12
tests/tools/dfbrowser/A9
Normal file
@@ -0,0 +1,12 @@
|
||||
puts "========"
|
||||
puts "0029841: Test cases from tools/dfbrowser periodically hang on Windows platform"
|
||||
puts "========"
|
||||
|
||||
pload INSPECTOR
|
||||
|
||||
tinspector -plugins dfbrowser
|
||||
|
||||
for { set i 1 } { ${i} <= 10 } { incr i } {
|
||||
tinspector -open [locate_data_file bug29743.cbf] -select 0 TNaming_UsedShapes
|
||||
tinspector -open [locate_data_file bug29733.cbf] -select 0 TNaming_UsedShapes
|
||||
}
|
2
tests/tools/end
Normal file
2
tests/tools/end
Normal file
@@ -0,0 +1,2 @@
|
||||
# to end a test script
|
||||
puts "TEST COMPLETED"
|
3
tests/tools/grids.list
Normal file
3
tests/tools/grids.list
Normal file
@@ -0,0 +1,3 @@
|
||||
001 dfbrowser
|
||||
001 shapeview
|
||||
001 vinspector
|
3
tests/tools/parse.rules
Normal file
3
tests/tools/parse.rules
Normal file
@@ -0,0 +1,3 @@
|
||||
SKIPPED /Draw_Failure: Could not open: TKToolsDraw/ OCCT built without Qt tools
|
||||
FAILED /\bFaulty\b/ bad shape
|
||||
OK /Relative error of mass computation/ message from vprops
|
11
tests/tools/shapeview/A1
Normal file
11
tests/tools/shapeview/A1
Normal file
@@ -0,0 +1,11 @@
|
||||
pload ALL INSPECTOR
|
||||
|
||||
tinspector -plugins shapeview
|
||||
|
||||
box b1 200 100 120
|
||||
tinspector -shape b1
|
||||
|
||||
box b2 100 200 220 100 120 100
|
||||
tinspector -shape b2
|
||||
|
||||
tinspector -activate shapeview -select b1
|
5
tests/tools/shapeview/A2
Normal file
5
tests/tools/shapeview/A2
Normal file
@@ -0,0 +1,5 @@
|
||||
pload ALL INSPECTOR
|
||||
|
||||
tinspector -plugins shapeview
|
||||
|
||||
tinspector -open $env(CSF_OCCTDataPath)/occ/solid.brep shapeview
|
18
tests/tools/vinspector/A1
Normal file
18
tests/tools/vinspector/A1
Normal file
@@ -0,0 +1,18 @@
|
||||
pload ALL INSPECTOR
|
||||
|
||||
tinspector -plugins vinspector
|
||||
|
||||
vinit
|
||||
|
||||
box box_1 0 0 200 100 100 100
|
||||
vdisplay box_1
|
||||
vselmode box_1 1 1
|
||||
vselmode box_1 3 1
|
||||
|
||||
box box_2 180 120 200 150 150 150
|
||||
vdisplay box_2
|
||||
|
||||
vfit
|
||||
|
||||
tinspector -update -select box_1
|
||||
|
9
tests/tools/vinspector/A2
Normal file
9
tests/tools/vinspector/A2
Normal file
@@ -0,0 +1,9 @@
|
||||
pload ALL INSPECTOR
|
||||
|
||||
tinspector -plugins vinspector
|
||||
|
||||
vinit
|
||||
|
||||
tinspector -open $env(CSF_OCCTDataPath)/occ/solid.brep
|
||||
vfit
|
||||
|
118
tests/v3d/bugs/bug25760_2
Normal file
118
tests/v3d/bugs/bug25760_2
Normal file
@@ -0,0 +1,118 @@
|
||||
puts "============"
|
||||
puts "CR25760: Visualization - precision factor added to ZNear, ZFar in method ZFitAll() of Graphic3d_Camera is not enough"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit View1 w=409 h=409
|
||||
vclear
|
||||
|
||||
vclear
|
||||
vautozfit 0
|
||||
|
||||
proc test3d {dstart} {
|
||||
|
||||
set proj1 { 0.47243081629544409 -0.39335870920278265 -0.78871924644244684}
|
||||
set proj2 {-0.31828216872577886 0.17649241059446089 -0.93142197208020105}
|
||||
|
||||
for {set i 1} {$i <= 3} {incr i} {
|
||||
for {set r 1} {$r <= 3} {incr r} {
|
||||
|
||||
set x [expr pow(100, $i)]
|
||||
set y [expr pow( 70, $i)]
|
||||
set z [expr pow( 50, $i)]
|
||||
set dist [expr pow(100, $r)]
|
||||
|
||||
vclear
|
||||
vertex v0 $x $y $z
|
||||
vertex v1 [expr "$x + ($dist * [lindex $proj1 0])"] [expr "$y + ($dist * [lindex $proj1 1])"] [expr "$z + ($dist * [lindex $proj1 2])"]
|
||||
vertex v2 [expr "$x + ($dist * [lindex $proj2 0])"] [expr "$y + ($dist * [lindex $proj2 1])"] [expr "$z + ($dist * [lindex $proj2 2])"]
|
||||
|
||||
for {set d [expr $dstart * {max ($x,$y,$z,$dist)}]} {$d <= 1e7} {set d [expr "abs ($d) * 1.2E5"]} {
|
||||
for {set p 1} {$p <= 2} {incr p} {
|
||||
set proj [set proj$p]
|
||||
|
||||
vremove -all
|
||||
vdisplay v0
|
||||
vdisplay v$p
|
||||
vviewparams -eye [expr "$x - ($d * [lindex $proj 0])"] [expr "$y - ($d * [lindex $proj 1])"] [expr "$z - ($d * [lindex $proj 2])"] -at $x $y $z
|
||||
vzfit
|
||||
|
||||
vremove -all
|
||||
vdisplay v0
|
||||
if { [checkcolor 204 204 1 1 0] != 1 } {
|
||||
puts "Error: 3D projection test failed with the following parameters:"
|
||||
vviewparams
|
||||
vzrange
|
||||
puts ""
|
||||
puts "v1 x: $x"
|
||||
puts "v1 y: $y"
|
||||
puts "v1 z: $z"
|
||||
puts "v2 x: [expr $x + ($dist * [lindex $proj 0])]"
|
||||
puts "v2 y: [expr $y + ($dist * [lindex $proj 1])]"
|
||||
puts "v2 z: [expr $z + ($dist * [lindex $proj 2])]"
|
||||
puts ""
|
||||
return 0
|
||||
}
|
||||
|
||||
vremove -all
|
||||
vdisplay v$p
|
||||
if { [checkcolor 204 204 1 1 0] != 1 } {
|
||||
puts "Error: 3D projection test failed with the following parameters:"
|
||||
vviewparams
|
||||
vzrange
|
||||
puts ""
|
||||
puts "v1 x: $x"
|
||||
puts "v1 y: $y"
|
||||
puts "v1 z: $z"
|
||||
puts "v2 x: [expr $x + ($dist * [lindex $proj 0])]"
|
||||
puts "v2 y: [expr $y + ($dist * [lindex $proj 1])]"
|
||||
puts "v2 z: [expr $z + ($dist * [lindex $proj 2])]"
|
||||
puts ""
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
set tcl_precision 16
|
||||
|
||||
####################################################################
|
||||
# Test orthographic camera without frustum culling. #
|
||||
# Test camera with scale 1E-8 to avoid jittering. #
|
||||
####################################################################
|
||||
vcamera -ortho
|
||||
vviewparams -scale 1e-8
|
||||
vrenderparams -frustumculling off
|
||||
if { [test3d 1e-7] != 1 } { puts "Error: 3D projection test failed: camera is orthographic, view frustum culling is OFF" }
|
||||
|
||||
####################################################################
|
||||
# Test orthographic camera with frustum culling. #
|
||||
# Test camera with scale 1E-8 to avoid jittering. #
|
||||
####################################################################
|
||||
vcamera -ortho
|
||||
vviewparams -scale 1e-8
|
||||
vrenderparams -frustumculling on
|
||||
|
||||
if { [test3d 1e-7] != 1 } {
|
||||
puts "Error: 3D projection test failed: camera is orthographic, view frustum culling is ON"
|
||||
}
|
||||
|
||||
####################################################################
|
||||
# Test perspective camera without frustum culling. #
|
||||
# Test camera with less starting distance 1.0 to avoid jittering. #
|
||||
####################################################################
|
||||
vcamera -persp
|
||||
vrenderparams -frustumculling off
|
||||
if { [test3d 1.0] != 1 } { puts "Error: 3D projection test failed: camera is perspective, view frustum culling is OFF" }
|
||||
|
||||
####################################################################
|
||||
# Test perspective camera with frustum culling. #
|
||||
# Test camera with less starting distance 1.0 to avoid jittering. #
|
||||
####################################################################
|
||||
vcamera -persp
|
||||
vrenderparams -frustumculling on
|
||||
if { [test3d 1.0] != 1 } { puts "Error: 3D projection test failed: camera is perspective, view frustum culling is ON" }
|
50
tests/v3d/bugs/bug25853
Normal file
50
tests/v3d/bugs/bug25853
Normal file
@@ -0,0 +1,50 @@
|
||||
puts "=========="
|
||||
puts "OCC25853: Edges disappear or reappear when displaying new edges"
|
||||
puts "=========="
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit View1 w=1024 h=1024
|
||||
vsetdispmode View1 1
|
||||
vclear
|
||||
|
||||
#vtop
|
||||
set scale 0.086865724500890112
|
||||
set vpprojx 0.0
|
||||
set vpprojy 0.0
|
||||
set vpprojz 1.0
|
||||
set vpupx 0.0
|
||||
set vpupy 1.0
|
||||
set vpupz 0.0
|
||||
set vpatx 4995
|
||||
set vpaty 500
|
||||
set vpatz 0
|
||||
set vpeyex 4995
|
||||
set vpeyey 500
|
||||
set vpeyez 0.0001
|
||||
vviewparams -scale $scale -eye $vpeyex $vpeyey $vpeyez -at $vpatx $vpaty $vpatz -up $vpupx $vpupy $vpupz -proj $vpprojx $vpprojy $vpprojz
|
||||
|
||||
set NB 1000
|
||||
|
||||
proc draw_lines {{distance 10.0}} {
|
||||
# set colors to corner spheres
|
||||
for {set i 0} {$i < $::NB} {incr i} {
|
||||
set x [expr $i * $distance]
|
||||
set ya 0.0
|
||||
set yb 1000.0
|
||||
set z 0.0
|
||||
vertex v1 $x $ya $z
|
||||
vertex v2 $x $yb $z
|
||||
edge e$i v1 v2
|
||||
vdisplay -update e$i
|
||||
puts "$i: $x $ya $yb $z"
|
||||
}
|
||||
}
|
||||
|
||||
puts "Start test lines"
|
||||
draw_lines 10.0
|
||||
|
||||
checkcolor 804 483 1 0 0
|
||||
checkcolor 860 500 1 0 0
|
||||
|
||||
vdump $imagedir/${casename}.png
|
43
tests/v3d/bugs/bug30434
Normal file
43
tests/v3d/bugs/bug30434
Normal file
@@ -0,0 +1,43 @@
|
||||
puts "============="
|
||||
puts "0030434: Visualization, TKV3d - add 'NoUpdate' state of frustum culling optimization"
|
||||
puts "============="
|
||||
|
||||
pload VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
|
||||
set THE_NB_POINTS 10
|
||||
puts "Creating [expr $THE_NB_POINTS * $THE_NB_POINTS * $THE_NB_POINTS] points..."
|
||||
for {set i 0} {$i < $THE_NB_POINTS} {incr i} {
|
||||
for {set j 0} {$j < $THE_NB_POINTS} {incr j} {
|
||||
for {set k 0} {$k < $THE_NB_POINTS} {incr k} {
|
||||
vpoint p$i$j$k 3.*$i 3.*$j 3.*$k
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vcamera -ortho
|
||||
vfront
|
||||
vfit
|
||||
vzoom 2
|
||||
vrenderparams -frustumculling on
|
||||
vrenderparams -frustumculling noupdate
|
||||
vfit
|
||||
if { [vreadpixel 92 92 rgb name] == "YELLOW" } { puts "Error: point should be clipped earlier" }
|
||||
vdump $::imagedir/${::casename}_ortho_culled.png
|
||||
vrenderparams -frustumculling off
|
||||
if { [vreadpixel 92 92 rgb name] != "YELLOW" } { puts "Error: point should NOT be clipped" }
|
||||
vdump $::imagedir/${::casename}_ortho_all.png
|
||||
|
||||
vcamera -persp
|
||||
vaxo
|
||||
vfit
|
||||
vzoom 3
|
||||
vrenderparams -frustumculling on
|
||||
vrenderparams -frustumculling noupdate
|
||||
vfit
|
||||
if { [vreadpixel 114 92 rgb name] == "YELLOW" } { puts "Error: point should be clipped earlier" }
|
||||
vdump $::imagedir/${::casename}_persp_culled.png
|
||||
vrenderparams -frustumculling off
|
||||
if { [vreadpixel 114 92 rgb name] != "YELLOW" } { puts "Error: point should NOT be clipped" }
|
||||
vdump $::imagedir/${::casename}_persp_all.png
|
32
tests/v3d/bugs/bug30437_1
Normal file
32
tests/v3d/bugs/bug30437_1
Normal file
@@ -0,0 +1,32 @@
|
||||
puts "============="
|
||||
puts "0030437: Visualization, TKV3d - add Draw command to print rendering statistics"
|
||||
puts "============="
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
|
||||
set THE_NB_POINTS 10
|
||||
puts "Creating [expr $THE_NB_POINTS * $THE_NB_POINTS * $THE_NB_POINTS] points..."
|
||||
for {set i 0} {$i < $THE_NB_POINTS} {incr i} {
|
||||
for {set j 0} {$j < $THE_NB_POINTS} {incr j} {
|
||||
for {set k 0} {$k < $THE_NB_POINTS} {incr k} {
|
||||
vpoint p$i$j$k 3.*$i 3.*$j 3.*$k
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vcamera -ortho
|
||||
vfront
|
||||
vfit
|
||||
vzoom 2
|
||||
set aPointsNb_1 [vstatprofiler points]
|
||||
if [expr $aPointsNb_1 != 160] { puts "Error: unexpected number of not culled points 1" }
|
||||
|
||||
vcamera -persp
|
||||
vaxo
|
||||
vfit
|
||||
vzoom 3
|
||||
set aPointsNb_2 [vstatprofiler points]
|
||||
if [expr $aPointsNb_2 != 307] { puts "Error: unexpected number of not culled points 2" }
|
||||
vdump $imagedir/${casename}.png
|
16
tests/v3d/materials/pbr1
Normal file
16
tests/v3d/materials/pbr1
Normal file
@@ -0,0 +1,16 @@
|
||||
# PBR requires OpenGL 3.0+ on macOS
|
||||
pload VISUALIZATION
|
||||
pload OPENGL
|
||||
if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/materials.tcl
|
||||
vlight -change 0 -intensity 5
|
||||
vrenderparams -shadingModel PBR -msaa 0
|
||||
vdump $imagedir/${casename}_default.png
|
||||
|
||||
set aCubeMap [locate_data_file Circus_CubeMap_V.png]
|
||||
vbackground -cubemap $aCubeMap
|
||||
vdump $imagedir/${casename}_env.png
|
||||
|
||||
vbackground -cubemap $aCubeMap -invertedz
|
||||
vdump $imagedir/${casename}_env_iz.png
|
25
tests/v3d/memory/bug172
Normal file
25
tests/v3d/memory/bug172
Normal file
@@ -0,0 +1,25 @@
|
||||
puts "========"
|
||||
puts "OCC172"
|
||||
puts "========"
|
||||
|
||||
pload XDE VISUALIZATION QAcommands
|
||||
|
||||
# disable VBO to avoid false memory leaks reported on NVIDIA graphics, see issue #29996
|
||||
pload OPENGL
|
||||
vcaps -vbo 0
|
||||
|
||||
vinit View1
|
||||
restore [locate_data_file OCC162.brep] s
|
||||
vdisplay s
|
||||
|
||||
set listmem {}
|
||||
set i_max 10
|
||||
for {set i 1} {${i} <= ${i_max}} {incr i} {
|
||||
# select shape
|
||||
OCC172
|
||||
# deselect shape
|
||||
OCC172
|
||||
|
||||
lappend listmem [meminfo h]
|
||||
checktrend $listmem 0 1 "Memory leak detected"
|
||||
}
|
26
tests/v3d/memory/bug26538
Normal file
26
tests/v3d/memory/bug26538
Normal file
@@ -0,0 +1,26 @@
|
||||
puts "============"
|
||||
puts "OCC26538: Visualization - Infinite growth of maxtrix stack in OpenGl_Structure::Render"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
box b1 1 1 1
|
||||
box b2 1 1 1
|
||||
|
||||
vclear
|
||||
vinit View1
|
||||
vdisplay b1 b2
|
||||
vsetlocation b2 10 10 10
|
||||
vfit
|
||||
|
||||
set listmem {}
|
||||
set aNbChecks 50
|
||||
for {set anIter 1} {$anIter <= $aNbChecks} {incr anIter} {
|
||||
vfps 100
|
||||
lappend listmem [meminfo h]
|
||||
#checktrend $listmem 0 1 "Memory leak detected"
|
||||
}
|
||||
puts $listmem
|
||||
|
||||
checktrend $listmem 0 1 "Memory leak detected"
|
||||
vdump ${imagedir}/${casename}.png
|
28
tests/v3d/memory/bug29412
Normal file
28
tests/v3d/memory/bug29412
Normal file
@@ -0,0 +1,28 @@
|
||||
puts "# ==================================================================="
|
||||
puts "# 0029412: Huge Memory leak since I upgraded to OC 6.9.0"
|
||||
puts "# ==================================================================="
|
||||
puts ""
|
||||
|
||||
pload VISUALIZATION QAcommands
|
||||
pload OPENGL
|
||||
vcaps -vsync 0
|
||||
vinit View1
|
||||
vglinfo
|
||||
|
||||
OCC29412 100 ;# just to initialize
|
||||
|
||||
meminfo
|
||||
vmemgpu
|
||||
|
||||
set heap_before [meminfo heap]
|
||||
OCC29412
|
||||
set heap_after [meminfo heap]
|
||||
|
||||
meminfo
|
||||
vmemgpu
|
||||
|
||||
# check that memory increase is moderate: can be up to 75 KiB on Debian;
|
||||
# note that the leak in OCCT 6.9.0 - 7.0.0 was ~ 19 MiB
|
||||
if { $heap_after - $heap_before > 100 * 1024 } {
|
||||
puts "Error: memory leak of [expr ($heap_after - $heap_before) / 1024] KiB"
|
||||
}
|
44
tests/v3d/trsf/bug24623_3
Normal file
44
tests/v3d/trsf/bug24623_3
Normal file
@@ -0,0 +1,44 @@
|
||||
puts "============"
|
||||
puts "OCC24623_3: Visualization - improve selection mechanism"
|
||||
puts "Tests memory leaks in creation of selection primitives for connected interactive objects:"
|
||||
puts "checks that there is no 'dead links' in removing Select3D_BVHPrimitiveContent"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
psphere s 0.5
|
||||
tclean s
|
||||
incmesh s 0.001
|
||||
trinfo s
|
||||
|
||||
set aMemInit [meminfo h]
|
||||
set aNb 1000
|
||||
|
||||
# display as copies
|
||||
eval compound [lrepeat $aNb s] ss
|
||||
explode ss
|
||||
for {set i 1} {$i <= $aNb} {incr i} { vloadselection ss_${i}; vsetlocation -noupdate ss_${i} ${i} 0 0 }
|
||||
vfit
|
||||
set aMemSel1 [meminfo h]
|
||||
vclear
|
||||
set aMemClear1 [meminfo h]
|
||||
|
||||
# display as connected instances of single presentation
|
||||
vconnectto i_1 0 0 0 s -nodisplay
|
||||
vloadselection i_1
|
||||
for {set i 2} {$i < $aNb} {incr i} { vconnectto i_${i} ${i} 0 0 i_1 -nodisplay; vloadselection i_${i} }
|
||||
set aMemSel2 [meminfo h]
|
||||
vclear
|
||||
set aMemClear2 [meminfo h]
|
||||
|
||||
puts "Initial memory : [expr $aMemInit / (1024 * 1024)] MiB"
|
||||
puts "Compute selection (simple) : [expr $aMemSel1 / (1024 * 1024)] MiB"
|
||||
puts "Clearing (simple) : [expr $aMemClear1 / (1024 * 1024)] MiB"
|
||||
puts "Compute selection (connected): [expr $aMemSel2 / (1024 * 1024)] MiB"
|
||||
puts "Clearing (connected) : [expr $aMemClear2 / (1024 * 1024)] MiB"
|
||||
|
||||
set aRatio [expr $aMemClear2 / double($aMemClear1)]
|
||||
|
||||
# check if the memory difference is greater than 10%
|
||||
if {[expr $aRatio > 1.1]} { puts "Error : TEST FAILED" }
|
||||
vdump $imagedir/${casename}.png
|
37
tests/v3d/trsf/bug24623_4
Normal file
37
tests/v3d/trsf/bug24623_4
Normal file
@@ -0,0 +1,37 @@
|
||||
puts "============"
|
||||
puts "OCC24623_4: Visualization - improve selection mechanism"
|
||||
puts "Tests memory leaks in creation of selection primitives for connected interactive objects:"
|
||||
puts "checks that there is no 'dead links' to reference interactives after its clearing"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
psphere s 0.5
|
||||
tclean s
|
||||
incmesh s 0.001
|
||||
trinfo s
|
||||
vinit
|
||||
vclear
|
||||
|
||||
set aMemInit [meminfo h]
|
||||
set anIterNb 100
|
||||
|
||||
for {set anIterCount 0} {$anIterCount < $anIterNb} {incr anIterCount} {
|
||||
set aNb 11
|
||||
|
||||
vconnectto i_1 0 0 0 s -nodisplay
|
||||
vloadselection i_1
|
||||
for {set i 2} {$i < $aNb} {incr i} { vconnectto i_${i} ${i} 0 0 i_1 -nodisplay; vloadselection i_${i} }
|
||||
vclear
|
||||
}
|
||||
|
||||
set aMemClear [meminfo h]
|
||||
|
||||
puts "Initial memory : [expr $aMemInit / (1024 * 1024)] MiB"
|
||||
puts "Clearing : [expr $aMemClear / (1024 * 1024)] MiB"
|
||||
|
||||
set aRatio [expr $aMemClear / double($aMemInit)]
|
||||
|
||||
# check if the memory difference is greater than 20%
|
||||
if {[expr $aRatio > 1.2]} { puts "Error : TEST FAILED" }
|
||||
vdump $imagedir/${casename}.png
|
50
tests/v3d/trsf/bug25532
Normal file
50
tests/v3d/trsf/bug25532
Normal file
@@ -0,0 +1,50 @@
|
||||
puts "============"
|
||||
puts "OCC25532: Visualization - fix cross-references between AIS_ConnectedInteractive and connected presentation"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
pload OPENGL
|
||||
psphere s 0.5
|
||||
tclean s
|
||||
incmesh s 0.001
|
||||
trinfo s
|
||||
|
||||
vclear
|
||||
vinit View1
|
||||
vaxo
|
||||
vcaps -vbo 0
|
||||
vsetdispmode 1
|
||||
vdefaults -absDefl 1.0
|
||||
vselprops -autoactivate 0
|
||||
|
||||
set aMemInit [meminfo h]
|
||||
set aNb 1000
|
||||
|
||||
# display as copies
|
||||
eval compound [lrepeat $aNb s] ss
|
||||
explode ss
|
||||
for {set i 1} {$i <= $aNb} {incr i} { vdisplay -noupdate ss_${i}; vsetlocation -noupdate ss_${i} ${i} 0 0 }
|
||||
vfit
|
||||
set aMemDisp1 [meminfo h]
|
||||
vclear
|
||||
set aMemClear1 [meminfo h]
|
||||
|
||||
# display as connected instances of single presentation
|
||||
vconnectto i_1 0 0 0 s
|
||||
for {set i 2} {$i < $aNb} {incr i} { vconnectto i_${i} ${i} 0 0 i_1 }
|
||||
set aMemDisp2 [meminfo h]
|
||||
vclear
|
||||
set aMemClear2 [meminfo h]
|
||||
|
||||
puts "Initial memory: [expr $aMemInit / (1024 * 1024)] MiB"
|
||||
puts "Displaying (simple): [expr $aMemDisp1 / (1024 * 1024)] MiB"
|
||||
puts "Clearing (simple): [expr $aMemClear1 / (1024 * 1024)] MiB"
|
||||
puts "Displaying (connected): [expr $aMemDisp2 / (1024 * 1024)] MiB"
|
||||
puts "Clearing (connected): [expr $aMemClear2 / (1024 * 1024)] MiB"
|
||||
|
||||
set aRatio [expr $aMemClear2 / double($aMemClear1)]
|
||||
|
||||
# check if the memory difference is greater than 20%
|
||||
if [expr $aRatio > 1.2] { puts "Error : TEST FAILED" }
|
||||
vdump ${imagedir}/${casename}.png
|
34
tests/vselect/bugs/bug27318
Normal file
34
tests/vselect/bugs/bug27318
Normal file
@@ -0,0 +1,34 @@
|
||||
puts "TODO OCC27318 MacOS: Error : TEST FAILED"
|
||||
|
||||
puts "========"
|
||||
puts "OCC27318: Memory is not released in Select3D_SensitiveSet when destroying AIS_InteractiveContext without removing objects"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
pload VISUALIZATION QAcommands
|
||||
|
||||
# to measure initial memory correctly, open and close interactive context
|
||||
# to load FreeImage
|
||||
vinit
|
||||
vclose
|
||||
set aMemInit [meminfo h]
|
||||
puts "Initial mem: [expr $aMemInit / (1024 * 1024)] MiB ([expr $aMemInit])"
|
||||
|
||||
# create a box and display it in each interactive context. The context is
|
||||
# the only instance that references to the box. Therefore, the box must be
|
||||
# removed completely after each context's closing
|
||||
for {set anIter 0} {$anIter < 300} {incr anIter} {
|
||||
vinit
|
||||
OCC27318
|
||||
vclose
|
||||
}
|
||||
|
||||
set aMemAfter [meminfo h]
|
||||
puts "Memory after closing interactive context several times: [expr $aMemAfter / (1024 * 1024)] MiB ([expr $aMemAfter])"
|
||||
|
||||
set aRatio [expr $aMemAfter / double($aMemInit)]
|
||||
|
||||
# check if the memory difference is greater than 5%
|
||||
if [expr $aRatio > 1.05] {
|
||||
puts "Error : TEST FAILED"
|
||||
}
|
Reference in New Issue
Block a user