1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

Compare commits

..

51 Commits

Author SHA1 Message Date
dpasukhi
f542f0c4ff // reverting removed test cases
The possible reason for removing incorrect 3rd party for new compilers (can be a DE part)
 Draco
 QT
Updated local name and some other compiler real time properties (can be a DE part)
Different drivers for used server's hardware ( not DE part )
2023-02-13 18:06:27 +00:00
akaftasev
86e352849d 0033263: Modeling Algorithms - BRepFilletAPI_MakeFillet doesn't work for current parameters
Do not calculate edge state if there are more than 4 G1 connections for currect vertex.
2023-02-10 15:35:41 +00:00
akaftasev
6d140acb14 0030292: Modeling Algorithms - BRepBndLib should avoid using Poly_Polygon3D when called with useTriangulation set to false
BRepBndLib.cxx : treatment of useTriangulation is modified according to specified behavior of algorithm
BRepTest_CurveCommands.cxx : creation edge from polygon3d is added in Draw command mkedge.
2023-02-06 17:51:52 +00:00
akaftasev
44be123039 0030055: BRepOffset_MakeOffset throws "TopoDS_Vertex hasn't gp_Pnt" in intersection mode
Diagnostic of mixed connectivity of faces along common edge is added.
If algorithm finds such pair of faces, it stops working with special error code.
2023-02-06 14:15:35 +03:00
dpasukhi
47263fa6a3 0033317: Data Exchange, Step Export - Ignoring color attached to the reference shape label
Fixed problem with pure referencing.
  To export reference label to step we convert it to the assembly with one part.
  All attributes attached to the label should be moved to the new part.
  For working with it new map contains only pure reference labels, that converted to the part
  was implemented to the STEPCAFControl_Writer.
Updated code style of the STEPCAFControl_Writer
Improved ability to export labels from different documents
Removed OCCT_Debug macros to print in Trace gravity
2023-02-04 09:18:29 +00:00
mzernova
b0afa94d10 0027848: Visualization - sensitivity of lines is too high
Improved objects sorting by depth.

The sensitivity calculation for the manipulator has been changed.
Now the sensitivity of the elements of the manipulator depends on its size.

Also fixed the problem of erroneous selection of unfilled circles (SelectMgr_Frustum<N>::hasCircleOverlap() function).

Test case vselect/bugs/bug27848 added.
2023-02-04 09:17:58 +00:00
dorlov
c772c6caa4 0030828: Data Exchange - The commands getting shapes from XCAF document should be available in C++
Added two new overloaded methods XCAFDoc_ShapeTool::GetOneShape: one returns TopoDS_Shape from TDF_LabelSequence and the other from a sequence of all top-level shapes which are free
2023-02-02 15:04:50 +00:00
mzernova
53eae1a935 0032570: Visualization, AIS_AnimationObject - define rotation around axis
When using AIS_AnimationObject, linear interpolation is performed from one gp_Trsf transformation to another.
But when an object rotates around a specific axis, the object moves not along a linear trajectory,
but along a circle. Therefore, a separate class AIS_AnimationAxisRotation was created that
allows to animate rotation around a specific axis.

Test case tests/v3d/bugs/bug32570 was added.
2023-02-01 23:26:46 +00:00
dpasukhi
d22b135217 0033307: Data Exchange, Step Import - Crash after reading empty edge loop
Fixed problem with empty edge list in the edge loop, mark as a fail entity in this case
2023-02-01 00:09:26 +00:00
vro
3c7c705d77 0033320: Data Exchange - Reading of a VRML file with a long line fails
Implement rolling back input stream to split on possible logical parts by comma or space.
2023-01-24 22:38:57 +00:00
dorlov
fc72568ba9 0033312: Data Exchange - NULL-dereference in StepToTopoDS_TranslateShell::Init()
The condition "if" was changed to opposite
2023-01-20 03:10:45 +00:00
akaftasev
107b57a955 0033311: Modeling Algorithm - No results of thrusection algorithm
Changed default value of myPercent
2023-01-17 20:47:54 +00:00
oan
8b301eb865 0033315: Mesh - BRepMesh_IncrementalMesh takes forever to finish (ends up with system memory, etc)
Added test case
2023-01-16 22:00:35 +00:00
rodrlyra
1f469e3781 0033305: Coding - BOPTools_PairSelector::Clear method uses "Clear" instead of "clear" on std::vector 2023-01-16 15:22:08 +00:00
akaftasev
ce4d294074 0033306: Modeling Algorithm - Crash in TrimEdge() method
Added condition to not cut the edges by closely located parameters
2023-01-09 21:44:11 +00:00
akaftasev
9f338a00a1 0033298: Modeling Algorithm - Offset operation gives wrong result
Process only those images of the faces, if one if them has anInsideEdges/anInsideVertices and the other is not.
2023-01-03 18:01:14 +00:00
akaftasev
a011359b8a 0033227: Modeling Algorithm - BOPAlgo_BuilderSolid generates incomplete result
Deleted outer loop for shells.
Added additional check of edges orientation for RefineShell().
2023-01-03 18:01:05 +00:00
msv
42e4ae96ae 0033304: Modeling Data - Floating point signal when converting a B-spline curve to analytical form
Protect the static function ConicDefinition from calling sqrt with negative argument.
2023-01-03 18:00:55 +00:00
akaftasev
686926c0a9 0033247: Modeling Algorithm - BOP report small edges problem and produce empty result
Build shifted pcurve for ellipse and circle cases.
2022-12-22 16:20:54 +00:00
akaftasev
a638dd6224 0033265: Modeling Algorithms - Boolean operation hangs on the attached shapes
Added test case.
2022-12-16 14:28:08 +00:00
ifv
961a306dc4 0033244: Modeling Algorithms - Surface-surface intersection produces the double curves
IntAna_QuadQuadGeo.cxx - estimation of angular tolerance is added for case cone-cone

tests/lowalgos/intss/bug33244 - new test case added
2022-12-12 10:27:10 +03:00
ifv
195a068c4f 0030781: Sweep algorithm creates non-planar edges (orig. BOPAlgo_MakerVolume fails to build a solid)
BRepFill/BRepFill_AdvancedEvolved.cxx - estimation of angular tolerance is added in method GetLids()

tests/evolved/voluved/bug30781 - new test added
2022-12-10 14:04:53 +00:00
dpasukhi
669e0dfc17 0033246: Data Exchange, DE Wrapper - Checking license leads to performance problem
ReWork UpdateLoad functionality:
UpdateLoad calls only if provider is found.
UpdateLoad calls only for chosen type of translation (read/write)
Add new method to UpdateLoad all registered nodes.
2022-12-10 14:02:56 +00:00
nunomsil
74cb5673a5 0031919: Modeling Algorithms - General Fuse raises exception on attempt to imprint a contour to a shell
Exception no longer occurs in current version. However, fuzzyvalue should be set to 1 for the result of the operation to make sense (result of common is 1 wire). Test case added
2022-12-07 14:45:36 +00:00
dpasukhi
768f3a4a19 0033235: Configuration - Solving the problem with static building of ExpToCasExe
Added new dependency to ExpToCasExe - CSF_wsock32 (on Win only)
2022-12-04 13:49:06 +03:00
dpasukhi
2a8c5ad46c 0033250: Configuration - Missing Limits header file
Added new include limits to fix build problem
2022-12-04 13:48:24 +03:00
stv
7ea3eff4f8 0033218: Data Exchange - XCAFPrs_Texture not allow to use classes inherited from Image_Texture
Type of field XCAFPrs_Texture::myImageSource was changed from Image_Texture to Handle(Image_Texture)
2022-12-04 13:47:36 +03:00
dpasukhi
c07f4ee70d 0033232: Data Exchange, DE_Wrapper - Implement ability to change global session
Add ability to set/get global session
2022-12-04 13:46:38 +03:00
dpasukhi
6cc679d81c 0033230: Data Exchange, DE Wrapper - Update API to find CAD provider
Moved FindProvider method to public section
Made FindProvider as virtual to make it possible to overwrite.
2022-12-04 13:46:38 +03:00
dpasukhi
62f554bc3f 0033228: Data Exchange, DE Wrapper - Make the document argument of the method Read const handle
Rewrite document argument for DE_Wrapper Read method
2022-12-04 13:46:37 +03:00
sshutina
7eeb5d5fbf 0032965: PMIVis - PMIVis_TOT_Vectorized text regressions
Added the ability to draw a shaded shape in the required group.
2022-12-04 13:44:52 +03:00
oan
9b7f1aea28 0031865: Mesh - triangulation fails with large deflection values due to unhandled Standard_OutOfRange, BRepMesh_PairOfIndex::Append()
Define minimum number of points for specific types of curves like it was done for circular edges.
2022-12-04 13:43:52 +03:00
knosulko
1e96cf65fa 0033156: Modeling Algorithms - Planar face creation problem
BRepLib_MakeFace::BRepLib_MakeFace: deleted degenerative edges from the input wire;
add test tests\mkface\mkplane\bug33156.
2022-12-04 13:42:28 +03:00
ddzama
03275c0be1 0022821: Crash with BRepFilletAPI_MakeFillet
test bugs modalg_7 bug22821 failed on fillet shape with 5-th edge.
Experimentally has been found that reducing of parameter
ChFi3d_Builder::tolesp for this task solves the issue.

So, as soluton it is proposed to link parameter toleps with parameter range of
spine curve. So, production coefficient has been set to pass all tests and
2 teset was extended: tests/blend/complex/A6, tests/bugs/modalg_7/bug22821

first has been extended to test different scaling factors,
second has been extended to make fillet on all edges from 12.

Additionally:
 - fixed misusage of tolesp in contexts where tolerance of point in 3d is excepted;
     In some context usage of tol_esp is irrelevant, because its essentiality - tolerance of the parameter on the 3d curve.
     So, in such context it has been replaced with new parameter tol3d (with fix value 1.0e-4).
     Get rid of tolapp3d duplication constant - tol_3d
 - tolesp = 5.0e-5 * (umax - umin)
 - tolesp replaced by tolpoint2d/tolpoint3d in several classes.
     Blend_Walking
     BRepBlend_SurfRstLineBuilder
     BRepBlend_RstRstLineBuilder
     Blend_CSWalking
     Instead `tolesp` - `tolgui` is employed in contexts where tolerance of guide curve parameter is excepted.
     Instead `tolesp` - `tolpoint2d` or `tolpoint3d` is employed in contexts where tolerance of point in 2d or 3d space is excepted.
 - Replace tolesp with tolpoint2d/tolpoint3d in BBPP function argument.
 - Use tolapp3d instead tolesp in BonVoisin function,
2022-12-04 13:41:29 +03:00
ddzama
2f33e34038 0032934: Modelling Algorithms - BRepExtrema_DistShapeShape returns two solutions instead of one
distmini of two edges returns two solution points instead one.
Second unneeded solution point is the same as first.

The problem was in fact that second edge has continuity C0.
In this case additional extremas analysis performed in special procedure

PERFORM_C0

And second point found in this procedure.
Folowing code of

BRepExtrema_DistanceSS::Perform (variant for Edge/Edge)

we should this additional solution extremas set
to be object of test TRI_SOLUTION before pushing
into main list of solution.
This solves the problem.
Corresponding test and compound with edges has been created.

Additionally, in the function

PERFORM_C0

an obvious error has fixed.
2022-12-04 13:39:35 +03:00
akaftasev
3eb891ec49 0033180: We had a problem calling the OCC library at the customer site, and the program crashed
Added status for thrusection operations and changed throw constructions to set of the status and break the function.
2022-12-04 13:35:24 +03:00
smoskvin
057dcfddf7 0033225: Changing the status of tests on Ubuntu 20.04 and Windows 64 VC142 2022-11-28 00:04:06 +03:00
atereshi
3837b3bf28 0033217: DRAW - Missed Standard_EXPORT attribute in DrawTrSurf_Set* functions 2022-11-25 13:03:27 +03:00
gelin
db2bfd1e83 0032818: Modeling Algorithms - Result of sweep operation is invalid
BRepFill_TrimShellCorner.cxx - setting correct orientation for NewEdge
tests/pipe/bugs/bug32818 - new test case added
2022-11-21 20:13:47 +03:00
ika
a855215141 0030256: ACIS Import - crash while importing SAT file on constructing a pipe
Fix for thin section with both first and last parameters located in one segment.
2022-11-21 20:11:13 +03:00
ifv
195aac3a42 0033193: Modeling Algorithms - Regression: UnifySameDomain raises SIGSEGV
ShapeUpgrade_UnifySameDomain.cxx - method ReconstructMissedSeam is improved.

tests/bugs/heal/bug33193 - new test case added
2022-11-21 20:10:06 +03:00
atereshi
f706dd34b3 0027122: Data Exchange - invalid shapes are produced during model translation due to huge face tolerance
Problem: The shape has two faces that dimensions are less than tolerance in the specified STEP file. This situation produces the invalid shape.
Change: Shape process has operator FixFaceSize, that is exactly suitable for this shape. The only option of FixFaceSize operator was added to InterfaceStatic, to manage the operator from DRAW command.
Result: The shape without artifacts can be reproduced from STEP file with an extra healing procedure.
2022-11-21 20:06:04 +03:00
ifv
c325231de6 0033179: Modeling Algorithms - Crash in ShapeFix_Shape with the attached object, when healing for fixing SameParameterFlag
BSplCLib_2.cxx - method MergeBSplineKnots is modified in order to have always not empty result.
Geom2dConvert.cxx - in static function MultNumandDenom tolerance for comparing knots is decreased.

tests/bugs/modalg_8/bug33179 test case added
2022-11-21 20:03:35 +03:00
ifv
91a2f58f8f 0026441: Modeling Algorithms - BRepOffset_MakeOffset affects original shape
BRepOffset_MakeOffset.cxx - tolerance control for building planar faces is implemented,
                            updating tolerance for initial entities is avoided

BRepAlgo_Loop.cxx - "total" setting tolerance 0.001 is removing

BRepLib.cxx - checking of "locked" for vertex is removing in static function UpdShTol

QABugs_20.cxx - add new command OCC26441 for checking tolerance differenses between two "identical" shapes

tests/bugs/modalg_7/bug30054 - case now is "BAD", because really result shape is invalid: many faces has not closed wires with huge gaps between ends of edges. Result was "OK" only because tolerances of vertices were increased by algorithm to cover all gaps.

tests/bugs/modalg_8/bug26441 - new test case added

Other test: B3, C8, A7, C8: they were "BAD" and now are "BAD", only some problems are changed.
2022-11-21 20:00:23 +03:00
ifv
8175a70c4e 0033173: Modeling Algorithms - Regression in BRepExtrema_DistShapeShape causing Standard_OutOfRange exception
Extrema/Extrema_ExtCC.cxx - checking number of solutions is added

tests/bugs/modalg_8/bug33173 - test case added
2022-11-21 19:57:45 +03:00
atereshi
f9990707fe 0033187: Modeling Algorithms - Crash in postprocessing of imported shape
Problem: Desynchronization of behaviors of GeomAdaptor_Curve::NbIntervals and
 GeomAdaptor_Curve::Intervals functions. First calculates number of intervals, then
 array is created and second fills the array. In some cases the size of array
 is less than need for filling.

Change:
1. Added function BSplCLib::Intervals that calculates number of interval and fills
 the array with its (if needed).
2. Simplified the algorithm of intervals calculation.
3. GeomAdaptor_Curve::NbIntervals/Intervals and Geom2dAdaptor_Curve::NbIntervals/Intervals
 use BSplCLib::Intervals.
4. When creating an adapter for the base curve, the boundaries of the adapter for the offset curve are applied.
5. Test for problem shape was created: bugs modalg_8 bug33187.

Result: The new approach eliminates the problem of writing outside the array bounds.
2022-11-21 19:53:59 +03:00
knosulko
aba5c241c6 0033144: Modeling Algorithms - Wrong result of Shape Proximity
Added step of refinement the coarser of the two shapes meshes to produce two meshes with approximately the same density.
Added tests lowalgos/proximity.

Fixed accounting of parameters to adjust number of initial sample points
2022-11-21 19:50:40 +03:00
ifv
cc164fd7dc 0033170: Modeling Algorithms - Checking for canonical geometry: plane detection problems
GeomLib_IsPlanarSurface.cxx - using poles for checking BSpline, Bezier curves and surface changed
                              on checking by curve, surface points.

BRepOffset_MakeOffset.cxx - set normal of plane surface according to normal of initial face surface

tests/cr/bugs/bug33170 - new test case added
2022-11-21 19:44:10 +03:00
ona
d7d89acb39 0032977: OCC V7.5, V7.6 cannot read STEP color correctly for the root label, but v6.8 can
- color overriding mechanism is implemented for assembles, parts and instances
2022-11-21 19:41:08 +03:00
Eugeny Maltchikov
d444cc35c6 0033171: Modeling Algorithms - Invalid result of faces unification
Avoid unification of the faces belonging to the different shells.
2022-11-21 19:38:22 +03:00
smoskvin
eeba62cbd3 Increment OCCT version up to 7.8.0dev 2022-11-12 01:20:10 +03:00
94 changed files with 1839 additions and 557 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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}
~~~~

View File

@@ -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"

View File

@@ -62,7 +62,6 @@
#include <IntTools_SequenceOfCurves.hxx>
#include <IntTools_SequenceOfPntOn2Faces.hxx>
#include <IntTools_Tools.hxx>
#include <NCollection_IncAllocator.hxx>
#include <NCollection_Vector.hxx>
#include <Precision.hxx>
#include <TColStd_ListOfInteger.hxx>
@@ -579,12 +578,14 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
Standard_Integer i, nF1, nF2, aNbC, aNbP, j;
Standard_Integer nV1, nV2;
Standard_Real aT1, aT2;
Handle(NCollection_BaseAllocator) aAllocator = new NCollection_IncAllocator;
Handle(NCollection_BaseAllocator) aAllocator;
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
TopoDS_Edge aES;
Handle(BOPDS_PaveBlock) aPBOut;
//
//-----------------------------------------------------scope f
aAllocator=
NCollection_BaseAllocator::CommonBaseAllocator();
//
TColStd_ListOfInteger aLSE(aAllocator), aLBV(aAllocator);
TColStd_MapOfInteger aMVOnIn(100, aAllocator), aMVCommon(100, aAllocator),

View File

@@ -322,8 +322,7 @@ Standard_Boolean IGESCAFControl_Reader::Transfer (const Handle(TDocStd_Document)
//Checks that current entity is a subfigure
Handle(IGESBasic_SubfigureDef) aSubfigure = Handle(IGESBasic_SubfigureDef)::DownCast (ent);
if (GetNameMode() && !aSubfigure.IsNull() && !aSubfigure->Name().IsNull() &&
STool->Search(S, L, Standard_True, Standard_True))
if (GetNameMode() && !aSubfigure.IsNull() && STool->Search (S, L, Standard_True, Standard_True))
{
//In this case we attach subfigure name to the label, instead of default "COMPOUND"
Handle(TCollection_HAsciiString) aName = aSubfigure->Name();

View File

@@ -633,55 +633,34 @@ Standard_Boolean IGESData_ParamReader::ReadXYZ
//=======================================================================
//function : ReadText
//purpose :
//purpose :
//=======================================================================
Standard_Boolean IGESData_ParamReader::ReadText(const IGESData_ParamCursor& thePC,
const Message_Msg& theMsg,
Handle(TCollection_HAsciiString)& theVal)
Standard_Boolean IGESData_ParamReader::ReadText
(const IGESData_ParamCursor& PC, const Message_Msg& amsg,
Handle(TCollection_HAsciiString)& val)
{
if (!PrepareRead(thePC, Standard_False))
{
return Standard_False;
}
const Interface_FileParameter& aFP = theparams->Value(theindex + thebase);
if (aFP.ParamType() != Interface_ParamText)
{
theVal = new TCollection_HAsciiString("");
if (aFP.ParamType() == Interface_ParamVoid)
{
if (!PrepareRead(PC,Standard_False)) return Standard_False;
const Interface_FileParameter& FP = theparams->Value(theindex+thebase);
if (FP.ParamType() != Interface_ParamText) {
if (FP.ParamType() == Interface_ParamVoid) {
val = new TCollection_HAsciiString("");
return Standard_True;
}
SendFail(theMsg);
SendFail (amsg);
return Standard_False;
}
const Handle(TCollection_HAsciiString) aBaseValue = new TCollection_HAsciiString(aFP.CValue());
const Standard_Integer aBaseLength = aBaseValue->Length();
const Standard_Integer aSymbolLocation = aBaseValue->Location(1, 'H', 1, aBaseLength);
if (aSymbolLocation <= 1 || aSymbolLocation > aBaseLength)
{
theVal = new TCollection_HAsciiString("");
SendFail(theMsg);
Handle(TCollection_HAsciiString) tval = new TCollection_HAsciiString (FP.CValue());
Standard_Integer lnt = tval->Length();
Standard_Integer lnh = tval->Location(1,'H',1,lnt);
if (lnh <= 1 || lnh >= lnt) {
SendFail (amsg);
return Standard_False;
} else {
Standard_Integer hol = atoi (tval->SubString(1,lnh-1)->ToCString());
if (hol != (lnt-lnh)) SendWarning (amsg);
}
const TCollection_AsciiString aSpecialSubString = aBaseValue->String().SubString(1, aSymbolLocation - 1);
if (!aSpecialSubString.IsIntegerValue())
{
theVal = new TCollection_HAsciiString("");
SendFail(theMsg);
return Standard_False;
}
Standard_Integer aResLength = aSpecialSubString.IntegerValue();
if (aResLength != (aBaseLength - aSymbolLocation))
{
SendWarning(theMsg);
aResLength = aBaseLength - aSymbolLocation;
}
TCollection_AsciiString aResString;
if (aResLength > 0)
{
aResString = aBaseValue->String().SubString(aSymbolLocation + 1, aBaseLength);
}
theVal = new TCollection_HAsciiString(aResString);
val = new TCollection_HAsciiString(tval->SubString(lnh+1,lnt)->ToCString());
return Standard_True;
}

View File

@@ -200,7 +200,7 @@ public:
//! For Message
Standard_EXPORT Standard_Boolean ReadXYZ (const IGESData_ParamCursor& PC, const Standard_CString mess, gp_XYZ& val);
Standard_EXPORT Standard_Boolean ReadText (const IGESData_ParamCursor& thePC, const Message_Msg& theMsg, Handle(TCollection_HAsciiString)& theVal);
Standard_EXPORT Standard_Boolean ReadText (const IGESData_ParamCursor& PC, const Message_Msg& amsg, Handle(TCollection_HAsciiString)& val);
//! Reads a Text value from parameter "num", as a String from
//! Collection, that is, Hollerith text without leading "nnnH"

View File

@@ -225,14 +225,6 @@ static Resource_KindOfLine WhatKindOfLine(OSD_File& aFile,
aToken2.Clear();
else {
Line.Remove(1,Pos-1);
const Standard_Integer aLineLength = Line.Length();
if (aLineLength >= 2)
{
if (Line.Value(aLineLength - 1) == '\r')
{
Line.Remove(aLineLength - 1);
}
}
Line.Remove(Line.Length());
aToken2 = Line;
}

View File

@@ -4692,16 +4692,9 @@ void collectRepresentationItems(const Interface_Graph& theGraph,
const Handle(StepShape_ShapeRepresentation)& theRepresentation,
NCollection_Sequence<Handle(StepRepr_RepresentationItem)>& theItems)
{
for (StepRepr_HArray1OfRepresentationItem::Iterator anIter(theRepresentation->Items()->Array1());
anIter.More(); anIter.Next())
{
const Handle(StepRepr_RepresentationItem)& anReprItem = anIter.Value();
if (anReprItem.IsNull())
{
continue;
}
theItems.Append(anReprItem);
}
Handle(StepRepr_HArray1OfRepresentationItem) aReprItems = theRepresentation->Items();
for (Standard_Integer itemIt = aReprItems->Lower(); itemIt <= aReprItems->Upper(); itemIt++)
theItems.Append(aReprItems->Value(itemIt));
Interface_EntityIterator entIt = theGraph.TypedSharings(theRepresentation, STANDARD_TYPE(StepRepr_RepresentationRelationship));
for (entIt.Start(); entIt.More(); entIt.Next())

View File

@@ -47,9 +47,7 @@ class TopoDS_Shape;
//! Also supports multifile writing
class STEPCAFControl_Writer
{
public:
DEFINE_STANDARD_ALLOC
public:
//! Creates a writer with an empty

View File

@@ -34,20 +34,20 @@
// Primary definitions
#define OCC_VERSION_MAJOR 7
#define OCC_VERSION_MINOR 7
#define OCC_VERSION_MAINTENANCE 1
#define OCC_VERSION_MINOR 8
#define OCC_VERSION_MAINTENANCE 0
//! This macro must be commented in official release, and set to non-empty
//! string in other situations, to identify specifics of the version, e.g.:
//! - "dev" for development version between releases
//! - "beta..." or "rc..." for beta releases or release candidates
//! - "project..." for version containing project-specific fixes
//#define OCC_VERSION_DEVELOPMENT "dev"
#define OCC_VERSION_DEVELOPMENT "dev"
// Derived (manually): version as real and string (major.minor)
#define OCC_VERSION 7.7
#define OCC_VERSION_STRING "7.7"
#define OCC_VERSION_COMPLETE "7.7.1"
#define OCC_VERSION 7.8
#define OCC_VERSION_STRING "7.8"
#define OCC_VERSION_COMPLETE "7.8.0"
//! Derived: extended version as string ("major.minor.maintenance.dev")
#ifdef OCC_VERSION_DEVELOPMENT

View File

@@ -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
View 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
View 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

View File

@@ -1,3 +1,6 @@
puts "TODO CR23671 Linux: Error"
puts "TODO CR23671 Linux: Draw_Failure: Could not open"
puts "============"
puts "CR23671"
puts "============"

View File

@@ -1,5 +1,3 @@
puts "TODO ?CR33225 Windows: Failed class "
pload QAcommands
QANTestStlIterators

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -1,16 +0,0 @@
puts "============"
puts "0033327: Data Exchange, IGES Import - SubfigureDef can't read string"
puts "============"
pload DCAF
Close D -silent
ReadIges D [locate_data_file "bug33327.igs"]
vclear
vinit View1
XDisplay -dispMode 1 D
vfit
vdump "$imagedir/${casename}_src.png"
Close D

18
tests/bugs/mesh/bug32424 Normal file
View 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

View File

@@ -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
#######################################################################

View File

@@ -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"

View 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"
}

View File

@@ -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

View File

@@ -1,5 +1,3 @@
puts "TODO ?CR33225 Windows: extra characters after close-quote "
puts "========"
puts "OCC29293"
puts "========"

View 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

View File

@@ -1,15 +0,0 @@
puts "============"
puts "0033264: Modeling Algorithms - Result of section operation is incomplete"
puts "============"
puts ""
restore [locate_data_file bug33264_1.brep] srf1
restore [locate_data_file bug33264_2.brep] srf2
bsection res srf1 srf2
checknbshapes res -vertex 44 -edge 43
checkprops res -l 51.3377
checksection res
checkview -display res -2d -path ${imagedir}/${test_image}.png

View File

@@ -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

View File

@@ -1,14 +0,0 @@
puts "===================================="
puts "0033331: Data Exchange, Step Import - Unsupported Representation Items"
puts "===================================="
puts ""
pload DCAF
catch {Close D}
param "read.stepcaf.subshapes.name" 1
ReadStep D [locate_data_file bug33331.stp]
param "read.stepcaf.subshapes.name" 0
Close D

View File

@@ -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

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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

View 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

View File

@@ -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

View 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

View 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" }

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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
}

View File

@@ -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
View File

@@ -0,0 +1,3 @@
if { [array get Draw_Groups "TOOLS Check commands"] == "" } {
pload TOOLS
}

12
tests/tools/dfbrowser/A1 Normal file
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View File

@@ -0,0 +1,2 @@
# to end a test script
puts "TEST COMPLETED"

3
tests/tools/grids.list Normal file
View File

@@ -0,0 +1,3 @@
001 dfbrowser
001 shapeview
001 vinspector

3
tests/tools/parse.rules Normal file
View 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
View 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
View 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
View 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

View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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

View 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"
}