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

Compare commits

..

33 Commits

Author SHA1 Message Date
ichesnok
b936aa6ed1 0033660: Data Exchange, Step Import - Adding product attributes to metadata
Attributes of product was added to metadata.
2024-04-01 16:05:25 +01:00
nunosilva
96a4eafb75 quickfix for AR-8012 2024-03-20 15:08:32 +00:00
anv
91a32b3f31 0033616: Application Framework - Using filter while reading XBF may result in unresolved links
- Added tracking of unresolved links for TreeNodes;
- Test case added.
2024-03-08 16:55:07 +00:00
ichesnok
526c883afe 0033530: Data Exchange, Step Import - Implement GENERAL_PROPERTY support
The necessary classes for GeneralProperty support were added.
The ReadMetadata method was created for reading and saving attributes.
2024-03-08 16:25:13 +00:00
oan
c86ede0e57 Remove pause from build scripts 2024-02-01 13:08:32 +00:00
oan
47710c3050 Enable Rapidjson 2024-01-19 10:47:34 +00:00
ichesnok
c950f7fe0e 0033491: Data Exchange, Step Import - Incorrect import of ComplexTriangulatedFace
Reading and writing of triangle_strips and triangle_fans has been corrected in RWStepVisual_RWComplexTriangulatedFace.cxx file. And corresponding corrections have been added to other files.
2024-01-11 16:41:00 +00:00
oan
f11043a8e8 0033567: Modeling Data - GeomLib_IsPlanarSurface raises exception SIGFPE Arithmetic Exception in Release mode
Add protection against zero-division
2024-01-08 15:06:35 +00:00
oan
beb4a7cfab 0033560: PARASOLID Import - XT importer raises exception SIGFPE Arithmetic Exception
Prevent division by zero in exceptional cases when vector of parameters contains only a single value.
2024-01-03 10:05:42 +00:00
dpasukhi
d9e6701b25 // fixed scaling attribute setting/getting return value 2023-09-08 16:25:50 +01:00
dpasukhi
359d02b15f // implement scale attribute into ShapeTool 2023-09-04 11:10:46 +01:00
ichesnok
124a9bd915 Fix 2023-09-04 11:10:46 +01:00
ichesnok
4556fae98d // fix 2023-09-04 11:10:46 +01:00
dpasukhi
cf85781059 // implemented start and end time code 2023-09-04 11:10:46 +01:00
dpasukhi
ccb708b8d3 // fixed logic problems 2023-09-04 11:10:46 +01:00
dpasukhi
514c451b3a // fixed compilation problem 2023-09-04 11:10:46 +01:00
dpasukhi
ce13c99e9b // completed base animation XCAF getting/setting object
Going to test on CAD format import
2023-09-04 11:10:46 +01:00
dpasukhi
2ffca9595b // Continued expansion of Animation storage functionality
Updated Operation classes to smart pointer classes
First iteration of Animation getting and setting object
First version of XCAF tool to deal with Animation
Implemented new GUID for clear definition of Animation attributes
2023-09-04 11:10:46 +01:00
dpasukhi
5ad8acb354 // implement conversion into/from array2
implement getting typeName
2023-09-04 11:10:46 +01:00
dpasukhi
a0758a8002 0033397: Data Exchange - Implementing support for the Animation storage
Implement basis structure.
Filled basic animation structures.
2023-09-04 11:10:46 +01:00
akaftasev
1e36ce609f 0033449: Modeling Algorithm - Crash in BRepTools_GTrsfModification::NewTriangulation() method
Changed iteration limits from theTriangulation->NbTriangles() to theTriangulation->NbNodes()
Provided modification of the normals only with rotation (gp_GTrsf::Form() == gp_Other  leads to crash)
2023-09-04 11:09:48 +01:00
oan
4e1a6b0b3b 0033436: Data Exchange, DE_Wrapper - DEXCAFCascade_ConfigurationNode::BuildProvider() not initialize provider
Pass pointer to DEXCAFCascade_ConfigurationNode to DEXCAFCascade_Provider;
Remove forcible manual reset of Provider's node in DE_Wrapper::FindProvider() to verify that all specializations of configuration node work properly without necessity of workarounds.
2023-08-07 18:43:38 +01:00
oan
0a15182153 0033250: Configuration - Missing Limits header file
Added new include limits to fix build problem
2023-06-20 22:33:02 +01:00
oan
d1cce26f56 Add option -d to enable Debug mode instead of custom script variable 2023-06-14 00:57:02 +01:00
oan
25b32bc9b5 Unify build scripts for CI/CD without fips 2023-06-13 17:48:49 +01:00
msv
0ed464551e 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.
2022-12-27 22:19:11 +03:00
dpasukhi
9621410faa 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-05 14:36:00 +03:00
dpasukhi
df85ce0635 0033232: Data Exchange, DE_Wrapper - Implement ability to change global session
Add ability to set/get global session
2022-12-02 11:53:37 +03:00
dpasukhi
21efa6d053 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-02 11:53:36 +03:00
dpasukhi
ad13308eb4 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-02 11:53:36 +03:00
msv
41fe9319fd Changes due to relocation of ASRV source code to bitbucket cloud. 2022-11-30 17:19:12 +03:00
msv
364f396a14 Correct wasm_build.sh to support new structure of freetype directory 2022-11-25 10:25:40 +03:00
msv
1b29197cc9 Build customization for ASRV. 2022-11-25 10:25:39 +03:00
406 changed files with 13262 additions and 8284 deletions

31
README-ASRV.txt Normal file
View File

@@ -0,0 +1,31 @@
Instruction for building OCCT for ASRV
======================================
Build using regular native compiler
-----------------------------------
1. Make sure the directory 3rdparty is next to occt. It must contain the following products:
freetype
tcltk
2. Change current directory to adm/scripts.
3. On Windows run the script cmake_gen.bat.
On Linux run 'cmake_gen.sh' for release build and 'cmake_gen.sh -d' for debug build.
4. Go to build directory and build and install OCCT.
On Windows run:
build.bat
build.bat vc14 64 d
install.bat
install.bat vc14 64 d
On Linux run:
make -j4 install
Build using Emscripten to generate libs for Web assembly
--------------------------------------------------------
1. Make sure you have installed Emscripten. For that you can make sure occ-web3d directory
is next to occt. It must contain fips\fips-sdks\emsdk.
2. Make sure the directory 3rdparty is next to occt. It must contain the following products:
freetype wasm build
3. Change current directory to adm/scripts.
4. Run the script wasm_build.bat (wasm_build.sh on Linux).
5. Copy installed files from work/wasm to the 3rdparty under occt77-wasm.

View File

@@ -1,2 +0,0 @@
*custom.bat
*custom.sh

View File

@@ -0,0 +1,50 @@
rem Environment configuration template for cmake_gen.bat (to be renamed as cmake_gen_custom.bat)
set "OCCT3RDPARTY=%SrcRoot%\..\3rdparty"
set VS=14
set VSDATA=2015
rem Leave VSPLATFORM empty to build for x86 platform
set VSPLATFORM=Win64
rem ------------------------------------
rem Uncomment to customize building steps
rem ------------------------------------
rem set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
set "INSTALL_DIR=%SrcRoot%\..\3rdparty\occt77-vc14-64"
set BUILD_CPP_STANDARD=C++14
rem set BUILD_DOC_Overview=OFF
rem set BUILD_Inspector=OFF
rem set BUILD_LIBRARY_TYPE=Shared
rem set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
rem set BUILD_WITH_DEBUG=OFF
rem set BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
rem set BUILD_USE_PCH=OFF
rem set BUILD_FORCE_RelWithDebInfo=OFF
rem Use semicolon-separated list of toolkits if you want to disable all modules
rem and build only some toolkits.
rem set BUILD_ADDITIONAL_TOOLKITS=
rem Set a directory recognized as a patch for OCCT.
rem set BUILD_PATCH=
rem set BUILD_MODULE_ApplicationFramework=ON
rem set BUILD_MODULE_DataExchange=ON
rem set BUILD_MODULE_Draw=ON
rem set BUILD_MODULE_ModelingAlgorithms=ON
rem set BUILD_MODULE_ModelingData=ON
rem set BUILD_MODULE_Visualization=ON
rem set USE_D3D=OFF
rem set USE_FFMPEG=OFF
set USE_FREEIMAGE=ON
rem set USE_GLES2=OFF
set USE_RAPIDJSON=ON
rem set USE_DRACO=OFF
rem set USE_TBB=OFF
rem set USE_VTK=OFF

View File

@@ -0,0 +1,45 @@
# Environment configuration template for cmake_gen.sh (to be renamed as cmake_gen_custom.sh)
OCCT3RDPARTY="$SrcRoot/../3rdparty"
FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
# ------------------------------------
# Uncomment to customize building steps
# ------------------------------------
#BUILD_DIR=build
INSTALL_DIR="$SrcRoot/../3rdparty/occt77"
BUILD_CPP_STANDARD=C++14
#BUILD_DOC_Overview=OFF
#BUILD_Inspector=OFF
#BUILD_LIBRARY_TYPE=Shared
#BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
#BUILD_WITH_DEBUG=OFF
#BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
# Use semicolon-separated list of toolkits if you want to disable all modules
# and build only some toolkits.
#BUILD_ADDITIONAL_TOOLKITS=
# Set a directory recognized as a patch for OCCT.
#BUILD_PATCH=
#BUILD_MODULE_ApplicationFramework=ON
#BUILD_MODULE_DataExchange=ON
#BUILD_MODULE_Draw=ON
#BUILD_MODULE_ModelingAlgorithms=ON
#BUILD_MODULE_ModelingData=ON
#BUILD_MODULE_Visualization=ON
#USE_FFMPEG=OFF
USE_FREEIMAGE=ON
#USE_GLES2=OFF
USE_RAPIDJSON=ON
#USE_DRACO=OFF
#USE_TBB=OFF
#USE_VTK=OFF
# This is to add any additional arguments to cmake
#AUX_ARGS=

View File

@@ -15,6 +15,8 @@ set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
set "OCCT3RDPARTY="
set "INSTALL_DIR=%SrcRoot%\install"
set BUILD_CPP_STANDARD=C++11
set BUILD_ADDITIONAL_TOOLKITS=
set BUILD_DOC_Overview=OFF
set BUILD_Inspector=OFF
@@ -55,6 +57,7 @@ if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"
pushd "%BUILD_DIR%"
cmake -G "%arch_compile%" ^
-D BUILD_CPP_STANDARD:STRING="%BUILD_CPP_STANDARD%" ^
-D 3RDPARTY_DIR:STRING="%OCCT3RDPARTY%" ^
-D BUILD_ADDITIONAL_TOOLKITS:STRING="%BUILD_ADDITIONAL_TOOLKITS%" ^
-D BUILD_DOC_Overview:BOOL=%BUILD_DOC_Overview% ^

View File

@@ -14,12 +14,13 @@ DEB=
CMAKE_BUILD_TYPE=Release
if [ "$1" = "-d" ]; then
DEB=d
BUILD_DIR=${BUILD_DIR}-deb
CMAKE_BUILD_TYPE=Debug
fi
INSTALL_DIR_BIN=lin64/gcc/bin$DEB
INSTALL_DIR_LIB=lin64/gcc/lib$DEB
BUILD_CPP_STANDARD=C++11
BUILD_ADDITIONAL_TOOLKITS=
BUILD_DOC_Overview=OFF
BUILD_Inspector=OFF
@@ -54,6 +55,7 @@ if [ ! -d "$BUILD_DIR" ]; then mkdir -p "$BUILD_DIR"; fi
pushd "$BUILD_DIR"
cmake -G "Unix Makefiles" \
-D BUILD_CPP_STANDARD:STRING="$BUILD_CPP_STANDARD" \
-D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-D 3RDPARTY_DIR:PATH="$OCCT3RDPARTY" \
-D 3RDPARTY_FREETYPE_DIR:PATH="$FREETYPE_DIR" \

View File

@@ -26,6 +26,12 @@ set "toDebug=0"
set "toBuildSample=0"
set "sourceMapBase="
set "aBuildType=Release"
if /I ["%1"] == ["-d"] (
set "toDebug=1"
set "aBuildType=Debug"
)
rem OCCT Modules to build
set "BUILD_ModelingData=ON"
set "BUILD_ModelingAlgorithms=ON"
@@ -44,9 +50,38 @@ rem Archive tool
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
set "aPlatformAndCompiler="
set "aWorkDir="
set "aDestDir="
set "aLogFile="
set "aSrcRootSmpl=%aCasSrc%\samples\webgl"
set "aWorkDirSmpl="
set "aDestDirSmpl="
set "aLogFileSmpl="
rem Configuration file
if exist "%~dp0wasm_custom.bat" call "%~dp0wasm_custom.bat"
set "aBuildTypePrefix="
set "anExtraCxxFlags="
if /I ["%USE_PTHREADS%"] == ["ON"] (
set "anExtraCxxFlags=-pthread"
set "aBuildTypePrefix=%aBuildTypePrefix%-pthread"
)
if ["%toDebug%"] == ["1"] (
set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
)
if ["%aPlatformAndCompiler%"] == [""] ( set "aPlatformAndCompiler=wasm32%aBuildTypePrefix%" )
if ["%aWorkDir%"] == [""] ( set "aWorkDir=%aBuildRoot%\occt-%aPlatformAndCompiler%-make" )
if ["%aDestDir%"] == [""] ( set "aDestDir=%aBuildRoot%\occt-%aPlatformAndCompiler%" )
if ["%aLogFile%"] == [""] ( set "aLogFile=%aBuildRoot%\occt-%aPlatformAndCompiler%-build.log" )
if ["%aWorkDirSmpl%"] == [""] ( set "aWorkDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-make" )
if ["%aDestDirSmpl%"] == [""] ( set "aDestDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%" )
if ["%aLogFileSmpl%"] == [""] ( set "aLogFileSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-build.log" )
call "%EMSDK_ROOT%\emsdk_env.bat"
set "aToolchain=%EMSDK%/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
@@ -58,23 +93,8 @@ for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOP
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
set "aBuildType=Release"
set "aBuildTypePrefix="
set "anExtraCxxFlags="
if /I ["%USE_PTHREADS%"] == ["ON"] (
set "anExtraCxxFlags=-pthread"
set "aBuildTypePrefix=%aBuildTypePrefix%-pthread"
)
if ["%toDebug%"] == ["1"] (
set "aBuildType=Debug"
set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
)
call :cmakeGenerate
if errorlevel 1 (
if not ["%1"] == ["-nopause"] (
pause
)
exit /B 1
goto :eof
)
@@ -108,17 +128,10 @@ if ["%toPack%"] == ["1"] (
"%THE_7Z_PATH%" a -r %THE_7Z_PARAMS% "%aBuildRoot%/%anArchName%.7z" "%aTarget%"
)
if not ["%1"] == ["-nopause"] (
pause
)
goto :eof
:cmakeGenerate
set "aPlatformAndCompiler=wasm32%aBuildTypePrefix%"
set "aWorkDir=%aBuildRoot%\occt-%aPlatformAndCompiler%-make"
set "aDestDir=%aBuildRoot%\occt-%aPlatformAndCompiler%"
set "aLogFile=%aBuildRoot%\occt-%aPlatformAndCompiler%-build.log"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDir%"
@@ -128,10 +141,6 @@ if ["%toCMake%"] == ["1"] (
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
set "aSrcRootSmpl=%aCasSrc%\samples\webgl"
set "aWorkDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-make"
set "aDestDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%"
set "aLogFileSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-build.log"
if ["%toBuildSample%"] == ["1"] (
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
@@ -272,7 +281,6 @@ if ["%toCMake%"] == ["1"] (
if errorlevel 1 (
popd
pause
exit /B
goto :eof
)
@@ -287,7 +295,6 @@ if ["%toMake%"] == ["1"] (
if errorlevel 1 (
type "%aLogFileSmpl%"
popd
pause
exit /B
goto :eof
)
@@ -299,7 +306,6 @@ if ["%toInstall%"] == ["1"] (
if errorlevel 1 (
type "%aLogFileSmpl%"
popd
pause
exit /B
goto :eof
)

View File

@@ -4,6 +4,11 @@
# wasm_custom.sh should be configured with paths to CMake, 3rd-parties and Emscripten SDK.
# FreeType should be specified as mandatory dependency.
CMAKE_BUILD_TYPE=Release
if [ "$1" = "-d" ]; then
CMAKE_BUILD_TYPE=Debug
fi
export aScriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export aSrcRoot="${aScriptDir}/../.."
export aBuildRoot=work
@@ -21,6 +26,12 @@ export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export aPlatformAndCompiler=wasm
export aWorkDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}-make"
export aDestDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}"
export aLogFile="${aSrcRoot}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
if [ -f "${aScriptDir}/wasm_custom.sh" ] ; then
. "${aScriptDir}/wasm_custom.sh"
fi
@@ -33,19 +44,14 @@ export aGitBranch=`git symbolic-ref --short HEAD`
echo "Compilation OCCT branch : $aGitBranch"
export aPlatformAndCompiler=wasm
export aWorkDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}-make"
if [ ! -d "${aWorkDir}" ]; then
mkdir -p "${aWorkDir}"
fi
export aDestDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}"
if [ ! -d "${aDestDir}" ]; then
mkdir -p "${aDestDir}"
fi
export aLogFile="${aSrcRoot}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
if [ -f "${aLogFile}" ]; then
rm "${aLogFile}"
fi
@@ -60,14 +66,14 @@ if [ "${toCMake}" = "1" ]; then
echo "Configuring OCCT for WASM..."
echo cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DCMAKE_BUILD_TYPE:STRING="$CMAKE_BUILD_TYPE" \
-DBUILD_LIBRARY_TYPE:STRING="Static" \
-DINSTALL_DIR:PATH="${aDestDir}" \
-DINSTALL_DIR_INCLUDE:STRING="inc" \
-DINSTALL_DIR_RESOURCE:STRING="src" \
-D3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include/freetype2" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include/freetype2" \
-DBUILD_MODULE_FoundationClasses:BOOL="ON" \
-DBUILD_MODULE_ModelingData:BOOL="${BUILD_ModelingData}" \
-DBUILD_MODULE_ModelingAlgorithms:BOOL="${BUILD_ModelingAlgorithms}" \
@@ -78,14 +84,14 @@ echo cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"
cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DCMAKE_BUILD_TYPE:STRING="$CMAKE_BUILD_TYPE" \
-DBUILD_LIBRARY_TYPE:STRING="Static" \
-DINSTALL_DIR:PATH="${aDestDir}" \
-DINSTALL_DIR_INCLUDE:STRING="inc" \
-DINSTALL_DIR_RESOURCE:STRING="src" \
-D3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include/freetype2" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include/freetype2" \
-DBUILD_MODULE_FoundationClasses:BOOL="ON" \
-DBUILD_MODULE_ModelingData:BOOL="${BUILD_ModelingData}" \
-DBUILD_MODULE_ModelingAlgorithms:BOOL="${BUILD_ModelingAlgorithms}" \

View File

@@ -0,0 +1,30 @@
rem Environment configuration template for wasm_build.bat (to be renamed as wasm_custom.bat)
set "aFreeType=%aCasSrc%\..\3rdparty\freetype-2.7.1-wasm"
set "EMSDK_ROOT=%aCasSrc%\..\emsdk"
rem set "aRapidJson=%aCasSrc%\..\3rdparty\rapidjson-1.1.0"
rem set "aDraco=%aCasSrc%\..\3rdparty\draco-1.4.1-wasm32"
rem set "aCmakeBin=%ProgramW6432%\CMake\bin"
set "aDestDir=%aCasSrc%\..\3rdparty\occt77-wasm"
rem Uncomment to customize building steps
rem set "aBuildRoot=work"
rem set "toCMake=1"
rem set "toClean=0"
rem set "toMake=1"
rem set "toInstall=1"
set "toPack=0"
set "toBuildSample=0"
rem Source map base (should point to server where C++ sources will be copied)
rem enables -g4 debug building option for WebGL sample and allows navigating C++ source code within JavaScript debugger.
rem set "sourceMapBase=http://localhost:9090/"
set "BUILD_ModelingData=OFF"
set "BUILD_ModelingAlgorithms=OFF"
rem set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=OFF"
set "BUILD_DataExchange=OFF"
set "USE_RAPIDJSON=OFF"
set "USE_DRACO=OFF"
set "USE_PTHREADS=OFF"

View File

@@ -0,0 +1,20 @@
# environment configuration template for occ_build_wasm.sh (to be renamed as wasm_custom_env.sh)
export aFreeType="$aSrcRoot/../3rdparty/freetype-2.7.1-wasm"
export EMSDK_ROOT="$aSrcRoot/../emsdk"
export aDestDir="${aSrcRoot}/../3rdparty/occt77-wasm"
# Uncomment to customize building steps
#export aBuildRoot=work
#export toCMake=1
#export toClean=0
#export toMake=1
#export toInstall=1
export BUILD_ModelingData=OFF
export BUILD_ModelingAlgorithms=OFF
#export BUILD_Visualization=ON
export BUILD_ApplicationFramework=OFF
export BUILD_DataExchange=OFF
export aNbJobs=10

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

@@ -1653,6 +1653,13 @@ For each Saved View OCCT STEP Reader will retrieve the following attributes:
- clipping planes (single plane of combination of planes);
- front and back plane clipping.
### User defined attributes
Attributes are implemented in accordance with <a href="https://www.mbx-if.org/documents/rec_prac_user_def_attributes_v18.pdf">Recommended practices for User Defined Attributes</a> section 4, 5, 6.1-6.3 and 7.
Attributes can be read for shapes at levels:
- Part/Product Level;
- Component Instances in an Assembly;
- Geometry Level.
@subsection occt_step_7_3 Writing to STEP
The translation from XDE to STEP can be initialized as follows:
@@ -1730,5 +1737,8 @@ Interface_Static::SetIVal("write.step.schema", 5));
### Saved views
Saved Views are not exported by OCCT.
### User defined attributes
Attributes can be imported from STEP.

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

@@ -1,51 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_AnimationAxisRotation.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_AnimationAxisRotation, AIS_BaseAnimationObject)
//=============================================================================
//function : Constructor
//purpose :
//=============================================================================
AIS_AnimationAxisRotation::AIS_AnimationAxisRotation (const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject,
const gp_Ax1& theAxis,
const Standard_Real theAngleStart,
const Standard_Real theAngleEnd)
: AIS_BaseAnimationObject (theAnimationName, theContext, theObject),
myRotAxis (theAxis),
myAngleStart (theAngleStart),
myAngleEnd (theAngleEnd)
{
//
}
//=============================================================================
//function : update
//purpose :
//=============================================================================
void AIS_AnimationAxisRotation::update (const AIS_AnimationProgress& theProgress)
{
if (myObject.IsNull())
{
return;
}
gp_Trsf aTrsf;
Standard_Real aCurrentAngle = (1.0 - theProgress.LocalNormalized) * myAngleStart + theProgress.LocalNormalized * myAngleEnd;
aTrsf.SetRotation (myRotAxis, aCurrentAngle);
updateTrsf (aTrsf);
}

View File

@@ -1,53 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AIS_AnimationAxisRotation_HeaderFile
#define _AIS_AnimationAxisRotation_HeaderFile
#include <AIS_BaseAnimationObject.hxx>
#include <gp_TrsfNLerp.hxx>
//! Animation defining object transformation.
class AIS_AnimationAxisRotation : public AIS_BaseAnimationObject
{
DEFINE_STANDARD_RTTIEXT(AIS_AnimationAxisRotation, AIS_BaseAnimationObject)
public:
//! Constructor with initialization.
//! @param[in] theAnimationName animation identifier
//! @param[in] theContext interactive context where object have been displayed
//! @param[in] theObject object to apply rotation
//! @param[in] theAxis rotation axis
//! @param[in] theAngleStart rotation angle at the start of animation
//! @param[in] theAngleEnd rotation angle at the end of animation
Standard_EXPORT AIS_AnimationAxisRotation (const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject,
const gp_Ax1& theAxis,
const Standard_Real theAngleStart,
const Standard_Real theAngleEnd);
protected:
//! Update the progress.
Standard_EXPORT virtual void update (const AIS_AnimationProgress& theProgress) Standard_OVERRIDE;
private:
gp_Ax1 myRotAxis; //!< rotation axis
Standard_Real myAngleStart; //!< start angle for rotation
Standard_Real myAngleEnd; //!< end angle for rotation
};
#endif // _AIS_AnimationAxisRotation_HeaderFile

View File

@@ -14,7 +14,10 @@
#include <AIS_AnimationObject.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_BaseAnimationObject)
#include <AIS_InteractiveContext.hxx>
#include <V3d_View.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_Animation)
//=============================================================================
//function : Constructor
@@ -25,7 +28,9 @@ AIS_AnimationObject::AIS_AnimationObject (const TCollection_AsciiString& theAnim
const Handle(AIS_InteractiveObject)& theObject,
const gp_Trsf& theTrsfStart,
const gp_Trsf& theTrsfEnd)
: AIS_BaseAnimationObject (theAnimationName, theContext, theObject),
: AIS_Animation (theAnimationName),
myContext (theContext),
myObject (theObject),
myTrsfLerp (theTrsfStart, theTrsfEnd)
{
//
@@ -44,5 +49,52 @@ void AIS_AnimationObject::update (const AIS_AnimationProgress& theProgress)
gp_Trsf aTrsf;
myTrsfLerp.Interpolate (theProgress.LocalNormalized, aTrsf);
updateTrsf (aTrsf);
if (!myContext.IsNull())
{
myContext->SetLocation (myObject, aTrsf);
invalidateViewer();
}
else
{
myObject->SetLocalTransformation (aTrsf);
}
}
//=============================================================================
//function : invalidateViewer
//purpose :
//=============================================================================
void AIS_AnimationObject::invalidateViewer()
{
if (myContext.IsNull())
{
return;
}
const Standard_Boolean isImmediate = myContext->CurrentViewer()->ZLayerSettings (myObject->ZLayer()).IsImmediate();
if (!isImmediate)
{
myContext->CurrentViewer()->Invalidate();
return;
}
// Invalidate immediate view only if it is going out of z-fit range.
// This might be sub-optimal performing this for each animated objects in case of many animated objects.
for (V3d_ListOfView::Iterator aDefViewIter = myContext->CurrentViewer()->DefinedViewIterator();
aDefViewIter.More(); aDefViewIter.Next())
{
const Handle(V3d_View)& aView = aDefViewIter.Value();
const Bnd_Box aMinMaxBox = aView->View()->MinMaxValues (Standard_False);
const Bnd_Box aGraphicBox = aView->View()->MinMaxValues (Standard_True);
Standard_Real aZNear = 0.0;
Standard_Real aZFar = 0.0;
if (aView->Camera()->ZFitAll (aDefViewIter.Value()->AutoZFitScaleFactor(), aMinMaxBox, aGraphicBox, aZNear, aZFar))
{
if (aZNear < aView->Camera()->ZNear()
|| aZFar > aView->Camera()->ZFar())
{
aDefViewIter.Value()->Invalidate();
}
}
}
}

View File

@@ -15,23 +15,24 @@
#ifndef _AIS_AnimationObject_HeaderFile
#define _AIS_AnimationObject_HeaderFile
#include <AIS_BaseAnimationObject.hxx>
#include <AIS_Animation.hxx>
#include <AIS_InteractiveContext.hxx>
#include <gp_TrsfNLerp.hxx>
//! Animation defining object transformation.
class AIS_AnimationObject : public AIS_BaseAnimationObject
class AIS_AnimationObject : public AIS_Animation
{
DEFINE_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_BaseAnimationObject)
DEFINE_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_Animation)
public:
//! Constructor with initialization.
//! Note that start/end transformations specify exactly local transformation of the object,
//! not the transformation to be applied to existing local transformation.
//! @param[in] theAnimationName animation identifier
//! @param[in] theContext interactive context where object have been displayed
//! @param[in] theObject object to apply local transformation
//! @param[in] theTrsfStart local transformation at the start of animation (e.g. theObject->LocalTransformation())
//! @param[in] theTrsfEnd local transformation at the end of animation
//! @param theAnimationName animation identifier
//! @param theContext interactive context where object have been displayed
//! @param theObject object to apply local transformation
//! @param theTrsfStart local transformation at the start of animation (e.g. theObject->LocalTransformation())
//! @param theTrsfEnd local transformation at the end of animation
Standard_EXPORT AIS_AnimationObject (const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject,
@@ -43,10 +44,17 @@ protected:
//! Update the progress.
Standard_EXPORT virtual void update (const AIS_AnimationProgress& theProgress) Standard_OVERRIDE;
private:
//! Invalidate the viewer for proper update.
Standard_EXPORT void invalidateViewer();
gp_TrsfNLerp myTrsfLerp; //!< interpolation tool
protected:
Handle(AIS_InteractiveContext) myContext; //!< context where object is displayed
Handle(AIS_InteractiveObject) myObject; //!< presentation object to set location
gp_TrsfNLerp myTrsfLerp; //!< interpolation tool
};
DEFINE_STANDARD_HANDLE(AIS_AnimationObject, AIS_Animation)
#endif // _AIS_AnimationObject_HeaderFile

View File

@@ -1,88 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_BaseAnimationObject.hxx>
#include <V3d_View.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_BaseAnimationObject, AIS_Animation)
//=============================================================================
//function : Constructor
//purpose :
//=============================================================================
AIS_BaseAnimationObject::AIS_BaseAnimationObject (const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject)
: AIS_Animation (theAnimationName),
myContext (theContext),
myObject (theObject)
{
//
}
//=============================================================================
//function : updateTrsf
//purpose :
//=============================================================================
void AIS_BaseAnimationObject::updateTrsf (const gp_Trsf& theTrsf)
{
if (!myContext.IsNull())
{
myContext->SetLocation (myObject, theTrsf);
invalidateViewer();
}
else
{
myObject->SetLocalTransformation (theTrsf);
}
}
//=============================================================================
//function : invalidateViewer
//purpose :
//=============================================================================
void AIS_BaseAnimationObject::invalidateViewer()
{
if (myContext.IsNull())
{
return;
}
const Standard_Boolean isImmediate = myContext->CurrentViewer()->ZLayerSettings (myObject->ZLayer()).IsImmediate();
if (!isImmediate)
{
myContext->CurrentViewer()->Invalidate();
return;
}
// Invalidate immediate view only if it is going out of z-fit range.
// This might be sub-optimal performing this for each animated objects in case of many animated objects.
for (V3d_ListOfView::Iterator aDefViewIter = myContext->CurrentViewer()->DefinedViewIterator();
aDefViewIter.More(); aDefViewIter.Next())
{
const Handle(V3d_View)& aView = aDefViewIter.Value();
const Bnd_Box aMinMaxBox = aView->View()->MinMaxValues (Standard_False);
const Bnd_Box aGraphicBox = aView->View()->MinMaxValues (Standard_True);
Standard_Real aZNear = 0.0;
Standard_Real aZFar = 0.0;
if (aView->Camera()->ZFitAll (aDefViewIter.Value()->AutoZFitScaleFactor(), aMinMaxBox, aGraphicBox, aZNear, aZFar))
{
if (aZNear < aView->Camera()->ZNear()
|| aZFar > aView->Camera()->ZFar())
{
aDefViewIter.Value()->Invalidate();
}
}
}
}

View File

@@ -1,49 +0,0 @@
// Copyright (c) 2023 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AIS_BaseAnimationObject_HeaderFile
#define _AIS_BaseAnimationObject_HeaderFile
#include <AIS_Animation.hxx>
#include <AIS_InteractiveContext.hxx>
//! Animation defining object transformation.
class AIS_BaseAnimationObject : public AIS_Animation
{
DEFINE_STANDARD_RTTIEXT(AIS_BaseAnimationObject, AIS_Animation)
protected:
//! Constructor with initialization.
//! @param[in] theAnimationName animation identifier
//! @param[in] theContext interactive context where object have been displayed
//! @param[in] theObject object to apply local transformation
Standard_EXPORT AIS_BaseAnimationObject (const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject);
//! Update the transformation.
Standard_EXPORT void updateTrsf (const gp_Trsf& theTrsf);
private:
//! Invalidate the viewer for proper update.
Standard_EXPORT void invalidateViewer();
protected:
Handle(AIS_InteractiveContext) myContext; //!< context where object is displayed
Handle(AIS_InteractiveObject) myObject; //!< presentation object to set location
};
#endif // _AIS_BaseAnimationObject_HeaderFile

View File

@@ -1116,23 +1116,18 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
const Standard_Integer theMode)
{
//Check mode
const AIS_ManipulatorMode aMode = (AIS_ManipulatorMode) theMode;
AIS_ManipulatorMode aMode = (AIS_ManipulatorMode) theMode;
if (aMode == AIS_MM_None)
{
return;
}
Handle(SelectMgr_EntityOwner) anOwner;
// Sensitivity calculation for manipulator parts allows to avoid
// overlapping of sensitive areas when size of manipulator is small.
// Sensitivity is calculated relative to the default size of the manipulator (100.0f).
const Standard_ShortReal aSensitivityCoef = myAxes[0].Size() / 100.0f;
const Standard_Integer aHighSensitivity = Max (Min (RealToInt (aSensitivityCoef * 15), 15), 3); // clamp sensitivity within range [3, 15]
const Standard_Integer aLowSensitivity = Max (Min (RealToInt (aSensitivityCoef * 10), 10), 2); // clamp sensitivity within range [2, 10]
switch (aMode)
if (aMode == AIS_MM_None)
{
case AIS_MM_Translation:
anOwner = new SelectMgr_EntityOwner (this, 5);
}
if (aMode == AIS_MM_Translation || aMode == AIS_MM_None)
{
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
@@ -1141,21 +1136,23 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
continue;
}
const Axis& anAxis = myAxes[anIt];
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_Translation, 9);
if (aMode != AIS_MM_None)
{
anOwner = new AIS_ManipulatorOwner (this, anIt, AIS_MM_Translation, 9);
}
// define sensitivity by line
Handle(Select3D_SensitiveSegment) aLine = new Select3D_SensitiveSegment(anOwner, gp::Origin(), anAxis.TranslatorTipPosition());
aLine->SetSensitivityFactor (aHighSensitivity);
Handle(Select3D_SensitiveSegment) aLine = new Select3D_SensitiveSegment (anOwner, gp::Origin(), anAxis.TranslatorTipPosition());
aLine->SetSensitivityFactor (15);
theSelection->Add (aLine);
// enlarge sensitivity by triangulation
Handle(Select3D_SensitivePrimitiveArray) aTri = new Select3D_SensitivePrimitiveArray(anOwner);
Handle(Select3D_SensitivePrimitiveArray) aTri = new Select3D_SensitivePrimitiveArray (anOwner);
aTri->InitTriangulation (anAxis.TriangleArray()->Attributes(), anAxis.TriangleArray()->Indices(), TopLoc_Location());
theSelection->Add (aTri);
}
break;
}
case AIS_MM_Rotation:
if (aMode == AIS_MM_Rotation || aMode == AIS_MM_None)
{
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
@@ -1164,20 +1161,22 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
continue;
}
const Axis& anAxis = myAxes[anIt];
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_Rotation, 9);
if (aMode != AIS_MM_None)
{
anOwner = new AIS_ManipulatorOwner (this, anIt, AIS_MM_Rotation, 9);
}
// define sensitivity by circle
const gp_Circ aGeomCircle (gp_Ax2(gp::Origin(), anAxis.ReferenceAxis().Direction()), anAxis.RotatorDiskRadius());
Handle(Select3D_SensitiveCircle) aCircle = new ManipSensCircle(anOwner, aGeomCircle);
aCircle->SetSensitivityFactor (aLowSensitivity);
theSelection->Add(aCircle);
const gp_Circ aGeomCircle (gp_Ax2 (gp::Origin(), anAxis.ReferenceAxis().Direction()), anAxis.RotatorDiskRadius());
Handle(Select3D_SensitiveCircle) aCircle = new ManipSensCircle (anOwner, aGeomCircle);
aCircle->SetSensitivityFactor (15);
theSelection->Add (aCircle);
// enlarge sensitivity by triangulation
Handle(Select3D_SensitiveTriangulation) aTri = new ManipSensTriangulation(anOwner, myAxes[anIt].RotatorDisk().Triangulation(), anAxis.ReferenceAxis().Direction());
Handle(Select3D_SensitiveTriangulation) aTri = new ManipSensTriangulation (anOwner, myAxes[anIt].RotatorDisk().Triangulation(), anAxis.ReferenceAxis().Direction());
theSelection->Add (aTri);
}
break;
}
case AIS_MM_Scaling:
if (aMode == AIS_MM_Scaling || aMode == AIS_MM_None)
{
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
@@ -1185,19 +1184,21 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
{
continue;
}
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_Scaling, 9);
if (aMode != AIS_MM_None)
{
anOwner = new AIS_ManipulatorOwner (this, anIt, AIS_MM_Scaling, 9);
}
// define sensitivity by point
Handle(Select3D_SensitivePoint) aPnt = new Select3D_SensitivePoint(anOwner, myAxes[anIt].ScalerCubePosition());
aPnt->SetSensitivityFactor (aHighSensitivity);
Handle(Select3D_SensitivePoint) aPnt = new Select3D_SensitivePoint (anOwner, myAxes[anIt].ScalerCubePosition());
aPnt->SetSensitivityFactor (15);
theSelection->Add (aPnt);
// enlarge sensitivity by triangulation
Handle(Select3D_SensitiveTriangulation) aTri = new Select3D_SensitiveTriangulation(anOwner, myAxes[anIt].ScalerCube().Triangulation(), TopLoc_Location(), Standard_True);
Handle(Select3D_SensitiveTriangulation) aTri = new Select3D_SensitiveTriangulation (anOwner, myAxes[anIt].ScalerCube().Triangulation(), TopLoc_Location(), Standard_True);
theSelection->Add (aTri);
}
break;
}
case AIS_MM_TranslationPlane:
if (aMode == AIS_MM_TranslationPlane || aMode == AIS_MM_None)
{
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
@@ -1205,33 +1206,28 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
{
continue;
}
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_TranslationPlane, 9);
if (aMode != AIS_MM_None)
{
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_TranslationPlane, 9);
}
// define sensitivity by two crossed lines
Standard_Real aSensitivityOffset = ZoomPersistence() ? aHighSensitivity * (0.5 + M_SQRT2) : 0.0;
gp_Pnt aP1 = myAxes[((anIt + 1) % 3)].TranslatorTipPosition().Translated (myAxes[((anIt + 2) % 3)].ReferenceAxis().Direction().XYZ() * aSensitivityOffset);
gp_Pnt aP2 = myAxes[((anIt + 2) % 3)].TranslatorTipPosition().Translated (myAxes[((anIt + 1) % 3)].ReferenceAxis().Direction().XYZ() * aSensitivityOffset);
gp_Pnt aP1, aP2;
aP1 = myAxes[((anIt + 1) % 3)].TranslatorTipPosition();
aP2 = myAxes[((anIt + 2) % 3)].TranslatorTipPosition();
gp_XYZ aMidP = (aP1.XYZ() + aP2.XYZ()) / 2.0;
gp_XYZ anOrig = aMidP.Normalized().Multiplied (aSensitivityOffset);
Handle(Select3D_SensitiveSegment) aLine1 = new Select3D_SensitiveSegment(anOwner, aP1, aP2);
aLine1->SetSensitivityFactor(aLowSensitivity);
theSelection->Add (aLine1);
Handle(Select3D_SensitiveSegment) aLine2 = new Select3D_SensitiveSegment(anOwner, anOrig, aMidP);
aLine2->SetSensitivityFactor (aLowSensitivity);
theSelection->Add (aLine2);
aLine1->SetSensitivityFactor(10);
theSelection->Add(aLine1);
Handle(Select3D_SensitiveSegment) aLine2 = new Select3D_SensitiveSegment(anOwner, gp::Origin(), aMidP);
aLine2->SetSensitivityFactor(10);
theSelection->Add(aLine2);
// enlarge sensitivity by triangulation
Handle(Select3D_SensitiveTriangulation) aTri = new Select3D_SensitiveTriangulation(anOwner, myAxes[anIt].DraggerSector().Triangulation(), TopLoc_Location(), Standard_True);
theSelection->Add (aTri);
Handle(Select3D_SensitiveTriangulation) aTri = new Select3D_SensitiveTriangulation(anOwner, myAxes[anIt].DraggerSector().Triangulation(), TopLoc_Location(), Standard_True);
theSelection->Add(aTri);
}
break;
}
default:
{
anOwner = new SelectMgr_EntityOwner(this, 5);
break;
}
}
}

View File

@@ -2,8 +2,6 @@ AIS.hxx
AIS_Animation.cxx
AIS_Animation.hxx
AIS_AnimationTimer.hxx
AIS_AnimationAxisRotation.cxx
AIS_AnimationAxisRotation.hxx
AIS_AnimationCamera.cxx
AIS_AnimationCamera.hxx
AIS_AnimationObject.cxx
@@ -14,8 +12,6 @@ AIS_Axis.cxx
AIS_Axis.hxx
AIS_BadEdgeFilter.cxx
AIS_BadEdgeFilter.hxx
AIS_BaseAnimationObject.cxx
AIS_BaseAnimationObject.hxx
AIS_C0RegularityFilter.cxx
AIS_C0RegularityFilter.hxx
AIS_CameraFrustum.cxx

View File

@@ -808,8 +808,11 @@ void Approx_BSplComputeLine::Parameters(const MultiLine& Line,
const Standard_Integer aNbp = lastP - firstP + 1;
// The first parameter should always be zero according to all the logic below,
// so division by any value will give zero anyway, so it should never be scaled
// to avoid case when there is only one parameter in the array thus division by zero happens.
TheParameters(firstP) = 0.0;
if (aNbp == 2) {
TheParameters(firstP) = 0.0;
TheParameters(lastP) = 1.0;
}
else if (Par == Approx_ChordLength || Par == Approx_Centripetal)
@@ -820,7 +823,6 @@ void Approx_BSplComputeLine::Parameters(const MultiLine& Line,
if (nbP3d == 0) mynbP3d = 1;
if (nbP2d == 0) mynbP2d = 1;
TheParameters(firstP) = 0.0;
dist = 0.0;
TColgp_Array1OfPnt tabP(1, mynbP3d);
TColgp_Array1OfPnt tabPP(1, mynbP3d);
@@ -861,10 +863,10 @@ void Approx_BSplComputeLine::Parameters(const MultiLine& Line,
TheParameters(i) = TheParameters(i - 1) + Sqrt(dist);
}
}
for (i = firstP; i <= lastP; i++) TheParameters(i) /= TheParameters(lastP);
for (i = firstP + 1; i <= lastP; i++) TheParameters(i) /= TheParameters(lastP);
}
else {
for (i = firstP; i <= lastP; i++) {
for (i = firstP + 1; i <= lastP; i++) {
TheParameters(i) = (Standard_Real(i) - firstP) /
(Standard_Real(lastP - Standard_Real(firstP)));
}

View File

@@ -248,178 +248,167 @@ void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB)
//
// Build the shells
aItF.Initialize (aLFConnected);
for (i = 1; aItF.More() && !bAllFacesTaken; aItF.Next(), ++i)
{
for (i = 1; aItF.More() && !bAllFacesTaken; aItF.Next(), ++i) {
const TopoDS_Shape& aFF = aItF.Value();
if (!AddedFacesMap.Add(aFF)) {
continue;
}
//
// make a new shell
TopoDS_Shell aShell;
aBB.MakeShell(aShell);
aBB.Add(aShell, aFF);
aMEFP.Clear();
TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEFP);
TopoDS_Shell aShellStart;
aBB.MakeShell(aShellStart);
aBB.Add(aShellStart, aFF);
//
// loop on faces added to Shell;
// add their neighbor faces to Shell and so on
aItS.Initialize(aShell);
for (; aItS.More(); aItS.Next()) {
const TopoDS_Face& aF = (*(TopoDS_Face*)(&aItS.Value()));
Standard_Boolean isBoundary = aBoundaryFaces.Contains (aF);
TopTools_ListOfShape aLShells;
aLShells.Append(aShellStart);
//
TopTools_ListIteratorOfListOfShape aItLShells(aLShells);
for (; aItLShells.More(); aItLShells.Next()) {
TopoDS_Shell& aShell = TopoDS::Shell(aItLShells.ChangeValue());
//
// loop on edges of aF; find a good neighbor face of aF by aE
aExp.Init(aF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aExp.Current()));
aMEFP.Clear();
TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEFP);
//
// loop on faces added to Shell;
// add their neighbor faces to Shell and so on
aItS.Initialize(aShell);
for (; aItS.More(); aItS.Next()) {
const TopoDS_Face& aF = (*(TopoDS_Face*)(&aItS.Value()));
Standard_Boolean isBoundary = aBoundaryFaces.Contains (aF);
//
// proceed only free edges in this shell
if (aMEFP.Contains(aE)) {
const TopTools_ListOfShape& aLFP = aMEFP.FindFromKey(aE);
aNbFP = aLFP.Extent();
if (aNbFP > 1) {
// loop on edges of aF; find a good neighbor face of aF by aE
aExp.Init(aF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aExp.Current()));
//
// proceed only free edges in this shell
if (aMEFP.Contains(aE)) {
const TopTools_ListOfShape& aLFP = aMEFP.FindFromKey(aE);
aNbFP = aLFP.Extent();
if (aNbFP > 1) {
continue;
}
}
// avoid processing of internal edges
anOr = aE.Orientation();
if (anOr == TopAbs_INTERNAL) {
continue;
}
}
// avoid processing of internal edges
anOr = aE.Orientation();
if (anOr == TopAbs_INTERNAL) {
continue;
}
// avoid processing of degenerated edges
if (BRep_Tool::Degenerated(aE)) {
continue;
}
//
// candidate faces list
const TopTools_ListOfShape& aLF = aEFMap.FindFromKey(aE);
aNbLF = aLF.Extent();
if (!aNbLF) {
continue;
}
//
// prepare for selecting the next face
// take only not-processed faces as a candidates
BOPTools_ListOfCoupleOfShape aLCSOff;
//
Standard_Integer aNbWaysInside = 0;
TopoDS_Face aSelF;
TopTools_ListIteratorOfListOfShape aItLF(aLF);
for (; aItLF.More(); aItLF.Next()) {
const TopoDS_Face& aFL = (*(TopoDS_Face*)(&aItLF.Value()));
if (aF.IsSame(aFL) || AddedFacesMap.Contains(aFL)) {
// avoid processing of degenerated edges
if (BRep_Tool::Degenerated(aE)) {
continue;
}
//
// find current edge in the face
if (!BOPTools_AlgoTools::GetEdgeOff(aE, aFL, aEL)) {
// candidate faces list
const TopTools_ListOfShape& aLF = aEFMap.FindFromKey(aE);
aNbLF = aLF.Extent();
if (!aNbLF) {
continue;
}
//
if (isBoundary && !aBoundaryFaces.Contains (aFL))
// prepare for selecting the next face
// take only not-processed faces as a candidates
BOPTools_ListOfCoupleOfShape aLCSOff;
//
Standard_Integer aNbWaysInside = 0;
TopoDS_Face aSelF;
TopTools_ListIteratorOfListOfShape aItLF(aLF);
for (; aItLF.More(); aItLF.Next()) {
const TopoDS_Face& aFL = (*(TopoDS_Face*)(&aItLF.Value()));
if (aF.IsSame(aFL) || AddedFacesMap.Contains(aFL)) {
continue;
}
//
// find current edge in the face
if (!BOPTools_AlgoTools::GetEdgeOff(aE, aFL, aEL)) {
continue;
}
//
if (isBoundary && !aBoundaryFaces.Contains (aFL))
{
++aNbWaysInside;
aSelF = aFL;
}
aCSOff.SetShape1(aEL);
aCSOff.SetShape2(aFL);
aLCSOff.Append(aCSOff);
}//for (; aItLF.More(); aItLF.Next()) {
//
aNbOff = aLCSOff.Extent();
if (!aNbOff){
continue;
}
//
// among all the adjacent faces chose one with the minimal
// angle to the current one
if (!isBoundary || aNbWaysInside != 1)
{
++aNbWaysInside;
aSelF = aFL;
if (aNbOff == 1) {
aSelF = (*(TopoDS_Face*)(&aLCSOff.First().Shape2()));
}
else if (aNbOff > 1) {
BOPTools_AlgoTools::GetFaceOff(aE, aF, aLCSOff, aSelF, aContext);
}
}
aCSOff.SetShape1(aEL);
aCSOff.SetShape2(aFL);
aLCSOff.Append(aCSOff);
}//for (; aItLF.More(); aItLF.Next()) {
//
aNbOff = aLCSOff.Extent();
if (!aNbOff){
continue;
}
//
// among all the adjacent faces chose one with the minimal
// angle to the current one
if (!isBoundary || aNbWaysInside != 1)
{
if (aNbOff == 1) {
aSelF = (*(TopoDS_Face*)(&aLCSOff.First().Shape2()));
//
if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) {
aBB.Add(aShell, aSelF);
TopExp::MapShapesAndAncestors(aSelF, TopAbs_EDGE, TopAbs_FACE, aMEFP);
}
else if (aNbOff > 1) {
BOPTools_AlgoTools::GetFaceOff(aE, aF, aLCSOff, aSelF, aContext);
}
}
//
if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) {
aBB.Add(aShell, aSelF);
TopExp::MapShapesAndAncestors(aSelF, TopAbs_EDGE, TopAbs_FACE, aMEFP);
}
} // for (; aExp.More(); aExp.Next()) {
} // for (; aItS.More(); aItS.Next()) {
//
// split the shell on multi-connected edges
TopTools_ListOfShape aLShSp;
RefineShell(aShell, aMEFP, aLShSp);
//
// collect the not closed shells for further processing
TopTools_ListOfShape aLShNC;
//
TopTools_ListIteratorOfListOfShape aItLShSp(aLShSp);
for (; aItLShSp.More(); aItLShSp.Next()) {
TopoDS_Shell& aShSp = *((TopoDS_Shell*)&aItLShSp.Value());
} // for (; aExp.More(); aExp.Next()) {
} // for (; aItS.More(); aItS.Next()) {
//
if (BRep_Tool::IsClosed(aShSp)) {
aShSp.Closed(Standard_True);
myLoops.Append(aShSp);
// split the shell on multi-connected edges
TopTools_ListOfShape aLShSp;
RefineShell(aShell, aMEFP, aLShSp);
//
// collect the not closed shells for further processing
TopTools_ListOfShape aLShNC;
//
TopTools_ListIteratorOfListOfShape aItLShSp(aLShSp);
for (; aItLShSp.More(); aItLShSp.Next()) {
TopoDS_Shell& aShSp = *((TopoDS_Shell*)&aItLShSp.Value());
//
if (BRep_Tool::IsClosed(aShSp)) {
aShSp.Closed(Standard_True);
myLoops.Append(aShSp);
}
else {
aLShNC.Append(aShSp);
}
}
else {
aLShNC.Append(aShSp);
//
bAllFacesTaken = (AddedFacesMap.Extent() == aNbShapes);
if (bAllFacesTaken) {
break;
}
}
//
bAllFacesTaken = (AddedFacesMap.Extent() == aNbShapes);
if (bAllFacesTaken) {
break;
}
//
if (aLShSp.Extent() == 1) {
// not further processing of not closed shells is needed,
// as it will not bring any new results
continue;
}
//
// remove th faces of not closed shells from the map of processed faces
// and try to rebuild the shells using all not processed faces,
// because faces of one shell might be needed for building the other
TopTools_ListIteratorOfListOfShape aItLShNC(aLShNC);
for (; aItLShNC.More(); aItLShNC.Next())
{
TopoDS_Iterator aItNC(aItLShNC.Value());
for (; aItNC.More(); aItNC.Next())
{
AddedFacesMap.Remove(aItNC.Value());
//
if (aLShSp.Extent() == 1) {
// not further processing of not closed shells is needed,
// as it will not bring any new results
continue;
}
//
Standard_Integer aNbShNC = aLShNC.Extent();
if (aNbShNC == 1) {
// try to complete the shell with other faces
aLShells.Append(aLShNC);
}
else if (aNbShNC > 1) {
// remove th faces of not closed shells from the map of processed faces
// and try to rebuild the shells using all not processed faces,
// because faces of one shell might be needed for building the other
TopTools_ListIteratorOfListOfShape aItLShNC(aLShNC);
for (; aItLShNC.More(); aItLShNC.Next()) {
TopoDS_Iterator aItNC(aItLShNC.Value());
for (; aItNC.More(); aItNC.Next()) {
AddedFacesMap.Remove(aItNC.Value());
}
}
}
}
} // for (; aItF.More(); aItF.Next()) {
}
//=======================================================================
//function : FindShape
//purpose :
//=======================================================================
TopoDS_Shape FindShape (const TopoDS_Shape& theShapeToFind,
const TopoDS_Shape& theShape)
{
TopoDS_Shape aRes;
TopExp_Explorer anExp(theShape, theShapeToFind.ShapeType());
for (; anExp.More(); anExp.Next())
{
const TopoDS_Shape& aShape = anExp.Current();
if (aShape.IsSame(theShapeToFind))
{
aRes = aShape;
break;
}
}
return aRes;
}
//=======================================================================
//function : RefineShell
//purpose :
@@ -445,21 +434,6 @@ void RefineShell(TopoDS_Shell& theShell,
aMEStop.Add(aE);
continue;
}
if (aLF.Extent() == 2)
{
const TopoDS_Face& aF1 = TopoDS::Face(aLF.First());
const TopoDS_Face& aF2 = TopoDS::Face(aLF.Last());
TopoDS_Shape aE1 = FindShape(aE, aF1);
TopoDS_Shape aE2 = FindShape(aE, aF2);
if (aE1.Orientation() == aE2.Orientation())
{
aMEStop.Add(aE);
continue;
}
}
//
// check for internal edges - count faces, in which the edge
// is internal, twice

View File

@@ -60,7 +60,7 @@ public: //! @name public interfaces
//! Clears the indices
void Clear()
{
myPairs.clear();
myPairs.Clear();
}
//! Sorts the indices

View File

@@ -42,14 +42,12 @@
#include <TopTools_SequenceOfShape.hxx>
#include <stdio.h>
//#define OCCT_DEBUG_ALGO
//#define DRAW
#ifdef DRAW
#include <DBRep.hxx>
#pragma comment(lib,"TKDraw")
#endif
#ifdef OCCT_DEBUG_ALGO
Standard_Boolean AffichLoop = Standard_True;
Standard_Boolean AffichLoop = Standard_False;
Standard_Integer NbLoops = 0;
Standard_Integer NbWires = 1;
static char* name = new char[100];
@@ -60,8 +58,7 @@ static char* name = new char[100];
//purpose :
//=======================================================================
BRepAlgo_Loop::BRepAlgo_Loop():
myTolConf (0.001)
BRepAlgo_Loop::BRepAlgo_Loop()
{
}
@@ -188,6 +185,7 @@ static TopoDS_Vertex UpdateClosedEdge(const TopoDS_Edge& E,
Standard_Boolean OnStart = 0, OnEnd = 0;
//// modified by jgv, 13.04.04 for OCC5634 ////
TopExp::Vertices (E,V1,V2);
//Standard_Real Tol = Precision::Confusion();
Standard_Real Tol = BRep_Tool::Tolerance( V1 );
///////////////////////////////////////////////
@@ -429,12 +427,13 @@ static void StoreInMVE (const TopoDS_Face& F,
TopoDS_Edge& E,
TopTools_IndexedDataMapOfShapeListOfShape& MVE,
Standard_Boolean& YaCouture,
TopTools_DataMapOfShapeShape& VerticesForSubstitute,
const Standard_Real theTolConf)
TopTools_DataMapOfShapeShape& VerticesForSubstitute )
{
TopoDS_Vertex V1, V2, V;
TopTools_ListOfShape Empty;
Standard_Real Tol = 0.001; //5.e-05; //5.e-07;
// gp_Pnt P1, P2, P;
gp_Pnt P1, P;
BRep_Builder BB;
for (Standard_Integer iV = 1; iV <= MVE.Extent(); iV++)
@@ -450,7 +449,7 @@ static void StoreInMVE (const TopoDS_Face& F,
{
V1 = TopoDS::Vertex( itl.Value() );
P1 = BRep_Tool::Pnt( V1 );
if (P.IsEqual( P1, theTolConf ) && !V.IsSame(V1))
if (P.IsEqual( P1, Tol ) && !V.IsSame(V1))
{
V.Orientation( V1.Orientation() );
if (VerticesForSubstitute.IsBound( V1 ))
@@ -575,7 +574,7 @@ void BRepAlgo_Loop::Perform()
TopoDS_Edge& E = TopoDS::Edge(itl1.Value());
if (!Emap.Add(E))
continue;
StoreInMVE(myFace,E,MVE,YaCouture,myVerticesForSubstitute, myTolConf);
StoreInMVE(myFace,E,MVE,YaCouture,myVerticesForSubstitute);
}
}
}
@@ -587,7 +586,7 @@ void BRepAlgo_Loop::Perform()
for (itl.Initialize(myConstEdges); itl.More(); itl.Next()) {
TopoDS_Edge& E = TopoDS::Edge(itl.Value());
if (DejaVu.Add(E))
StoreInMVE(myFace,E,MVE,YaCouture,myVerticesForSubstitute, myTolConf);
StoreInMVE(myFace,E,MVE,YaCouture,myVerticesForSubstitute);
}
#ifdef DRAW
@@ -627,42 +626,42 @@ void BRepAlgo_Loop::Perform()
//--------------------------------
RemovePendingEdges(MVE);
if (MVE.Extent() == 0) break;
if (MVE.Extent() == 0) break;
//--------------------------------
// Start edge.
//--------------------------------
EF = CE = TopoDS::Edge(MVE(1).First());
TopExp::Vertices(CE, V1, V2);
TopExp::Vertices(CE,V1,V2);
//--------------------------------
// VF vertex start of new wire
//--------------------------------
if (CE.Orientation() == TopAbs_FORWARD) { CV = VF = V1; }
else { CV = VF = V2; }
if (CE.Orientation() == TopAbs_FORWARD) { CV = VF = V1;}
else { CV = VF = V2;}
if (!MVE.Contains(CV)) continue;
TopTools_ListOfShape& aListEdges = MVE.ChangeFromKey(CV);
for (itl.Initialize(aListEdges); itl.More(); itl.Next()) {
for ( itl.Initialize(aListEdges); itl.More(); itl.Next()) {
if (itl.Value().IsEqual(CE)) {
aListEdges.Remove(itl);
break;
aListEdges.Remove(itl);
break;
}
}
End = Standard_False;
End = Standard_False;
while (!End) {
//-------------------------------
// Construction of a wire.
//-------------------------------
TopExp::Vertices(CE, V1, V2);
TopExp::Vertices(CE,V1,V2);
if (!CV.IsSame(V1)) CV = V1; else CV = V2;
B.Add(NW, CE);
B.Add (NW,CE);
UsedEdges.Add(CE);
if (!MVE.Contains(CV) || MVE.FindFromKey(CV).IsEmpty()) {
End = Standard_True;
}
else {
End = !SelectEdge(myFace, CE, CV, NE, MVE.ChangeFromKey(CV));
End = !SelectEdge(myFace,CE,CV,NE,MVE.ChangeFromKey(CV));
if (!End) {
CE = NE;
if (MVE.FindFromKey(CV).IsEmpty())
@@ -673,41 +672,35 @@ void BRepAlgo_Loop::Perform()
//--------------------------------------------------
// Add new wire to the set of wires
//------------------------------------------------
Standard_Real Tol = 0.001; //5.e-05; //5.e-07;
TopExp_Explorer explo( NW, TopAbs_VERTEX );
for (; explo.More(); explo.Next())
{
const TopoDS_Vertex& aV = TopoDS::Vertex( explo.Current() );
Handle(BRep_TVertex)& TV = *((Handle(BRep_TVertex)*) &(aV).TShape());
TV->Tolerance( Tol );
TV->Modified( Standard_True );
}
for (explo.Init( NW, TopAbs_EDGE ); explo.More(); explo.Next())
{
const TopoDS_Edge& aE = TopoDS::Edge( explo.Current() );
Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &(aE).TShape());
TE->Tolerance( Tol );
TE->Modified( Standard_True );
}
if (VF.IsSame(CV))
if (VF.IsSame(CV) && SamePnt2d(VF,EF,CE,myFace))
{
if (SamePnt2d(VF, EF, CE, myFace))
{
NW.Closed(Standard_True);
myNewWires.Append(NW);
}
else if(BRep_Tool::Tolerance(VF) < myTolConf)
{
BRep_Builder aBB;
aBB.UpdateVertex(VF, myTolConf);
if (SamePnt2d(VF, EF, CE, myFace))
{
NW.Closed(Standard_True);
myNewWires.Append(NW);
}
#ifdef OCCT_DEBUG_ALGO
else
{
std::cout << "BRepAlgo_Loop: Open Wire" << std::endl;
if (AffichLoop)
std::cout << "OpenWire is : NW_" << NbLoops << "_" << NbWires << std::endl;
}
#endif
}
NW.Closed (Standard_True);
myNewWires.Append (NW);
}
#ifdef OCCT_DEBUG_ALGO
else {
std::cout << "BRepAlgo_Loop: Open Wire" << std::endl;
std::cout <<"BRepAlgo_Loop: Open Wire"<<std::endl;
if (AffichLoop)
std::cout << "OpenWire is : NW_" << NbLoops << "_" << NbWires << std::endl;
}
std::cout << "OpenWire is : NW_"<<NbLoops<<"_"<<NbWires<<std::endl;
}
#endif
#ifdef DRAW
if (AffichLoop) {
sprintf(name,"NW_%d_%d",NbLoops,NbWires++);
@@ -784,6 +777,8 @@ void BRepAlgo_Loop::CutEdge (const TopoDS_Edge& E,
VF = TopoDS::Vertex(aLocalV);
aLocalV = VCEI.Oriented(TopAbs_REVERSED);
VL = TopoDS::Vertex(aLocalV);
// VF = TopoDS::Vertex(VCEI.Oriented(TopAbs_FORWARD));
// VL = TopoDS::Vertex(VCEI.Oriented(TopAbs_REVERSED));
}
SV.Prepend(VF);
SV.Append(VL);
@@ -818,9 +813,13 @@ void BRepAlgo_Loop::CutEdge (const TopoDS_Edge& E,
B.Add (NewEdge,aLocalEdge);
aLocalEdge = V2.Oriented(TopAbs_REVERSED);
B.Add (TopoDS::Edge(NewEdge),aLocalEdge);
// B.Add (NewEdge,V1.Oriented(TopAbs_FORWARD));
// B.Add (NewEdge,V2.Oriented(TopAbs_REVERSED));
if (V1.IsSame(VF))
U1 = f;
else
// U1=BRep_Tool::Parameter
// (TopoDS::Vertex(V1.Oriented(TopAbs_INTERNAL)),WE);
{
TopoDS_Shape aLocalV = V1.Oriented(TopAbs_INTERNAL);
U1=BRep_Tool::Parameter(TopoDS::Vertex(aLocalV),WE);
@@ -831,6 +830,8 @@ void BRepAlgo_Loop::CutEdge (const TopoDS_Edge& E,
{
TopoDS_Shape aLocalV = V2.Oriented(TopAbs_INTERNAL);
U2=BRep_Tool::Parameter(TopoDS::Vertex(aLocalV),WE);
// U2=BRep_Tool::Parameter
// (TopoDS::Vertex(V2.Oriented(TopAbs_INTERNAL)),WE);
}
B.Range (TopoDS::Edge(NewEdge),U1,U2);
#ifdef DRAW

View File

@@ -86,17 +86,8 @@ public:
Standard_EXPORT void VerticesForSubstitute (TopTools_DataMapOfShapeShape& VerVerMap);
//! Set maximal tolerance used for comparing distaces between vertices.
void SetTolConf(const Standard_Real theTolConf)
{
myTolConf = theTolConf;
}
//! Get maximal tolerance used for comparing distaces between vertices.
Standard_Real GetTolConf() const
{
return myTolConf;
}
protected:
@@ -117,7 +108,6 @@ private:
TopTools_DataMapOfShapeListOfShape myCutEdges;
TopTools_DataMapOfShapeShape myVerticesForSubstitute;
BRepAlgo_Image myImageVV;
Standard_Real myTolConf;
};

View File

@@ -51,7 +51,7 @@ public:
Standard_EXPORT BRepBlend_CSWalking(const Handle(Adaptor3d_Curve)& Curv, const Handle(Adaptor3d_Surface)& Surf, const Handle(Adaptor3d_TopolTool)& Domain);
Standard_EXPORT void Perform (Blend_CSFunction& F, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real Tol3d, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT void Perform (Blend_CSFunction& F, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT Standard_Boolean Complete (Blend_CSFunction& F, const Standard_Real Pmin);
@@ -80,7 +80,7 @@ private:
Handle(Adaptor3d_Surface) surf;
Handle(Adaptor3d_Curve) curv;
Handle(Adaptor3d_TopolTool) domain;
Standard_Real tolpoint3d;
Standard_Real tolesp;
Standard_Real tolgui;
Standard_Real pasmax;
Standard_Real fleche;

View File

@@ -173,7 +173,7 @@ BRepBlend_RstRstLineBuilder::BRepBlend_RstRstLineBuilder
done(Standard_False), sol(1, 2), surf1(Surf1),
domain1(Domain1), surf2(Surf2),
domain2(Domain2), rst1(Rst1), rst2(Rst2),
tolpoint3d(0.0), tolgui(0.0), pasmax(0.0),
tolesp(0.0), tolgui(0.0), pasmax(0.0),
fleche(0.0), param(0.0), rebrou(Standard_False),
iscomplete(Standard_False), comptra(Standard_False), sens(0.0),
decrochdeb(Blend_NoDecroch), decrochfin(Blend_NoDecroch)
@@ -193,9 +193,9 @@ void BRepBlend_RstRstLineBuilder::Perform(Blend_RstRstFunction& Func,
const Standard_Real Pdep,
const Standard_Real Pmax,
const Standard_Real MaxStep,
const Standard_Real Tol3d,
const Standard_Real TolGuide,
const math_Vector& ParDep,
const Standard_Real Tolesp,
const Standard_Real Fleche,
const Standard_Boolean Appro)
{
@@ -203,7 +203,7 @@ void BRepBlend_RstRstLineBuilder::Perform(Blend_RstRstFunction& Func,
iscomplete = Standard_False;
comptra = Standard_False;
line = new BRepBlend_Line();
tolpoint3d = Tol3d;
tolesp = Abs(Tolesp);
tolgui = Abs(TolGuide);
fleche = Abs(Fleche);
rebrou = Standard_False;
@@ -225,7 +225,7 @@ void BRepBlend_RstRstLineBuilder::Perform(Blend_RstRstFunction& Func,
TopAbs_State siturst1, siturst2;
Blend_DecrochStatus decroch;
math_Vector tolerance(1, 2), infbound(1, 2), supbound(1, 2);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetTolerance(tolerance, tolesp);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld(Func, tolerance, 30);
@@ -258,9 +258,9 @@ void BRepBlend_RstRstLineBuilder::Perform(Blend_RstRstFunction& Func,
U = previousP.ParameterOnC1();
V = previousP.ParameterOnC2();
BRepBlend_Extremity ptf1 (previousP.PointOnC1(),
U, previousP.Parameter(),tolpoint3d);
U, previousP.Parameter(),tolesp);
BRepBlend_Extremity ptf2 (previousP.PointOnC2(),
V, previousP.Parameter(),tolpoint3d);
V, previousP.Parameter(),tolesp);
if (!previousP.IsTangencyPoint()) {
ptf1.SetTangent(previousP.TangentOnC1());
ptf2.SetTangent(previousP.TangentOnC2());
@@ -291,7 +291,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::PerformFirstSection
const Standard_Real Pdep,
const Standard_Real Pmax,
const math_Vector& ParDep,
const Standard_Real Tol3d,
const Standard_Real Tolesp,
const Standard_Real TolGuide,
const Standard_Boolean RecRst1,
const Standard_Boolean RecP1,
@@ -304,7 +304,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::PerformFirstSection
iscomplete = Standard_False;
comptra = Standard_False;
line = new BRepBlend_Line();
tolpoint3d = Tol3d;
tolesp = Abs(Tolesp);
tolgui = Abs(TolGuide);
rebrou = Standard_False;
@@ -327,7 +327,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::PerformFirstSection
wp1 = wp2 = wrst1 = wrst2 = Pmax;
param = Pdep;
Func.Set(param);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetTolerance(tolerance, tolesp);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld(Func, tolerance, 30);
@@ -573,7 +573,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
//IntSurf_Transition Tline, Tarc;
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetTolerance(tolerance, tolesp);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld(Func, tolerance, 30);
@@ -595,14 +595,14 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
if (rsnld.IsDone()) {
rsnld.Root(sol);
Blend_Point bp1;
if(BBPP(param, Func, sol, tolpoint3d, bp1)){
if(BBPP(param, Func, sol, tolesp, bp1)){
Standard_Real dw = 1.e-10;
Func.Set(param + dw);
rsnld.Perform(Func, parinit, infbound, supbound);
if (rsnld.IsDone()) {
rsnld.Root(sol);
Blend_Point bp2;
if(BBPP(param + dw, Func, sol, tolpoint3d, bp2)){
if(BBPP(param + dw, Func, sol, tolesp, bp2)){
tracederiv(Func, bp1, bp2);
}
}
@@ -854,7 +854,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
Arrive = Standard_True;
Extrst1.SetValue(previousP.PointOnC1(),
previousP.ParameterOnC1(),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
MakeExtremity(Extrst2, Standard_False, rst2, sol(2), IsVtxrst2, Vtxrst2);
// Show that end is on Bound.
}
@@ -873,10 +873,10 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
if (Abs(stepw) < tolgui) {
Extrst1.SetValue(previousP.PointOnC1(),
previousP.ParameterOnC1(),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
Extrst2.SetValue(previousP.PointOnC2(),
previousP.ParameterOnC2(),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
Arrive = Standard_True;
#ifdef OCCT_DEBUG
if (line->NbPoints()>=2) {
@@ -913,7 +913,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
Arrive = Standard_True;
Extrst1.SetValue(previousP.PointOnC1(),
previousP.ParameterOnC1(),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
MakeExtremity(Extrst2, Standard_False, rst2, sol(2), IsVtxrst2, Vtxrst2);
// Indicate that end is on Bound.
}
@@ -993,10 +993,10 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
#endif
Extrst1.SetValue(previousP.PointOnC1(),
previousP.ParameterOnC1(),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
Extrst2.SetValue(previousP.PointOnC2(),
previousP.ParameterOnC2(),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
Arrive = Standard_True;
}
break;
@@ -1029,7 +1029,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_RstRstFunction&
Handle(Adaptor3d_HVertex)& Vtx)
{
math_Vector toler(1, 3), infb(1, 3), supb(1, 3);
Finv.GetTolerance(toler, tolpoint3d);
Finv.GetTolerance(toler, tolesp);
Finv.GetBounds(infb, supb);
Solinv(1) = param;
Solinv(2) = sol(2);
@@ -1049,7 +1049,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_RstRstFunction&
// It is necessary to check if the function value meets the
// second restriction
if (Finv.IsSolution(Solinv, tolpoint3d)) {
if (Finv.IsSolution(Solinv, tolesp)) {
Standard_Real w = Solinv(2);
if(w < rst2->FirstParameter() - toler(2)||
w > rst2->LastParameter() + toler(2)){
@@ -1079,7 +1079,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_RstRstFunction&
math_Vector infbound(1, 2), supbound(1, 2);
math_Vector parinit(1, 2), tolerance(1, 2);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetTolerance(tolerance, tolesp);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld2(Func, tolerance, 30);
@@ -1112,7 +1112,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_RstRstFunction&
Handle(Adaptor3d_HVertex)& Vtx)
{
math_Vector toler(1, 3), infb(1, 3), supb(1, 3);
Finv.GetTolerance(toler, tolpoint3d);
Finv.GetTolerance(toler, tolesp);
Finv.GetBounds(infb, supb);
Solinv(1) = param;
Solinv(2) = sol(1);
@@ -1130,7 +1130,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_RstRstFunction&
rsnld.Root(Solinv);
// It is necessary to check the value of the function
if (Finv.IsSolution(Solinv, tolpoint3d)) {
if (Finv.IsSolution(Solinv, tolesp)) {
Standard_Real w = Solinv(2);
if(w < rst1->FirstParameter() - toler(2)||
w > rst1->LastParameter() + toler(2)){
@@ -1159,7 +1159,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_RstRstFunction&
math_Vector infbound(1, 2), supbound(1, 2);
math_Vector parinit(1,2), tolerance(1,2);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetTolerance(tolerance, tolesp);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld2(Func, tolerance, 30);
@@ -1199,7 +1199,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_CurvPointFuncInv&
FinvP.Set(thepoint);
math_Vector toler(1,2), infb(1, 2), supb(1, 2);
FinvP.GetTolerance(toler, tolpoint3d);
FinvP.GetTolerance(toler, tolesp);
FinvP.GetBounds(infb, supb);
Solinv(1) = param;
Solinv(2) = sol(2);
@@ -1214,7 +1214,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_CurvPointFuncInv&
}
rsnld.Root(Solinv);
if(FinvP.IsSolution(Solinv, tolpoint3d)){
if(FinvP.IsSolution(Solinv, tolesp)){
gp_Pnt2d p2drst2 = rst2->Value(Solinv(2));
TopAbs_State situ = domain2->Classify(p2drst2, toler(2), 0);
if ((situ != TopAbs_IN) && (situ != TopAbs_ON)) {
@@ -1267,7 +1267,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_CurvPointFuncInv&
FinvP.Set(thepoint);
math_Vector toler(1,2), infb(1, 2), supb(1, 2);
FinvP.GetTolerance(toler, tolpoint3d);
FinvP.GetTolerance(toler, tolesp);
FinvP.GetBounds(infb, supb);
Solinv(1) = param;
Solinv(2) = sol(1);
@@ -1282,7 +1282,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_CurvPointFuncInv&
}
rsnld.Root(Solinv);
if(FinvP.IsSolution(Solinv, tolpoint3d)){
if(FinvP.IsSolution(Solinv, tolesp)){
gp_Pnt2d p2drst1 = rst1->Value(Solinv(2));
TopAbs_State situ = domain1->Classify(p2drst1, toler(2), 0);
if ((situ != TopAbs_IN) && (situ != TopAbs_ON)) {
@@ -1378,7 +1378,7 @@ void BRepBlend_RstRstLineBuilder::MakeExtremity(BRepBlend_Extremity&
if (OnFirst) {
Extrem.SetValue(previousP.PointOnC1(),
sol(1),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
if (!previousP.IsTangencyPoint())
Extrem.SetTangent(previousP.TangentOnC1());
Iter = domain1;
@@ -1386,7 +1386,7 @@ void BRepBlend_RstRstLineBuilder::MakeExtremity(BRepBlend_Extremity&
else {
Extrem.SetValue(previousP.PointOnC2(),
sol(2),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
if (!previousP.IsTangencyPoint())
Extrem.SetTangent(previousP.TangentOnC1());
Iter = domain2;
@@ -1453,13 +1453,12 @@ Blend_Status BRepBlend_RstRstLineBuilder::CheckDeflectionOnRst1(const Blend_Poin
Norme = Corde.SquareMagnitude();
if (!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
const Standard_Real toler3d = 0.01 * tolpoint3d;
if (Norme <= toler3d * toler3d) {
if (Norme <= tolesp * tolesp) {
// it can be necessary to force the same point
return Blend_SamePoints;
}
if(!prevpointistangent){
if (prevNorme <= toler3d * toler3d) {
if (prevNorme <= tolesp * tolesp) {
return Blend_SamePoints;
}
Cosi = sens * Corde * prevTg;
@@ -1531,13 +1530,12 @@ Blend_Status BRepBlend_RstRstLineBuilder::CheckDeflectionOnRst2(const Blend_Poin
Norme = Corde.SquareMagnitude();
if (!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
const Standard_Real toler3d = 0.01 * tolpoint3d;
if (Norme <= toler3d * toler3d){
if (Norme <= tolesp * tolesp){
// it can be necessary to force the same point
return Blend_SamePoints;
}
if (!prevpointistangent) {
if (prevNorme <= toler3d * toler3d) {
if (prevNorme <= tolesp * tolesp) {
return Blend_SamePoints;
}
Cosi = sens * Corde * prevTg;
@@ -1599,7 +1597,7 @@ Blend_Status BRepBlend_RstRstLineBuilder::TestArret(Blend_RstRstFunction& Func,
IntSurf_TypeTrans trarst1 = IntSurf_Undecided, trarst2 = IntSurf_Undecided;
Blend_Point curpoint;
if (Func.IsSolution(sol, tolpoint3d)) {
if (Func.IsSolution(sol, tolesp)) {
Standard_Boolean curpointistangent = Func.IsTangencyPoint();
ptrst1 = Func.PointOnRst1();
ptrst2 = Func.PointOnRst2();
@@ -1646,7 +1644,7 @@ Blend_Status BRepBlend_RstRstLineBuilder::TestArret(Blend_RstRstFunction& Func,
Standard_Real testra = tg2drst1.Dot(tg2drstref);
TopAbs_Orientation Or = domain1->Orientation(rst1);
if (Abs(testra) > tolpoint3d) {
if (Abs(testra) > tolesp) {
if (testra < 0.) {
trarst1 = ConvOrToTra(TopAbs::Reverse(Or));
}
@@ -1658,7 +1656,7 @@ Blend_Status BRepBlend_RstRstLineBuilder::TestArret(Blend_RstRstFunction& Func,
testra = tg2drst2.Dot(tg2drstref);
Or = domain2->Orientation(rst2);
if (Abs(testra) > tolpoint3d) {
if (Abs(testra) > tolesp) {
if (testra < 0.) {
trarst2 = ConvOrToTra(TopAbs::Reverse(Or));
}
@@ -1707,7 +1705,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::CheckInside(Blend_RstRstFunction&
{
// Standard_Boolean inside = Standard_True;
math_Vector tolerance(1, 2);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetTolerance(tolerance, tolesp);
//face pcurve 1.
Standard_Real v = sol(1);

View File

@@ -72,9 +72,9 @@ public:
Standard_EXPORT BRepBlend_RstRstLineBuilder(const Handle(Adaptor3d_Surface)& Surf1, const Handle(Adaptor2d_Curve2d)& Rst1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_Surface)& Surf2, const Handle(Adaptor2d_Curve2d)& Rst2, const Handle(Adaptor3d_TopolTool)& Domain2);
Standard_EXPORT void Perform (Blend_RstRstFunction& Func, Blend_SurfCurvFuncInv& Finv1, Blend_CurvPointFuncInv& FinvP1, Blend_SurfCurvFuncInv& Finv2, Blend_CurvPointFuncInv& FinvP2, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real Tol3d, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT void Perform (Blend_RstRstFunction& Func, Blend_SurfCurvFuncInv& Finv1, Blend_CurvPointFuncInv& FinvP1, Blend_SurfCurvFuncInv& Finv2, Blend_CurvPointFuncInv& FinvP2, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_RstRstFunction& Func, Blend_SurfCurvFuncInv& Finv1, Blend_CurvPointFuncInv& FinvP1, Blend_SurfCurvFuncInv& Finv2, Blend_CurvPointFuncInv& FinvP2, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& Soldep, const Standard_Real Tol3d, const Standard_Real TolGuide, const Standard_Boolean RecRst1, const Standard_Boolean RecP1, const Standard_Boolean RecRst2, const Standard_Boolean RecP2, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_RstRstFunction& Func, Blend_SurfCurvFuncInv& Finv1, Blend_CurvPointFuncInv& FinvP1, Blend_SurfCurvFuncInv& Finv2, Blend_CurvPointFuncInv& FinvP2, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real TolGuide, const Standard_Boolean RecRst1, const Standard_Boolean RecP1, const Standard_Boolean RecRst2, const Standard_Boolean RecP2, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean Complete (Blend_RstRstFunction& Func, Blend_SurfCurvFuncInv& Finv1, Blend_CurvPointFuncInv& FinvP1, Blend_SurfCurvFuncInv& Finv2, Blend_CurvPointFuncInv& FinvP2, const Standard_Real Pmin);
@@ -134,7 +134,7 @@ private:
Handle(Adaptor3d_TopolTool) domain2;
Handle(Adaptor2d_Curve2d) rst1;
Handle(Adaptor2d_Curve2d) rst2;
Standard_Real tolpoint3d;
Standard_Real tolesp;
Standard_Real tolgui;
Standard_Real pasmax;
Standard_Real fleche;

View File

@@ -210,7 +210,7 @@ BRepBlend_SurfRstLineBuilder::BRepBlend_SurfRstLineBuilder
const Handle(Adaptor3d_TopolTool)& Domain2):
done(Standard_False), sol(1, 3), surf1(Surf1),
domain1(Domain1), surf2(Surf2), rst(Rst),
domain2(Domain2), tolpoint3d(0.0), tolpoint2d(0.0), tolgui(0.0),
domain2(Domain2), tolesp(0.0), tolgui(0.0),
pasmax(0.0), fleche(0.0), param(0.0),
rebrou(Standard_False), iscomplete(Standard_False),
comptra(Standard_False), sens(0.0),
@@ -230,10 +230,9 @@ void BRepBlend_SurfRstLineBuilder::Perform(Blend_SurfRstFunction& Func,
const Standard_Real Pdep,
const Standard_Real Pmax,
const Standard_Real MaxStep,
const Standard_Real Tol3d,
const Standard_Real Tol2d,
const Standard_Real TolGuide,
const math_Vector& ParDep,
const Standard_Real Tolesp,
const Standard_Real Fleche,
const Standard_Boolean Appro)
{
@@ -241,8 +240,7 @@ void BRepBlend_SurfRstLineBuilder::Perform(Blend_SurfRstFunction& Func,
iscomplete = Standard_False;
comptra = Standard_False;
line = new BRepBlend_Line();
tolpoint3d = Tol3d;
tolpoint2d = Tol2d;
tolesp = Abs(Tolesp);
tolgui = Abs(TolGuide);
fleche = Abs(Fleche);
rebrou = Standard_False;
@@ -264,7 +262,7 @@ void BRepBlend_SurfRstLineBuilder::Perform(Blend_SurfRstFunction& Func,
TopAbs_State siturst,situs;
Standard_Boolean decroch;
math_Vector tolerance(1,3),infbound(1,3),supbound(1,3);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetTolerance(tolerance,tolesp);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -298,9 +296,9 @@ void BRepBlend_SurfRstLineBuilder::Perform(Blend_SurfRstFunction& Func,
// W = previousP.ParameterOnC();
BRepBlend_Extremity ptf1(previousP.PointOnS(),
U,V,previousP.Parameter(),tolpoint3d);
U,V,previousP.Parameter(),tolesp);
BRepBlend_Extremity ptf2(previousP.PointOnC(),
U,V,previousP.Parameter(),tolpoint3d);
U,V,previousP.Parameter(),tolesp);
if (!previousP.IsTangencyPoint()) {
ptf1.SetTangent(previousP.TangentOnS());
ptf2.SetTangent(previousP.TangentOnC());
@@ -329,8 +327,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection
const Standard_Real Pdep,
const Standard_Real Pmax,
const math_Vector& ParDep,
const Standard_Real Tol3d,
const Standard_Real Tol2d,
const Standard_Real Tolesp,
const Standard_Real TolGuide,
const Standard_Boolean RecRst,
const Standard_Boolean RecP,
@@ -342,8 +339,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection
iscomplete = Standard_False;
comptra = Standard_False;
line = new BRepBlend_Line();
tolpoint3d = Tol3d;
tolpoint2d = Tol2d;
tolesp = Abs(Tolesp);
tolgui = Abs(TolGuide);
rebrou = Standard_False;
@@ -366,7 +362,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection
wp = wrst = ws = Pmax;
param = Pdep;
Func.Set(param);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetTolerance(tolerance,tolesp);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -540,7 +536,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
//IntSurf_Transition Tline,Tarc;
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetTolerance(tolerance,tolesp);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -562,14 +558,14 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
if (rsnld.IsDone()) {
rsnld.Root(sol);
Blend_Point bp1;
if(BBPP(param,Func,sol,tolpoint3d,bp1)){
if(BBPP(param,Func,sol,tolesp,bp1)){
Standard_Real dw = 1.e-10;
Func.Set(param+dw);
rsnld.Perform(Func,parinit,infbound,supbound);
if (rsnld.IsDone()) {
rsnld.Root(sol);
Blend_Point bp2;
if(BBPP(param+dw,Func,sol,tolpoint3d,bp2)){
if(BBPP(param+dw,Func,sol,tolesp,bp2)){
tracederiv(Func,bp1,bp2);
}
}
@@ -750,7 +746,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
Arrive = Standard_True;
Exts.SetValue(previousP.PointOnS(),
sol(1),sol(2),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
MakeExtremity(Extrst,Standard_False,rst,sol(3),IsVtxrst,Vtxrst);
// Indicate end on Bound.
}
@@ -769,10 +765,10 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
if (Abs(stepw) < tolgui) {
previousP.ParametersOnS(U,V);
Exts.SetValue(previousP.PointOnS(),U,V,
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Extrst.SetValue(previousP.PointOnC(),
previousP.ParameterOnC(),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Arrive = Standard_True;
if (line->NbPoints()>=2) {
// Indicate that one stops during the processing
@@ -808,7 +804,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
if (param == Bound) {
Arrive = Standard_True;
Exts.SetValue(previousP.PointOnS(),sol(1),sol(2),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
MakeExtremity(Extrst,Standard_False,rst,sol(3),IsVtxrst,Vtxrst);
// Indicate end on Bound.
}
@@ -854,7 +850,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
line->Prepend(previousP);
}
Exts.SetValue(previousP.PointOnS(),sol(1),sol(2),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
MakeExtremity(Extrst,Standard_False,rst,sol(3),IsVtxrst,Vtxrst);
Arrive = Standard_True;
}
@@ -887,10 +883,10 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
#endif
previousP.ParametersOnS(U,V);
Exts.SetValue(previousP.PointOnS(),U,V,
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Extrst.SetValue(previousP.PointOnC(),
previousP.ParameterOnC(),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Arrive = Standard_True;
}
break;
@@ -945,10 +941,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
FinvC.Set(Arc);
math_Vector toler(1,3),infb(1,3),supb(1,3);
// use reduced Tol argument value to pass testcase
// blend complex A6 with scale factor of model 0.1 (base scale = 1000)
// So, here we using 1.0e-5 rather than 1.0e-4 of tolerance of point in 3d
FinvC.GetTolerance(toler,0.1 * tolpoint3d);
FinvC.GetTolerance(toler,tolesp);
FinvC.GetBounds(infb,supb);
Solinv(1) = param;
Solinv(2) = sol(3);
@@ -965,7 +958,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
else {
// It is necessary to check the value of the function
rsnld.Root(Solinv);
recadre = FinvC.IsSolution(Solinv,tolpoint3d);
recadre = FinvC.IsSolution(Solinv,tolesp);
}
// In case of fail, it is checked if another arc
@@ -988,7 +981,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
Arc = domain1->Value();
FinvC.Set(Arc);
FinvC.GetTolerance(toler,tolpoint3d);
FinvC.GetTolerance(toler,tolesp);
FinvC.GetBounds(infb,supb);
Solinv(3) = pmin;
@@ -1004,7 +997,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
else {
// It is necessary to check the value of the function
aRsnld.Root(Solinv);
recadre = FinvC.IsSolution(Solinv,tolpoint3d);
recadre = FinvC.IsSolution(Solinv,tolesp);
}
}
@@ -1048,7 +1041,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfRstFunction&
Handle(Adaptor3d_HVertex)& Vtx)
{
math_Vector toler(1,4),infb(1,4),supb(1,4);
Finv.GetTolerance(toler,tolpoint3d);
Finv.GetTolerance(toler,tolesp);
Finv.GetBounds(infb,supb);
Solinv(1) = sol(3);
Solinv(2) = param;
@@ -1065,9 +1058,9 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfRstFunction&
}
rsnld.Root(Solinv);
if(Finv.IsSolution(Solinv,tolpoint3d)){
if(Finv.IsSolution(Solinv,tolesp)){
gp_Pnt2d p2d(Solinv(3),Solinv(4));
TopAbs_State situ = domain1->Classify(p2d,tolpoint2d,0);
TopAbs_State situ = domain1->Classify(p2d,Min(toler(3),toler(4)),0);
if ((situ != TopAbs_IN) && (situ != TopAbs_ON)) {
return Standard_False;
}
@@ -1093,7 +1086,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfRstFunction&
math_Vector infbound(1,3),supbound(1,3);
math_Vector parinit(1,3),tolerance(1,3);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetTolerance(tolerance,tolesp);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld2(Func,tolerance,30);
@@ -1133,7 +1126,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfPointFuncInv&
FinvP.Set(thepoint);
math_Vector toler(1,3),infb(1,3),supb(1,3);
FinvP.GetTolerance(toler,tolpoint3d);
FinvP.GetTolerance(toler,tolesp);
FinvP.GetBounds(infb,supb);
Solinv(1) = param;
Solinv(2) = sol(1);
@@ -1149,9 +1142,9 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfPointFuncInv&
}
rsnld.Root(Solinv);
if(FinvP.IsSolution(Solinv,tolpoint3d)){
if(FinvP.IsSolution(Solinv,tolesp)){
gp_Pnt2d p2d(Solinv(2),Solinv(3));
TopAbs_State situ = domain1->Classify(p2d,tolpoint2d,0);
TopAbs_State situ = domain1->Classify(p2d,Min(toler(2),toler(3)),0);
if ((situ != TopAbs_IN) && (situ != TopAbs_ON)) {
return Standard_False;
}
@@ -1244,7 +1237,7 @@ void BRepBlend_SurfRstLineBuilder::MakeExtremity(BRepBlend_Extremity&
if (OnFirst) {
Extrem.SetValue(previousP.PointOnS(),
sol(1),sol(2),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
if (!previousP.IsTangencyPoint())
Extrem.SetTangent(previousP.TangentOnS());
Iter = domain1;
@@ -1252,7 +1245,7 @@ void BRepBlend_SurfRstLineBuilder::MakeExtremity(BRepBlend_Extremity&
else {
Extrem.SetValue(previousP.PointOnC(),
sol(3),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
if (!previousP.IsTangencyPoint())
Extrem.SetTangent(previousP.TangentOnC());
Iter = domain2;
@@ -1319,13 +1312,12 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnSurf(const Blend_Poi
// if(!curpointistangent) curNorme = Tgsurf.SquareMagnitude();
if(!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
const Standard_Real toler3d = 0.01 * tolpoint3d;
if (Norme <= toler3d * toler3d){
if (Norme <= tolesp*tolesp){
// it can be necessary to force same point
return Blend_SamePoints;
}
if(!prevpointistangent){
if(prevNorme <= toler3d * toler3d) {
if(prevNorme <= tolesp*tolesp) {
return Blend_SamePoints;
}
Cosi = sens*Corde*prevTg;
@@ -1396,13 +1388,12 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnRst(const Blend_Poin
// if(!curpointistangent) curNorme = Tgsurf.SquareMagnitude();
if(!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
const Standard_Real toler3d = 0.01 * tolpoint3d;
if (Norme <= toler3d * toler3d){
if (Norme <= tolesp*tolesp){
// it can be necessary to force same point
return Blend_SamePoints;
}
if(!prevpointistangent){
if(prevNorme <= toler3d * toler3d) {
if(prevNorme <= tolesp*tolesp) {
return Blend_SamePoints;
}
Cosi = sens*Corde*prevTg;
@@ -1464,7 +1455,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::TestArret(Blend_SurfRstFunction& Func
IntSurf_TypeTrans tras = IntSurf_Undecided, trarst = IntSurf_Undecided;
Blend_Point curpoint;
if (Func.IsSolution(sol,tolpoint3d)) {
if (Func.IsSolution(sol,tolesp)) {
Standard_Boolean curpointistangent = Func.IsTangencyPoint();
pts = Func.PointOnS();
ptrst = Func.PointOnRst();
@@ -1508,7 +1499,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::TestArret(Blend_SurfRstFunction& Func
Func.Decroch(sol,nors,tgsecs);
nors.Normalize();
Standard_Real testra = tgsecs.Dot(nors.Crossed(tgs));
if (Abs(testra) > tolpoint3d) {
if (Abs(testra) > tolesp) {
if (testra < 0.) {
tras = IntSurf_In;
}
@@ -1567,7 +1558,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::CheckInside(Blend_SurfRstFunction
Standard_Boolean& Decroch)
{
math_Vector tolerance(1,3);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetTolerance(tolerance,tolesp);
//face pcurve.
Standard_Real w = sol(3);
if(w < rst->FirstParameter() - tolerance(3)||
@@ -1582,7 +1573,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::CheckInside(Blend_SurfRstFunction
//face surface
gp_Pnt2d p2d(sol(1),sol(2));
SituOnS = domain1->Classify(p2d,tolpoint2d,0);
SituOnS = domain1->Classify(p2d,Min(tolerance(1),tolerance(2)),0);
//lost contact
gp_Vec tgs,nors;

View File

@@ -71,9 +71,9 @@ public:
Standard_EXPORT BRepBlend_SurfRstLineBuilder(const Handle(Adaptor3d_Surface)& Surf1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_Surface)& Surf2, const Handle(Adaptor2d_Curve2d)& Rst, const Handle(Adaptor3d_TopolTool)& Domain2);
Standard_EXPORT void Perform (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT void Perform (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& Soldep, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Real TolGuide, const Standard_Boolean RecRst, const Standard_Boolean RecP, const Standard_Boolean RecS, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real TolGuide, const Standard_Boolean RecRst, const Standard_Boolean RecP, const Standard_Boolean RecS, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean Complete (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pmin);
@@ -128,8 +128,7 @@ private:
Handle(Adaptor3d_Surface) surf2;
Handle(Adaptor2d_Curve2d) rst;
Handle(Adaptor3d_TopolTool) domain2;
Standard_Real tolpoint3d;
Standard_Real tolpoint2d;
Standard_Real tolesp;
Standard_Real tolgui;
Standard_Real pasmax;
Standard_Real fleche;

View File

@@ -58,11 +58,11 @@ public:
//! To define singular points computed before walking.
Standard_EXPORT void AddSingularPoint (const Blend_Point& P);
Standard_EXPORT void Perform (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real Tol3d, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT void Perform (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_Function& F, const Standard_Real Pdep, math_Vector& ParDep, const Standard_Real Tol3d, const Standard_Real TolGuide, TopAbs_State& Pos1, TopAbs_State& Pos2);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_Function& F, const Standard_Real Pdep, math_Vector& ParDep, const Standard_Real Tolesp, const Standard_Real TolGuide, TopAbs_State& Pos1, TopAbs_State& Pos2);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& ParDep, const Standard_Real Tol3d, const Standard_Real TolGuide, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& ParDep, const Standard_Real Tolesp, const Standard_Real TolGuide, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean Continu (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real P);
@@ -131,7 +131,7 @@ private:
Standard_Boolean ToCorrectOnRst1;
Standard_Boolean ToCorrectOnRst2;
Standard_Real CorrectedParam;
Standard_Real tolpoint3d;
Standard_Real tolesp;
Standard_Real tolgui;
Standard_Real pasmax;
Standard_Real fleche;

View File

@@ -127,14 +127,6 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
for (ex.Init(S,TopAbs_EDGE,TopAbs_FACE); ex.More(); ex.Next())
{
const TopoDS_Edge& E = TopoDS::Edge(ex.Current());
if (!useTriangulation && BRep_Tool::IsGeometric(E))
{
BC.Initialize(E);
BndLib_Add3dCurve::Add(BC, BRep_Tool::Tolerance(E), B);
continue;
}
Handle(Poly_Polygon3D) P3d = BRep_Tool::Polygon3D(E, l);
if (!P3d.IsNull() && P3d->NbNodes() > 0)
{
@@ -151,7 +143,7 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
else
{
BRep_Tool::PolygonOnTriangulation(E, Poly, T, l);
if (!Poly.IsNull() && !T.IsNull() && T->NbNodes() > 0)
if (useTriangulation && !Poly.IsNull() && !T.IsNull() && T->NbNodes() > 0)
{
const TColStd_Array1OfInteger& Indices = Poly->Nodes();
nbNodes = Indices.Length();

View File

@@ -96,7 +96,7 @@ Standard_Boolean BRepClass_FaceExplorer::CheckPoint(gp_Pnt2d& thePoint)
else
{
Standard_Real anEpsilon = Epsilon(aDistance);
if (anEpsilon > Max (myUMax - myUMin, myVMax - myVMin))
if (anEpsilon > Max (myUMax - myUMin, myVMax - myVMin) && anEpsilon > 1e-100)
{
gp_Vec2d aLinVec(aCenterPnt, thePoint);
gp_Dir2d aLinDir(aLinVec);

View File

@@ -468,14 +468,7 @@ static void PERFORM_C0(const TopoDS_Edge& S1, const TopoDS_Edge& S2,
if (fabs(Dstmin - sqrt(Ext.SquareDistance(ii))) < Eps)
{
Pt = Ext.Point(ii);
// Pt - point on the curve pCurvOther/Eother, but
// if iE == 0 -> Eother correspond to edge S2
// and to edge S1 in the opposite case.
// Therefore we should search Pt through previous solution points on Other curve (edge):
// if iE == 0 - on edge S2, namely through SeqSol2,
// else - on edge S1, namely through SeqSol1.
const bool triSolutionResult = (iE == 0) ? TRI_SOLUTION(SeqSol2, Pt) : TRI_SOLUTION(SeqSol1, Pt);
if (triSolutionResult)
if (TRI_SOLUTION(SeqSol2, Pt))
{
// Check if the parameter does not correspond to a vertex
const Standard_Real t = Ext.Parameter(ii);
@@ -876,19 +869,9 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Edge& theS1,
if (!seqSol1.IsEmpty() && !seqSol2.IsEmpty())
{
BRepExtrema_SeqOfSolution::iterator anIt1 = seqSol1.begin();
BRepExtrema_SeqOfSolution::iterator anIt2 = seqSol2.begin();
for (; anIt1 != seqSol1.end() && anIt2 != seqSol2.end(); anIt1++, anIt2++)
{
gp_Pnt Pt1 = anIt1->Point();
gp_Pnt Pt2 = anIt2->Point();
if (TRI_SOLUTION(theSeqSolShape1, Pt1) || TRI_SOLUTION(theSeqSolShape2, Pt2))
{
theSeqSolShape1.Append(*anIt1);
theSeqSolShape2.Append(*anIt2);
myModif = Standard_True;
}
}
theSeqSolShape1.Append(seqSol1);
theSeqSolShape2.Append(seqSol2);
myModif = Standard_True;
}
}

View File

@@ -43,8 +43,6 @@ BRepExtrema_ProximityDistTool::BRepExtrema_ProximityDistTool()
//=======================================================================
BRepExtrema_ProximityDistTool::BRepExtrema_ProximityDistTool (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Standard_Integer theNbSamples1,
const BVH_Array3d& theAddVertices1,
const NCollection_Vector<ProxPnt_Status>& theAddStatus1,
const Handle(BRepExtrema_TriangleSet)& theSet2,
const BRepExtrema_ShapeList& theShapeList1,
const BRepExtrema_ShapeList& theShapeList2)
@@ -57,7 +55,6 @@ BRepExtrema_ProximityDistTool::BRepExtrema_ProximityDistTool (const Handle(BRepE
{
LoadTriangleSets (theSet1, theSet2);
LoadShapeLists (theShapeList1, theShapeList2);
LoadAdditionalPointsFirstSet (theAddVertices1, theAddStatus1);
}
//=======================================================================
@@ -72,7 +69,7 @@ void BRepExtrema_ProximityDistTool::LoadTriangleSets (const Handle(BRepExtrema_T
}
//=======================================================================
//function : LoadShapeLists
//function : LoadTriangleSets
//purpose : Loads the given list of subshapes into the proximity tool
//=======================================================================
void BRepExtrema_ProximityDistTool::LoadShapeLists (const BRepExtrema_ShapeList& theShapeList1,
@@ -81,50 +78,6 @@ void BRepExtrema_ProximityDistTool::LoadShapeLists (const BRepExtrema_ShapeList&
myShapeList1 = theShapeList1;
myShapeList2 = theShapeList2;
}
//=======================================================================
//function : LoadAdditionalPointsFirstSet
//purpose : Loads given additional vertices and their statuses
//=======================================================================
void BRepExtrema_ProximityDistTool::LoadAdditionalPointsFirstSet (const BVH_Array3d& theAddVertices1,
const NCollection_Vector<ProxPnt_Status>& theAddStatus1)
{
myAddVertices1 = theAddVertices1;
myAddStatus1 = theAddStatus1;
}
//=======================================================================
//function : goThroughtSet1
//purpose : Goes throught vertices from the 1st set
//=======================================================================
void BRepExtrema_ProximityDistTool::goThroughtSet1 (const BVH_Array3d& theVertices1,
const Standard_Boolean theIsAdditionalSet)
{
Standard_Integer aVtxSize = (Standard_Integer)theVertices1.size();
Standard_Integer aVtxStep = Max (myNbSamples1 <= 0 ? 1 : aVtxSize / myNbSamples1, 1);
for (Standard_Integer aVtxIdx = 0; aVtxIdx < aVtxSize; aVtxIdx += aVtxStep)
{
myDistance = std::numeric_limits<Standard_Real>::max();
myMinDistance = std::numeric_limits<Standard_Real>::max();
myIsDone = Standard_False;
SetObject (theVertices1[aVtxIdx]);
ComputeDistance();
if (!IsDone() && myProxDist < 0.) return;
if (IsDone() && myDistance > myProxDist)
{
myPnt1 = theVertices1[aVtxIdx];
myPnt2 = myExtremaPoint;
myProxDist = myDistance;
myProxVtxIdx1 = aVtxIdx;
myIsProxVtx1FromAddSet = theIsAdditionalSet;
myProxPrjState = myExtPrjState;
}
}
}
//=======================================================================
//function : Perform
//purpose : Performs searching of the proximity distance
@@ -132,14 +85,37 @@ void BRepExtrema_ProximityDistTool::goThroughtSet1 (const BVH_Array3d& theVertic
void BRepExtrema_ProximityDistTool::Perform()
{
SetBVHSet (mySet2.get());
goThroughtSet1 (mySet1->GetVertices(), Standard_False);
goThroughtSet1 (myAddVertices1, Standard_True);
myIsDone = myProxDist > -1.;
if (myIsDone)
const BVH_Array3d& aVertices1 = mySet1->GetVertices();
Standard_Integer aVtxSize = (Standard_Integer)aVertices1.size();
Standard_Integer aVtxStep = Max (myNbSamples1 <= 0 ? 1 : aVtxSize / myNbSamples1, 1);
for (Standard_Integer aVtxIdx = 0; aVtxIdx < aVtxSize; aVtxIdx += aVtxStep)
{
DefineStatusProxPnt();
myDistance = std::numeric_limits<Standard_Real>::max();
myMinDistance = std::numeric_limits<Standard_Real>::max();
myIsDone = Standard_False;
SetObject (aVertices1[aVtxIdx]);
ComputeDistance();
if (!IsDone() && myProxDist < 0.) return;
if (IsDone() && myDistance > myProxDist)
{
myPnt1 = aVertices1[aVtxIdx];
myPnt2 = myExtremaPoint;
myProxDist = myDistance;
myProxVtxIdx1 = aVtxIdx;
myProxPrjState = myExtPrjState;
}
}
myIsDone = myProxDist > -1.;
if (myIsDone)
{
DefineStatusProxPnt();
}
}
static Standard_Real pointBoxSquareMaxDistance (const BVH_Vec3d& thePoint,
@@ -271,12 +247,7 @@ Standard_Real BRepExtrema_ProximityDistTool::ComputeDistance()
return myDistance;
}
//=======================================================================
//function : IsNodeOnBorder
//purpose : Returns true if the node is on the boarder
//=======================================================================
Standard_Boolean BRepExtrema_ProximityDistTool::IsNodeOnBorder (const Standard_Integer theNodeIdx,
const Handle(Poly_Triangulation)& theTr)
static Standard_Boolean isNodeOnBorder (const Standard_Integer theNodeIdx, const Handle (Poly_Triangulation)& theTr)
{
Poly_Connect aPolyConnect (theTr);
@@ -308,49 +279,12 @@ Standard_Boolean BRepExtrema_ProximityDistTool::IsNodeOnBorder (const Standard_I
return Standard_False;
}
//=======================================================================
//function : IsEdgeOnBorder
//purpose : Returns true if the edge is on the boarder
//=======================================================================
Standard_Boolean BRepExtrema_ProximityDistTool::IsEdgeOnBorder (const Standard_Integer theTrgIdx,
const Standard_Integer theFirstEdgeNodeIdx,
const Standard_Integer theSecondEdgeNodeIdx,
const Handle(Poly_Triangulation)& theTr)
{
Poly_Connect aPolyConnect (theTr);
Standard_Integer aAdjTrg[3];
aPolyConnect.Triangles (theTrgIdx, aAdjTrg[0], aAdjTrg[1], aAdjTrg[2]); //indices of adjacent triangles
for (Standard_Integer j = 0; j < 3; j++)
{
Standard_Integer k = (j + 1) % 3;
if (aAdjTrg[j] == 0) //free segment of triangle
{
//are ends of free segment and it is a part of border
if (j == theFirstEdgeNodeIdx &&
k == theSecondEdgeNodeIdx)
{
return Standard_True;
}
}
}
return Standard_False;
}
//=======================================================================
//function : defineStatusProxPnt1
//purpose : Defines the status of proximity point from 1st BVH
//=======================================================================
void BRepExtrema_ProximityDistTool::defineStatusProxPnt1()
{
if (myIsProxVtx1FromAddSet)
{
myPntStatus1 = myAddStatus1[myProxVtxIdx1];
return;
}
Standard_Integer aFaceID1 = mySet1->GetShapeIDOfVtx (myProxVtxIdx1);
if (myShapeList1 (aFaceID1).ShapeType() == TopAbs_EDGE)
@@ -380,9 +314,9 @@ void BRepExtrema_ProximityDistTool::defineStatusProxPnt1()
TopLoc_Location aLocation;
const TopoDS_Face& aF = TopoDS::Face (myShapeList1 (aFaceID1));
Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation (aF, aLocation);
Handle (Poly_Triangulation) aTr = BRep_Tool::Triangulation (aF, aLocation);
if (IsNodeOnBorder (aNodeIdx, aTr))
if (isNodeOnBorder (aNodeIdx, aTr))
{
myPntStatus1 = ProxPnt_Status_BORDER;
}
@@ -464,7 +398,7 @@ void BRepExtrema_ProximityDistTool::defineStatusProxPnt2()
{
TopLoc_Location aLocation;
const TopoDS_Face& aF = TopoDS::Face (myShapeList2 (aFaceID2));
Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation (aF, aLocation);
Handle (Poly_Triangulation) aTr = BRep_Tool::Triangulation (aF, aLocation);
NCollection_Array1<Standard_Integer> aVtxIndicesOfTrg;
mySet2->GetVtxIndices (aTrgIdx, aVtxIndicesOfTrg);
@@ -474,7 +408,7 @@ void BRepExtrema_ProximityDistTool::defineStatusProxPnt2()
Standard_Integer aNodeNum = myProxPrjState.GetNumberOfFirstNode();
Standard_Integer aNodeIdx = mySet2->GetVtxIdxInShape (aVtxIndicesOfTrg[aNodeNum]) + 1;
if (IsNodeOnBorder (aNodeIdx, aTr))
if (isNodeOnBorder (aNodeIdx, aTr))
{
myPntStatus2 = ProxPnt_Status_BORDER;
}
@@ -485,18 +419,27 @@ void BRepExtrema_ProximityDistTool::defineStatusProxPnt2()
}
else if (myProxPrjState.GetPrjState() == BVH_PrjState::BVH_PrjStateInTriangle_EDGE)
{
myPntStatus2 = ProxPnt_Status_MIDDLE;
Poly_Connect aPolyConnect (aTr);
Standard_Integer aTrgIdxInShape = mySet2->GetTrgIdxInShape (aTrgIdx) + 1;
if (IsEdgeOnBorder (aTrgIdxInShape,
myProxPrjState.GetNumberOfFirstNode(),
myProxPrjState.GetNumberOfLastNode(),
aTr))
Standard_Integer aAdjTrg[3];
aPolyConnect.Triangles (aTrgIdxInShape, aAdjTrg[0], aAdjTrg[1], aAdjTrg[2]); //indices of adjacent triangles
for (Standard_Integer j = 0; j < 3; j++)
{
myPntStatus2 = ProxPnt_Status_BORDER;
}
else
{
myPntStatus2 = ProxPnt_Status_MIDDLE;
Standard_Integer k = (j + 1) % 3;
if (aAdjTrg[j] == 0) //free segment of triangle
{
//aVtxIndicesOfTrg[j] and aVtxIndicesOfTrg[k] are ends of free segment and it is a part of border
if (j == myProxPrjState.GetNumberOfFirstNode() &&
k == myProxPrjState.GetNumberOfLastNode())
{
myPntStatus2 = ProxPnt_Status_BORDER;
break;
}
}
}
} //else if (myProxPrjState.GetPrjState() == BVH_PrjState::BVH_PrjStateInTriangle_EDGE)
}

View File

@@ -21,7 +21,6 @@
#include <BRepExtrema_TriangleSet.hxx>
#include <BVH_Distance.hxx>
#include <BVH_Tools.hxx>
#include <Poly_Triangulation.hxx>
//! Tool class for computation the proximity distance from first
//! primitive set to second one that is the maximal from minimum
@@ -94,8 +93,6 @@ public:
//! Creates new tool for the given element sets.
Standard_EXPORT BRepExtrema_ProximityDistTool (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Standard_Integer theNbSamples1,
const BVH_Array3d& theAddVertices1,
const NCollection_Vector<ProxPnt_Status>& theAddStatus1,
const Handle(BRepExtrema_TriangleSet)& theSet2,
const BRepExtrema_ShapeList& theShapeList1,
const BRepExtrema_ShapeList& theShapeList2);
@@ -110,10 +107,6 @@ public:
Standard_EXPORT void LoadShapeLists (const BRepExtrema_ShapeList& theShapeList1,
const BRepExtrema_ShapeList& theShapeList2);
//! Loads given additional vertices and their statuses.
void LoadAdditionalPointsFirstSet (const BVH_Array3d& theAddVertices1,
const NCollection_Vector<ProxPnt_Status>& theAddStatus1);
//! Performs searching of the proximity distance.
Standard_EXPORT void Perform();
@@ -128,20 +121,6 @@ public: //! @name Reject/Accept implementations
Standard_EXPORT virtual Standard_Boolean Accept (const Standard_Integer theSgmIdx,
const Standard_Real&) Standard_OVERRIDE;
public:
//! Returns true if the node is on the boarder.
Standard_EXPORT static Standard_Boolean IsNodeOnBorder (const Standard_Integer theNodeIdx,
const Handle (Poly_Triangulation)& theTr);
//! Returns true if the edge is on the boarder.
Standard_EXPORT static Standard_Boolean IsEdgeOnBorder (const Standard_Integer theTrgIdx,
const Standard_Integer theFirstEdgeNodeIdx,
const Standard_Integer theSecondEdgeNodeIdx,
const Handle (Poly_Triangulation)& theTr);
public:
//! Returns points on triangles sets, which provide the proximity distance.
void ProximityPoints (BVH_Vec3d& thePoint1, BVH_Vec3d& thePoint2) const
{
@@ -169,10 +148,6 @@ protected:
private:
//! Goes throught vertices from the 1st set.
void goThroughtSet1 (const BVH_Array3d& aVertices1,
const Standard_Boolean theIsAdditionalSet);
//! Defines the status of proximity point from 1st BVH.
void defineStatusProxPnt1();
@@ -208,11 +183,6 @@ private:
Standard_Integer myNbSamples1; //!< Number of samples points on the first shape
//! Is vertex corresponding to proximity point of 1st shape from additional set
Standard_Integer myIsProxVtx1FromAddSet;
BVH_Array3d myAddVertices1; //!< Additional vertices on the 1st shape
NCollection_Vector<ProxPnt_Status> myAddStatus1; //!< Status of additional vertices on the 1st shape
//! Vertex index from 1st BVH corresponding to proximity point of 1st shape
Standard_Integer myProxVtxIdx1;

View File

@@ -1,4 +1,4 @@
// Created on: 2022-08-08
// Created on: 2022-08-08
// Created by: Kseniya NOSULKO
// Copyright (c) 2022 OPEN CASCADE SAS
//
@@ -14,32 +14,17 @@
// commercial license or contractual agreement.
#include <BRepExtrema_ProximityValueTool.hxx>
#include <BRepExtrema_ProximityDistTool.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepGProp.hxx>
#include <GCPnts_AbscissaPoint.hxx>
#include <GCPnts_QuasiUniformAbscissa.hxx>
#include <GProp_GProps.hxx>
#include <Poly_Connect.hxx>
#include <TopoDS.hxx>
//=======================================================================
//function : BRepExtrema_ProximityValueTool
//purpose : Creates new unitialized proximity tool
//=======================================================================
BRepExtrema_ProximityValueTool::BRepExtrema_ProximityValueTool()
: myIsRefinementRequired1 (Standard_False),
myIsRefinementRequired2 (Standard_False),
myDistance (std::numeric_limits<Standard_Real>::max()),
: myDistance (std::numeric_limits<Standard_Real>::max()),
myIsDone (Standard_False),
myNbSamples1(0),
myNbSamples2(0)
{
// Should be initialized later
myIsInitS1 = myIsInitS2 = Standard_False;
}
{}
//=======================================================================
//function : BRepExtrema_ProximityValueTool
@@ -49,15 +34,13 @@ BRepExtrema_ProximityValueTool::BRepExtrema_ProximityValueTool (const Handle(BRe
const Handle(BRepExtrema_TriangleSet)& theSet2,
const BRepExtrema_ShapeList& theShapeList1,
const BRepExtrema_ShapeList& theShapeList2)
: myIsRefinementRequired1 (Standard_False),
myIsRefinementRequired2 (Standard_False),
myDistance (std::numeric_limits<Standard_Real>::max()),
: myDistance (std::numeric_limits<Standard_Real>::max()),
myIsDone (Standard_False),
myNbSamples1 (0),
myNbSamples2 (0)
myNbSamples1(0),
myNbSamples2(0)
{
LoadShapeLists (theShapeList1, theShapeList2);
LoadTriangleSets (theSet1, theSet2);
LoadShapeLists (theShapeList1, theShapeList2);
}
//=======================================================================
@@ -70,94 +53,7 @@ void BRepExtrema_ProximityValueTool::LoadTriangleSets (const Handle(BRepExtrema_
mySet1 = theSet1;
mySet2 = theSet2;
MarkDirty();
}
//=======================================================================
//function : calcEdgeRefinementStep
//purpose : Calculates the edge refinement step
//=======================================================================
static Standard_Real calcEdgeRefinementStep (const TopoDS_Edge& theEdge,
const Standard_Integer theNbNodes)
{
if (theNbNodes < 2)
return 0;
BRepAdaptor_Curve aBAC (theEdge);
Standard_Real aLen = GCPnts_AbscissaPoint::Length (aBAC);
return aLen / (Standard_Real)(theNbNodes - 1);
}
//=======================================================================
//function : calcFaceRefinementStep
//purpose : Calculates the face refinement step as an approximate square
// (Shape area / number triangles) * 2
//=======================================================================
static Standard_Real calcFaceRefinementStep (const TopoDS_Face& theFace,
const Standard_Integer theNbTrg)
{
if (theNbTrg < 1)
return 0;
GProp_GProps props;
BRepGProp::SurfaceProperties (theFace, props);
Standard_Real aArea = props.Mass();
return 2 * (aArea / (Standard_Real)theNbTrg);
}
//=======================================================================
//function : getInfoForRefinement
//purpose : Gets shape data for further refinement
//=======================================================================
Standard_Boolean BRepExtrema_ProximityValueTool::getInfoForRefinement (const TopoDS_Shape& theShape,
TopAbs_ShapeEnum& theShapeType,
Standard_Integer& theNbNodes,
Standard_Real& theStep)
{
if (theShape.ShapeType() == TopAbs_FACE)
{
theShapeType = TopAbs_FACE;
TopoDS_Face aF = TopoDS::Face (theShape);
TopLoc_Location aLocation;
Handle(Poly_Triangulation) aTriangulation = BRep_Tool::Triangulation (aF, aLocation);
if (aTriangulation.IsNull())
{
return Standard_False;
}
theNbNodes = aTriangulation->NbNodes();
Standard_Integer aNbTrg = aTriangulation->NbTriangles();
theStep = calcFaceRefinementStep (aF, aNbTrg);
}
else if (theShape.ShapeType() == TopAbs_EDGE)
{
theShapeType = TopAbs_EDGE;
TopoDS_Edge aE = TopoDS::Edge (theShape);
TopLoc_Location aLocation;
Handle(Poly_Polygon3D) aPolygon = BRep_Tool::Polygon3D (aE, aLocation);
if (aPolygon.IsNull())
{
return Standard_False;
}
theNbNodes = aPolygon->NbNodes();
theStep = calcEdgeRefinementStep (aE, theNbNodes);
}
else
{
return Standard_False;
}
if (theStep < Precision::Confusion())
{
return Standard_False;
}
return Standard_True;
myIsDone = Standard_False;
}
//=======================================================================
@@ -170,13 +66,7 @@ void BRepExtrema_ProximityValueTool::LoadShapeLists (const BRepExtrema_ShapeList
myShapeList1 = theShapeList1;
myShapeList2 = theShapeList2;
myShape1 = theShapeList1 (0);
myIsInitS1 = getInfoForRefinement (myShape1, myShapeType1, myNbNodes1, myStep1);
myShape2 = theShapeList2 (0);
myIsInitS2 = getInfoForRefinement (myShape2, myShapeType2, myNbNodes2, myStep2);
MarkDirty();
myIsDone = Standard_False;
}
//=======================================================================
@@ -189,7 +79,7 @@ void BRepExtrema_ProximityValueTool::SetNbSamplePoints(const Standard_Integer th
myNbSamples1 = theSamples1;
myNbSamples2 = theSamples2;
MarkDirty();
myIsDone = Standard_False;
}
//=======================================================================
@@ -198,8 +88,6 @@ void BRepExtrema_ProximityValueTool::SetNbSamplePoints(const Standard_Integer th
//=======================================================================
Standard_Real BRepExtrema_ProximityValueTool::computeProximityDist (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Standard_Integer theNbSamples1,
const BVH_Array3d& theAddVertices1,
const NCollection_Vector<ProxPnt_Status>& theAddStatus1,
const Handle(BRepExtrema_TriangleSet)& theSet2,
const BRepExtrema_ShapeList& theShapeList1,
const BRepExtrema_ShapeList& theShapeList2,
@@ -208,8 +96,7 @@ Standard_Real BRepExtrema_ProximityValueTool::computeProximityDist (const Handle
ProxPnt_Status& thePointStatus1,
ProxPnt_Status& thePointStatus2) const
{
BRepExtrema_ProximityDistTool aProxDistTool (theSet1, theNbSamples1, theAddVertices1, theAddStatus1,
theSet2, theShapeList1, theShapeList2);
BRepExtrema_ProximityDistTool aProxDistTool (theSet1, theNbSamples1, theSet2, theShapeList1, theShapeList2);
aProxDistTool.Perform();
if (!aProxDistTool.IsDone())
@@ -221,311 +108,21 @@ Standard_Real BRepExtrema_ProximityValueTool::computeProximityDist (const Handle
return aProxDistTool.ProximityDistance();
}
//=======================================================================
//function : getEdgeAdditionalVertices
//purpose : Gets additional vertices and their statuses on the edge with the input step
//=======================================================================
Standard_Boolean BRepExtrema_ProximityValueTool::getEdgeAdditionalVertices (
const TopoDS_Edge& theEdge,
const Standard_Real theStep,
BVH_Array3d& theAddVertices,
NCollection_Vector<ProxPnt_Status>& theAddStatuses)
{
BRepAdaptor_Curve aBAC (theEdge);
if (!aBAC.Is3DCurve() || theStep < Precision::Confusion())
{
return Standard_False;
}
Standard_Real aLen = GCPnts_AbscissaPoint::Length (aBAC);
Standard_Integer aNbSamplePoints = (Standard_Integer) (aLen / theStep) + 1;
GCPnts_QuasiUniformAbscissa aGCPnts (aBAC, Max (3, aNbSamplePoints));
if (!aGCPnts.IsDone())
return Standard_False;
Standard_Integer aNbNodes = aGCPnts.NbPoints();
for (Standard_Integer aVertIdx = 2; aVertIdx < aNbNodes; ++aVertIdx) //don't add extreme points
{
Standard_Real aPar = aGCPnts.Parameter (aVertIdx);
gp_Pnt aP = aBAC.Value (aPar);
theAddVertices.push_back (BVH_Vec3d (aP.X(), aP.Y(), aP.Z()));
theAddStatuses.Append (ProxPnt_Status::ProxPnt_Status_MIDDLE);
}
return Standard_True;
}
//=======================================================================
//function : doRecurTrgSplit
//purpose : Splits the triangle into two ones recursively, halving the longest side
// untill the area of the current triangle > input step
//! @param theTrg points of the triangle to be splitted
//! @param theEdgesStatus status of triangle edges - on the border or middle of the face
//! @param theTol telerance used in search of coincidence points
//! @param theStep minimum area of the resulting triangle
//! @param theAddVertices vertices obtained halving sides
//! @param theAddStatuses status of obtained vertices - on the border or middle of the face,
//! from triangulation of which the input triangle is
//=======================================================================
void BRepExtrema_ProximityValueTool::doRecurTrgSplit (const gp_Pnt (&theTrg)[3],
const ProxPnt_Status (&theEdgesStatus)[3],
const Standard_Real theTol,
const Standard_Real theStep,
BVH_Array3d& theAddVertices,
NCollection_Vector<ProxPnt_Status>& theAddStatuses)
{
gp_XYZ aTrgSide1 = theTrg[1].Coord() - theTrg[0].Coord();
gp_XYZ aTrgSide2 = theTrg[2].Coord() - theTrg[0].Coord();
Standard_Real aTrgArea = 0.5 * aTrgSide1.CrossMagnitude (aTrgSide2);
if (aTrgArea - theStep < Precision::SquareConfusion())
return;
Standard_Real aD[3] { theTrg[0].Distance (theTrg[1]),
theTrg[1].Distance (theTrg[2]),
theTrg[2].Distance (theTrg[0]) };
Standard_Integer aBisectedEdgeIdx = aD[0] > aD[1] ? (aD[0] > aD[2] ? 0 : 2) : (aD[1] > aD[2] ? 1 : 2);
gp_Pnt aCenterOfMaxSide (theTrg[aBisectedEdgeIdx].Coord());
aCenterOfMaxSide.BaryCenter (0.5, theTrg[(aBisectedEdgeIdx + 1) % 3], 0.5);
Bnd_Box aBox;
aBox.Add (aCenterOfMaxSide);
aBox.Enlarge (theTol);
myInspector.SetCurrent (aCenterOfMaxSide.Coord());
myCells.Inspect (aBox.CornerMin().XYZ(), aBox.CornerMax().XYZ(), myInspector);
if (myInspector.IsNeedAdd()) //is point aCenterOfMaxSide unique
{
BVH_Vec3d aBisectingPnt (aCenterOfMaxSide.X(), aCenterOfMaxSide.Y(), aCenterOfMaxSide.Z());
theAddVertices.push_back (aBisectingPnt);
theAddStatuses.Append (theEdgesStatus[aBisectedEdgeIdx]);
myInspector.Add (aCenterOfMaxSide.Coord());
myCells.Add (static_cast<BRepExtrema_VertexInspector::Target>(theAddVertices.size()),
aBox.CornerMin().XYZ(), aBox.CornerMax().XYZ());
}
gp_Pnt aTrg1[3] = { theTrg[0], theTrg[1], theTrg[2] };
gp_Pnt aTrg2[3] = { theTrg[0], theTrg[1], theTrg[2] };
ProxPnt_Status aEdgesStatus1[3] = { theEdgesStatus[0], theEdgesStatus[1], theEdgesStatus[2] };
ProxPnt_Status aEdgesStatus2[3] = { theEdgesStatus[0], theEdgesStatus[1], theEdgesStatus[2] };
switch (aBisectedEdgeIdx)
{
case 0:
aTrg1[0] = aTrg2[1] = aCenterOfMaxSide;
aEdgesStatus1[2] = aEdgesStatus2[1] = ProxPnt_Status::ProxPnt_Status_MIDDLE;
break;
case 1:
aTrg1[1] = aTrg2[2] = aCenterOfMaxSide;
aEdgesStatus1[0] = aEdgesStatus2[2] = ProxPnt_Status::ProxPnt_Status_MIDDLE;
break;
case 2:
aTrg1[2] = aTrg2[0] = aCenterOfMaxSide;
aEdgesStatus1[1] = aEdgesStatus2[0] = ProxPnt_Status::ProxPnt_Status_MIDDLE;
break;
}
doRecurTrgSplit (aTrg1, aEdgesStatus1, theTol, theStep, theAddVertices, theAddStatuses);
doRecurTrgSplit (aTrg2, aEdgesStatus2, theTol, theStep, theAddVertices, theAddStatuses);
}
static Standard_Real getModelRange (const TopLoc_Location& theLocation,
const Handle(Poly_Triangulation)& theTr)
{
Bnd_Box aBox;
theTr->MinMax (aBox, theLocation.Transformation());
Standard_Real aXm = 0.0, aYm = 0.0, aZm = 0.0, aXM = 0.0, aYM = 0.0, aZM = 0.0;
aBox.Get (aXm, aYm, aZm, aXM, aYM, aZM);
Standard_Real aRange = aXM - aXm;
aRange = Max (aRange, aYM - aYm);
aRange = Max (aRange, aZM - aZm);
return aRange;
}
static void getNodesOfTrg (const Standard_Integer theTriIdx,
const TopLoc_Location& theLocation,
const Handle (Poly_Triangulation)& theTr,
gp_Pnt (&theTrg)[3])
{
Standard_Integer aVtxIdx1;
Standard_Integer aVtxIdx2;
Standard_Integer aVtxIdx3;
theTr->Triangle (theTriIdx).Get (aVtxIdx1, aVtxIdx2, aVtxIdx3);
gp_Pnt aVtx1 = theTr->Node (aVtxIdx1);
aVtx1.Transform (theLocation);
theTrg[0] = aVtx1;
gp_Pnt aVtx2 = theTr->Node (aVtxIdx2);
aVtx2.Transform (theLocation);
theTrg[1] = aVtx2;
gp_Pnt aVtx3 = theTr->Node (aVtxIdx3);
aVtx3.Transform (theLocation);
theTrg[2] = aVtx3;
}
// Gets status of triangle edges - on the border or middle of the face
static void getEdgesStatus(const Standard_Integer theTriIdx,
const Handle(Poly_Triangulation)& theTr,
ProxPnt_Status (&theEdgesStatus1)[3])
{
for (Standard_Integer j = 0; j < 3; j++)
{
Standard_Integer k = (j + 1) % 3;
if (BRepExtrema_ProximityDistTool::IsEdgeOnBorder (theTriIdx, j, k, theTr))
{
theEdgesStatus1[j] = ProxPnt_Status::ProxPnt_Status_BORDER;
}
else
{
theEdgesStatus1[j] = ProxPnt_Status::ProxPnt_Status_MIDDLE;
}
}
}
//=======================================================================
//function : getFaceAdditionalVertices
//purpose : Gets additional vertices and their statuses on the face with the input step (triangle square)
//=======================================================================
Standard_Boolean BRepExtrema_ProximityValueTool::getFaceAdditionalVertices (
const TopoDS_Face& theFace,
const Standard_Real theStep,
BVH_Array3d& theAddVertices,
NCollection_Vector<ProxPnt_Status>& theAddStatuses)
{
Standard_Real aTol = Precision::Confusion();
TopLoc_Location aLocation;
Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation (theFace, aLocation);
if (aTr.IsNull())
{
return Standard_False;
}
myCells.Reset (Max (aTol, getModelRange (aLocation, aTr) / IntegerLast()));
for (Standard_Integer aTriIdx = 1; aTriIdx <= aTr->NbTriangles(); ++aTriIdx)
{
gp_Pnt aTrg[3];
ProxPnt_Status aEdgesStatus[3];
getNodesOfTrg (aTriIdx, aLocation, aTr, aTrg);
getEdgesStatus (aTriIdx, aTr, aEdgesStatus);
doRecurTrgSplit (aTrg, aEdgesStatus, aTol, theStep, theAddVertices, theAddStatuses);
}
return Standard_True;
}
//=======================================================================
//function : getShapesVertices
//purpose : Gets additional vertices on shapes with refining a coarser one if it's needed
//=======================================================================
Standard_Boolean BRepExtrema_ProximityValueTool::getShapesAdditionalVertices()
{
// estimate the density of meshes of shapes to add points to a coarcer one
// target steps for refinement
Standard_Real aStep1 = myStep1;
Standard_Real aStep2 = myStep2;
if ((myShapeType1 == TopAbs_EDGE) && (myShapeType2 == TopAbs_EDGE))
{
if (myNbSamples1 > myNbNodes1) // 1st edge needs refinement
{
aStep1 = calcEdgeRefinementStep (TopoDS::Edge (myShape1), myNbSamples1);
myIsRefinementRequired1 = Standard_True;
}
if (myNbSamples2 > myNbNodes2) // 2nd edge needs refinement
{
aStep2 = calcEdgeRefinementStep (TopoDS::Edge (myShape2), myNbSamples2);
myIsRefinementRequired2 = Standard_True;
}
if (aStep1 / aStep2 > 2.) // 1st edge needs refinement
{
myIsRefinementRequired1 = Standard_True;
aStep1 = aStep2;
}
else if (aStep2 / aStep1 > 2.) // 2nd edge needs refinement
{
myIsRefinementRequired2 = Standard_True;
aStep2 = aStep1;
}
if (myIsRefinementRequired1)
{
if (!getEdgeAdditionalVertices (TopoDS::Edge (myShape1), aStep1, myAddVertices1, myAddStatus1))
{
return Standard_False;
}
}
if (myIsRefinementRequired2)
{
if (!getEdgeAdditionalVertices (TopoDS::Edge (myShape2), aStep2, myAddVertices2, myAddStatus2))
{
return Standard_False;
}
}
}
else if ((myShapeType1 == TopAbs_FACE) && (myShapeType2 == TopAbs_FACE))
{
if (aStep1 / aStep2 > 2) // 1st face needs refinement
{
myIsRefinementRequired1 = Standard_True;
aStep1 = myStep2;
}
else if (aStep2 / aStep1 > 2.) // 2nd face needs refinement
{
myIsRefinementRequired2 = Standard_True;
aStep2 = myStep1;
}
if (myIsRefinementRequired1)
{
return getFaceAdditionalVertices (TopoDS::Face (myShape1), aStep1, myAddVertices1, myAddStatus1);
}
if (myIsRefinementRequired2)
{
return getFaceAdditionalVertices (TopoDS::Face (myShape2), aStep2, myAddVertices2, myAddStatus2);
}
}
return Standard_True;
}
//=======================================================================
//function : Perform
//purpose : Performs the computation of the proximity value
//=======================================================================
void BRepExtrema_ProximityValueTool::Perform (Standard_Real& theTolerance)
{
if (!myIsInitS1 || !myIsInitS2 || (myShapeType1 != myShapeType2))
return;
//get vertices on shapes with refining a coarser mesh if it's needed
if (!getShapesAdditionalVertices())
return;
myIsDone = Standard_False;
// max(min) dist from the 1st shape to the 2nd one
BVH_Vec3d aP1_1, aP1_2;
ProxPnt_Status aPointStatus1_1 = ProxPnt_Status::ProxPnt_Status_UNKNOWN;
ProxPnt_Status aPointStatus1_2 = ProxPnt_Status::ProxPnt_Status_UNKNOWN;
Standard_Real aProximityDist1 = computeProximityDist (mySet1, myNbSamples1, myAddVertices1, myAddStatus1,
mySet2,
myShapeList1, myShapeList2,
aP1_1, aP1_2,
aPointStatus1_1, aPointStatus1_2);
Standard_Real aProximityDist1 = computeProximityDist (mySet1, myNbSamples1, mySet2, myShapeList1, myShapeList2,
aP1_1, aP1_2, aPointStatus1_1, aPointStatus1_2);
if (aProximityDist1 < 0.)
return;
@@ -535,11 +132,8 @@ void BRepExtrema_ProximityValueTool::Perform (Standard_Real& theTolerance)
ProxPnt_Status aPointStatus2_1 = ProxPnt_Status::ProxPnt_Status_UNKNOWN;
ProxPnt_Status aPointStatus2_2 = ProxPnt_Status::ProxPnt_Status_UNKNOWN;
Standard_Real aProximityDist2 = computeProximityDist (mySet2, myNbSamples2, myAddVertices2, myAddStatus2,
mySet1,
myShapeList2, myShapeList1,
aP2_2, aP2_1,
aPointStatus2_2, aPointStatus2_1);
Standard_Real aProximityDist2 = computeProximityDist (mySet2, myNbSamples2, mySet1, myShapeList2, myShapeList1,
aP2_2, aP2_1, aPointStatus2_2, aPointStatus2_1);
if (aProximityDist2 < 0.)
return;
@@ -565,23 +159,3 @@ void BRepExtrema_ProximityValueTool::Perform (Standard_Real& theTolerance)
myIsDone = Standard_True;
theTolerance = myDistance;
}
//=======================================================================
//function : Inspect
//purpose : Used for selection and storage of coinciding nodes
//=======================================================================
NCollection_CellFilter_Action BRepExtrema_VertexInspector::Inspect (const Standard_Integer theTarget)
{
myIsNeedAdd = Standard_True;
const gp_XYZ& aPnt = myPoints.Value (theTarget - 1);
Standard_Real aDx, aDy, aDz;
aDx = myCurrent.X() - aPnt.X();
aDy = myCurrent.Y() - aPnt.Y();
aDz = myCurrent.Z() - aPnt.Z();
if ((aDx * aDx <= myTol) && (aDy * aDy <= myTol) && (aDz * aDz <= myTol))
myIsNeedAdd = Standard_False;
return CellFilter_Keep;
}

View File

@@ -1,4 +1,4 @@
// Created on: 2022-08-08
// Created on: 2022-08-08
// Created by: Kseniya NOSULKO
// Copyright (c) 2022 OPEN CASCADE SAS
//
@@ -18,67 +18,9 @@
#include <BRepExtrema_ProximityDistTool.hxx>
#include <BRepExtrema_TriangleSet.hxx>
#include <NCollection_CellFilter.hxx>
#include <Precision.hxx>
typedef NCollection_Vector<gp_XYZ> VectorOfPoint;
//! Class BRepExtrema_VertexInspector
//! derived from NCollection_CellFilter_InspectorXYZ
//! This class define the Inspector interface for CellFilter algorithm,
//! working with gp_XYZ points in 3d space.
//! Used in search of coincidence points with a certain tolerance.
class BRepExtrema_VertexInspector : public NCollection_CellFilter_InspectorXYZ
{
public:
typedef Standard_Integer Target;
//! Constructor; remembers the tolerance
BRepExtrema_VertexInspector()
: myTol (Precision::SquareConfusion()),
myIsNeedAdd (Standard_True)
{}
//! Keep the points used for comparison
void Add (const gp_XYZ& thePnt)
{
myPoints.Append (thePnt);
}
//! Set tolerance for comparison of point coordinates
void SetTol (const Standard_Real theTol)
{
myTol = theTol;
}
//! Set current point to search for coincidence
void SetCurrent (const gp_XYZ& theCurPnt)
{
myCurrent = theCurPnt;
myIsNeedAdd = Standard_True;
}
Standard_Boolean IsNeedAdd()
{
return myIsNeedAdd;
}
//! Implementation of inspection method
Standard_EXPORT NCollection_CellFilter_Action Inspect (const Standard_Integer theTarget);
private:
Standard_Real myTol;
Standard_Boolean myIsNeedAdd;
VectorOfPoint myPoints;
gp_XYZ myCurrent;
};
typedef NCollection_CellFilter<BRepExtrema_VertexInspector> BRepExtrema_CellFilter;
typedef typename BRepExtrema_ProximityDistTool::ProxPnt_Status ProxPnt_Status;
//! Tool class for computation of the proximity value from one BVH
//! primitive set to another, solving max(min) problem.
//! Handles only edge/edge or face/face cases.
//! This tool is not intended to be used independently, and is integrated
//! in other classes, implementing algorithms based on shape tessellation
//! (BRepExtrema_ShapeProximity and BRepExtrema_SelfIntersection).
@@ -87,6 +29,8 @@ typedef typename BRepExtrema_ProximityDistTool::ProxPnt_Status ProxPnt_Status;
//! on the quality of input tessellation(s).
class BRepExtrema_ProximityValueTool
{
public:
typedef typename BRepExtrema_ProximityDistTool::ProxPnt_Status ProxPnt_Status;
public:
@@ -142,17 +86,9 @@ public:
private:
//! Gets shape data for further refinement.
Standard_Boolean getInfoForRefinement (const TopoDS_Shape& theShapes,
TopAbs_ShapeEnum& theShapeType,
Standard_Integer& theNbNodes,
Standard_Real& theStep);
//! Returns the computed proximity value from first BVH to another one.
Standard_Real computeProximityDist (const Handle(BRepExtrema_TriangleSet)& theSet1,
const Standard_Integer theNbSamples1,
const BVH_Array3d& theAddVertices1,
const NCollection_Vector<ProxPnt_Status>& theAddStatus1,
const Handle(BRepExtrema_TriangleSet)& theSet2,
const BRepExtrema_ShapeList& theShapeList1,
const BRepExtrema_ShapeList& theShapeList2,
@@ -161,29 +97,6 @@ private:
ProxPnt_Status& thePointStatus1,
ProxPnt_Status& thePointStatus2) const;
//! Gets additional vertices on shapes with refining a coarser one if it's needed.
Standard_Boolean getShapesAdditionalVertices();
//! Gets additional vertices and their statuses on the edge with the input step.
Standard_Boolean getEdgeAdditionalVertices (const TopoDS_Edge& theEdge,
const Standard_Real theStep,
BVH_Array3d& theAddVertices,
NCollection_Vector<ProxPnt_Status>& theAddStatuses);
//! Gets additional vertices and their statuses on the face with the input step (triangle square).
Standard_Boolean getFaceAdditionalVertices (const TopoDS_Face& theFace,
const Standard_Real theStep,
BVH_Array3d& theAddVertices,
NCollection_Vector<ProxPnt_Status>& theAddStatuses);
//! Splits the triangle recursively, halving the longest side
//! to the area of the current triangle > input step
void doRecurTrgSplit (const gp_Pnt (&theTrg)[3],
const ProxPnt_Status (&theEdgesStatus)[3],
const Standard_Real theTol,
const Standard_Real theStep,
BVH_Array3d& theAddVertices,
NCollection_Vector<ProxPnt_Status>& theAddStatuses);
private:
//! Set of all mesh primitives of the 1st shape.
@@ -196,35 +109,6 @@ private:
//! List of subshapes of the 2nd shape.
BRepExtrema_ShapeList myShapeList2;
//! The 1st shape.
TopoDS_Shape myShape1;
//! The 2nd shape.
TopoDS_Shape myShape2;
BVH_Array3d myAddVertices1; //!< Additional vertices on the 1st shape if its mesh is coarser.
BVH_Array3d myAddVertices2; //!< Additional vertices on the 2nd shape if its mesh is coarser.
NCollection_Vector<ProxPnt_Status> myAddStatus1; //!< Status of additional vertices on the 1st shape.
NCollection_Vector<ProxPnt_Status> myAddStatus2; //!< Status of additional vertices on the 2nd shape.
Standard_Boolean myIsInitS1; //!< Is the 1st shape initialized?
Standard_Boolean myIsInitS2; //!< Is the 2nd shape initialized?
Standard_Boolean myIsRefinementRequired1; //!< Flag about the need to refine the 1st shape.
Standard_Boolean myIsRefinementRequired2; //!< Flag about the need to refine the 2nd shape.
Standard_Integer myNbNodes1; //!< Number of nodes in triangulation of the 1st shape.
Standard_Integer myNbNodes2; //!< Number of nodes in triangulation of the 2nd shape.
Standard_Real myStep1; //!< Step for getting vertices on the 1st shape.
Standard_Real myStep2; //!< Step for getting vertices on the 2nd shape.
BRepExtrema_CellFilter myCells;
BRepExtrema_VertexInspector myInspector;
TopAbs_ShapeEnum myShapeType1; //!< 1st shape type.
TopAbs_ShapeEnum myShapeType2; //!< 2nd shape type.
Standard_Real myDistance; //!< Distance
Standard_Boolean myIsDone; //!< State of the algorithm

View File

@@ -129,7 +129,6 @@ void BRepExtrema_ShapeProximity::Perform()
myElementSet2);
myProxValTool.LoadShapeLists (myShapeList1,
myShapeList2);
myProxValTool.SetNbSamplePoints (myNbSamples1, myNbSamples2);
myProxValTool.Perform (myTolerance);
myProxValTool.ProximityPoints(myProxPoint1, myProxPoint2);

View File

@@ -37,8 +37,7 @@
//! on distance less than the given tolerance from each other.
//!
//! Second approach:
//! Compute the proximity value between two shapes (handles only edge/edge or face/face cases)
//! if the tolerance is not defined (Precision::Infinite()).
//! Compute the proximity value between two shapes if the tolerance is not defined (Precision::Infinite()).
//! In this case the proximity value is a minimal thickness of a layer containing both shapes.
//!
//! For the both approaches the high performance is achieved through the use of existing
@@ -47,6 +46,8 @@
//! triangulation).
class BRepExtrema_ShapeProximity
{
public:
typedef typename BRepExtrema_ProximityValueTool::ProxPnt_Status ProxPnt_Status;
public:

View File

@@ -44,8 +44,6 @@
#include <BRepGProp_Face.hxx>
#include <BRep_TEdge.hxx>
#include <ShapeUpgrade_UnifySameDomain.hxx>
#include <Bnd_Box.hxx>
#include <BRepBndLib.hxx>
#ifdef BRepFill_AdvancedEvolved_DEBUG
#include <BinTools.hxx>
@@ -526,14 +524,9 @@ void BRepFill_AdvancedEvolved::GetLids()
return;
}
Standard_Real aTol = Max(aFS.Tolerance(), aFS.ToleranceReached());
aTol += myFuzzyValue;
Bnd_Box aProfBox;
BRepBndLib::Add(myProfile, aProfBox);
Standard_Real aSqDiag = aProfBox.SquareExtent();
//Square of the default angular tolerance in
//BOPAlgo_Tools::EdgesToWires(...) and BOPAlgo_Tools::WiresToFaces(...) methods
const Standard_Real aSqAnguarTol = aTol*aTol / aSqDiag;
const Standard_Real aSqAnguarTol = 1.0e-16;
const gp_Dir &aNormal = aSurf->Position().Direction();
// Obtain free-edges from myPipeShell. All edges must be planar
@@ -548,7 +541,6 @@ void BRepFill_AdvancedEvolved::GetLids()
gp_Pnt aPtmp;
gp_Vec aTan;
Standard_Real aDPMax = 0.;
for (Standard_Integer i = 1; i <= aMapEF.Size(); i++)
{
TopTools_ListOfShape& aListF = aMapEF(i);
@@ -572,8 +564,6 @@ void BRepFill_AdvancedEvolved::GetLids()
continue;
const Standard_Real aDP = aTan.XYZ().Dot(aNormal.XYZ());
if (Abs(aDP) > aDPMax)
aDPMax = Abs(aDP);
if (aDP*aDP>aSqModulus*aSqAnguarTol)
{
//Only planar edges are considered
@@ -604,9 +594,8 @@ void BRepFill_AdvancedEvolved::GetLids()
aBB.MakeCompound(aCompW);
aBB.MakeCompound(aCompF);
aBB.MakeCompound(myTopBottom);
Standard_Real anAngTol = Sqrt(aSqAnguarTol);
BOPAlgo_Tools::EdgesToWires(aFreeEdges, aCompW, Standard_True, anAngTol);
BOPAlgo_Tools::WiresToFaces(aCompW, aCompF, anAngTol);
BOPAlgo_Tools::EdgesToWires(aFreeEdges, aCompW, Standard_True);
BOPAlgo_Tools::WiresToFaces(aCompW, aCompF);
{
// Check orientation

View File

@@ -351,10 +351,6 @@ static void TrimEdge (const TopoDS_Edge& CurrentEdge,
for (j=1; j<=ndec; j++) {
// piece of edge
m1 = (CutValues.Value(j)-t0)*(last-first)/(t1-t0)+first;
if (Abs(m0 - m1) < Precision::Confusion())
{
return;
}
TopoDS_Edge CutE = BRepLib_MakeEdge(C,V0,Vbid,m0,m1);
CutE.Orientation(CurrentOrient);
S.Append(CutE);
@@ -362,10 +358,6 @@ static void TrimEdge (const TopoDS_Edge& CurrentEdge,
V0 = TopExp::LastVertex(CutE);
if (j==ndec) {
// last piece
if (Abs(m0 - last) < Precision::Confusion())
{
return;
}
TopoDS_Edge LastE = BRepLib_MakeEdge(C,V0,Vl,m0,last);
LastE.Orientation(CurrentOrient);
S.Append(LastE);
@@ -379,10 +371,6 @@ static void TrimEdge (const TopoDS_Edge& CurrentEdge,
for (j=ndec; j>=1; j--) {
// piece of edge
m0 = (CutValues.Value(j)-t0)*(last-first)/(t1-t0)+first;
if (Abs(m0 - m1) < Precision::Confusion())
{
return;
}
TopoDS_Edge CutE = BRepLib_MakeEdge(C,Vbid,V1,m0,m1);
CutE.Orientation(CurrentOrient);
S.Append(CutE);
@@ -390,10 +378,6 @@ static void TrimEdge (const TopoDS_Edge& CurrentEdge,
V1 = TopExp::FirstVertex(CutE);
if (j==1) {
// last piece
if (Abs(first - m1) < Precision::Confusion())
{
return;
}
TopoDS_Edge LastE = BRepLib_MakeEdge(C,Vf,V1,first,m1);
LastE.Orientation(CurrentOrient);
S.Append(LastE);
@@ -563,10 +547,6 @@ static Standard_Boolean EdgeIntersectOnWire (const gp_Pnt& P1,
SR.Clear();
SR.Append(param);
TrimEdge(E,SR,first,last,SO,SE);
if (SE.IsEmpty())
{
return Standard_False;
}
theEdgeNewEdges(E) = SE;
TopoDS_Vertex VV1,VV2;
TopExp::Vertices(TopoDS::Edge(SE.Value(1)),VV1,VV2);
@@ -676,7 +656,7 @@ static void BuildConnectedEdges(const TopoDS_Wire& aWire,
//=======================================================================
BRepFill_CompatibleWires::BRepFill_CompatibleWires()
:myStatus(BRepFill_ThruSectionErrorStatus_NotDone)
:myIsDone(Standard_False)
{
}
@@ -701,8 +681,8 @@ void BRepFill_CompatibleWires::Init(const TopTools_SequenceOfShape& Sections)
{
myInit = Sections;
myWork = Sections;
myPercent = 0.1;
myStatus = BRepFill_ThruSectionErrorStatus_NotDone;
myPercent = 0.01;
myIsDone = Standard_False;
myMap.Clear();
}
@@ -727,7 +707,7 @@ void BRepFill_CompatibleWires::SetPercent(const Standard_Real Percent)
Standard_Boolean BRepFill_CompatibleWires::IsDone() const
{
return myStatus == BRepFill_ThruSectionErrorStatus_Done;
return myIsDone;
}
@@ -786,7 +766,6 @@ Standard_Boolean BRepFill_CompatibleWires::IsDegeneratedLastSection() const
void BRepFill_CompatibleWires::Perform (const Standard_Boolean WithRotation)
{
myStatus = BRepFill_ThruSectionErrorStatus_Done;
// compute origin and orientation on wires to avoid twisted results
// and update wires to have same number of edges
@@ -859,7 +838,7 @@ void BRepFill_CompatibleWires::Perform (const Standard_Boolean WithRotation)
allClosed = (allClosed && wClosed);
allOpen = (allOpen && !wClosed);
}
if (allClosed) {
// All sections are closed
if (report) {
@@ -870,26 +849,24 @@ void BRepFill_CompatibleWires::Perform (const Standard_Boolean WithRotation)
// origin
ComputeOrigin(Standard_False);
}
myIsDone = Standard_True;
}
else if (allOpen) {
// All sections are open
// origin
SearchOrigin();
if (myStatus != BRepFill_ThruSectionErrorStatus_Done)
{
return;
}
// same number of elements
if (report) {
SameNumberByACR(report);
}
myIsDone = Standard_True;
}
else {
// There are open and closed sections :
// not processed
myStatus = BRepFill_ThruSectionErrorStatus_NotSameTopology;
return;
throw Standard_DomainError("Sections must be all closed or all open");
}
}
@@ -929,10 +906,7 @@ void BRepFill_CompatibleWires::
//allClosed = (allClosed && myWork(i).Closed());
}
if (!allClosed)
{
myStatus = BRepFill_ThruSectionErrorStatus_NotSameTopology;
return;
}
throw Standard_NoSuchObject("BRepFill_CompatibleWires::SameNumberByPolarMethod : the wires must be closed");
// sections ponctuelles, sections bouclantes ?
if (myDegen1) ideb++;
@@ -1012,11 +986,8 @@ void BRepFill_CompatibleWires::
// sequence of vertices of the first wire
SeqOfVertices(wire1,SeqV);
if (SeqV.Length() > NbMaxV)
{
myStatus = BRepFill_ThruSectionErrorStatus_Failed;
return;
}
if (SeqV.Length()>NbMaxV)
throw Standard_NoSuchObject("BRepFill::SameNumberByPolarMethod failed");
// loop on vertices of wire1
for (ii=1;ii<=SeqV.Length();ii++) {
@@ -1091,10 +1062,7 @@ void BRepFill_CompatibleWires::
// sequence of vertices of the first wire
SeqOfVertices(wire1,SeqV);
if ( SeqV.Length()>NbMaxV || SeqV.Length()>SizeMap )
{
myStatus = BRepFill_ThruSectionErrorStatus_Failed;
return;
}
throw Standard_NoSuchObject("BRepFill::SameNumberByPolarMethod failed");
// next wire
@@ -1216,17 +1184,14 @@ void BRepFill_CompatibleWires::
}
} //end of for(; itW.More(); itW.Next())
if (Esol.IsNull())
{
myStatus = BRepFill_ThruSectionErrorStatus_ProfilesInconsistent;
return;
}
throw Standard_ConstructionError("BRepFill :: profiles are inconsistent");
MW.Add(Esol);
TopTools_ListOfShape ConnectedEdges;
BuildConnectedEdges( TopoDS::Wire(myWork(i)), Esol, V2, ConnectedEdges );
TopTools_ListIteratorOfListOfShape itCE(ConnectedEdges);
for(; anExp.More() && itCE.More(); anExp.Next(), itCE.Next())
for(; anExp.More(), itCE.More(); anExp.Next(), itCE.Next())
{
ECur = anExp.Current();
TopExp::Vertices(ECur,VF,VL,Standard_True);
@@ -1299,10 +1264,8 @@ void BRepFill_CompatibleWires::
if (nbmax<nbEdges) nbmax = nbEdges;
if (nbmin>nbEdges) nbmin = nbEdges;
}
if (nbmin!=nbmax)
{
myStatus = BRepFill_ThruSectionErrorStatus_Failed;
return;
if (nbmin!=nbmax) {
throw Standard_NoSuchObject("BRepFill_CompatibleWires::SameNumberByPolarMethod failed");
}
//Fill <myMap>
@@ -1524,10 +1487,7 @@ void BRepFill_CompatibleWires::SameNumberByACR(const Standard_Boolean report)
if (nbmin>nbEdges(i)) nbmin = nbEdges(i);
}
if (nbmax!=nbmin)
{
myStatus = BRepFill_ThruSectionErrorStatus_Failed;
return;
}
throw Standard_NoSuchObject("BRepFill_CompatibleWires::SameNumberByACR failed");
}
//=======================================================================
@@ -1572,10 +1532,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ )
}
*/
if (!allClosed)
{
myStatus = BRepFill_ThruSectionErrorStatus_NotSameTopology;
return;
}
throw Standard_NoSuchObject("BRepFill_CompatibleWires::ComputeOrigin : the wires must be closed");
/*
// Max number of possible cuts
@@ -1912,10 +1869,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ )
gp_Pnt Pmini,P1,P2;
SeqOfVertices(wire,SeqV);
if (SeqV.Length()>NbMaxV)
{
myStatus = BRepFill::ThruSectionsError_Failed;
return;
}
throw Standard_NoSuchObject("BRepFill::ComputeOrigin failed");
if (!polar) {
// choix du vertex le plus proche comme origine
distmini = Precision::Infinite();
@@ -2140,10 +2094,7 @@ void BRepFill_CompatibleWires::SearchOrigin()
allOpen = (allOpen && !myWork(i).Closed());
}
if (!allOpen)
{
myStatus = BRepFill_ThruSectionErrorStatus_NotSameTopology;
return;
}
throw Standard_NoSuchObject("BRepFill_CompatibleWires::SearchOrigin : the wires must be open");
// init

View File

@@ -20,7 +20,6 @@
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <BRepFill_ThruSectionErrorStatus.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
@@ -50,11 +49,6 @@ public:
Standard_EXPORT void Perform (const Standard_Boolean WithRotation = Standard_True);
Standard_EXPORT Standard_Boolean IsDone() const;
BRepFill_ThruSectionErrorStatus GetStatus() const
{
return myStatus;
}
//! returns the generated sequence.
Standard_EXPORT const TopTools_SequenceOfShape& Shape() const;
@@ -107,7 +101,7 @@ private:
Standard_Real myPercent;
Standard_Boolean myDegen1;
Standard_Boolean myDegen2;
BRepFill_ThruSectionErrorStatus myStatus;
Standard_Boolean myIsDone;
TopTools_DataMapOfShapeListOfShape myMap;

View File

@@ -65,7 +65,6 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
const TopoDS_Edge& Edge2)
{
// initializations
// !Note if IType set as -1 it means that occurs error with null 3d curve for the edge
Standard_Integer IType = 0;
// characteristics of the first edge
@@ -90,9 +89,7 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
else {
curv1 = BRep_Tool::Curve(Edge1, loc, first1, last1);
if (curv1.IsNull())
{
return -1;
}
throw Standard_NullObject("Null 3D curve in edge");
curv1 =
Handle(Geom_Curve)::DownCast(curv1->Transformed(loc.Transformation()));
ff = first1;
@@ -159,9 +156,7 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
else {
curv = BRep_Tool::Curve(Edge2, loc, first2, last2);
if (curv.IsNull())
{
return -1;
}
throw Standard_NullObject("Null 3D curve in edge");
curv =
Handle(Geom_Curve)::DownCast(curv->Transformed(loc.Transformation()));
ff = first2;
@@ -317,12 +312,12 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
//=======================================================================
//function : CreateKPart
//purpose : Returns true if there is no errors occur
//purpose :
//=======================================================================
Standard_Boolean CreateKPart (const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
const Standard_Integer IType,
Handle(Geom_Surface)& Surf)
void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
const Standard_Integer IType,
Handle(Geom_Surface)& Surf)
{
// find the dimension
TopoDS_Vertex V1, V2;
@@ -331,8 +326,6 @@ Standard_Boolean CreateKPart (const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
Standard_Real a1, b1, aa =0., bb =0.;
TopoDS_Vertex v1f,v1l,v2f,v2l;
Standard_Boolean isDone = Standard_True;
// find characteristics of the first edge
Handle(Geom_Curve) C1;
Standard_Boolean degen1 = BRep_Tool::Degenerated(Edge1);
@@ -343,9 +336,7 @@ Standard_Boolean CreateKPart (const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
else {
C1 = BRep_Tool::Curve(Edge1, loc, a1, b1);
if (C1.IsNull())
{
return Standard_False;
}
throw Standard_NullObject("Null 3D curve in edge");
C1 = Handle(Geom_Curve)::DownCast(C1->Transformed(loc.Transformation()));
aa = a1;
bb = b1;
@@ -370,9 +361,7 @@ Standard_Boolean CreateKPart (const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
else {
C2 = BRep_Tool::Curve(Edge2, loc, a1, b1);
if (C2.IsNull())
{
return Standard_False;
}
throw Standard_NullObject("Null 3D curve in edge");
C2 = Handle(Geom_Curve)::DownCast(C2->Transformed(loc.Transformation()));
if (Edge2.Orientation() == TopAbs_REVERSED) {
C2->Reverse();
@@ -507,7 +496,6 @@ Standard_Boolean CreateKPart (const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
// IType incorrect
}
Surf = surface;
return isDone;
}
//=======================================================================
@@ -540,8 +528,7 @@ static TopoDS_Edge CreateNewEdge(const TopoDS_Edge& theEdge, TopTools_DataMapOfS
//=======================================================================
BRepFill_Generator::BRepFill_Generator():
myMutableInput (Standard_True),
myStatus (BRepFill_ThruSectionErrorStatus_NotDone)
myMutableInput (Standard_True)
{
}
@@ -564,8 +551,6 @@ void BRepFill_Generator::AddWire(const TopoDS_Wire& Wire)
void BRepFill_Generator::Perform()
{
myStatus = BRepFill_ThruSectionErrorStatus_Done;
TopoDS_Shell Shell;
TopoDS_Face Face;
TopoDS_Shape S1, S2;
@@ -694,12 +679,6 @@ void BRepFill_Generator::Perform()
// processing of KPart
Standard_Integer IType = DetectKPart(Edge1,Edge2);
if (IType == -1)
{
myStatus = BRepFill_ThruSectionErrorStatus_Null3DCurve;
return;
}
if (IType==0) {
// no part cases
TopLoc_Location L,L1,L2;
@@ -715,10 +694,7 @@ void BRepFill_Generator::Perform()
else {
C1 = BRep_Tool::Curve(Edge1,L1,f1,l1);
if (C1.IsNull())
{
myStatus = BRepFill_ThruSectionErrorStatus_Null3DCurve;
return;
}
throw Standard_NullObject("Null 3D curve in edge");
}
if (degen2) {
Extremities(1) = BRep_Tool::Pnt(V2l);
@@ -728,10 +704,7 @@ void BRepFill_Generator::Perform()
else {
C2 = BRep_Tool::Curve(Edge2,L2,f2,l2);
if (C2.IsNull())
{
myStatus = BRepFill_ThruSectionErrorStatus_Null3DCurve;
return;
}
throw Standard_NullObject("Null 3D curve in edge");
}
// compute the location
@@ -773,11 +746,7 @@ void BRepFill_Generator::Perform()
}
else {
// particular case
if (!CreateKPart(Edge1, Edge2, IType, Surf))
{
myStatus = BRepFill_ThruSectionErrorStatus_Null3DCurve;
return;
}
CreateKPart(Edge1,Edge2,IType,Surf);
B.MakeFace(Face,Surf,Precision::Confusion());
}

View File

@@ -20,7 +20,6 @@
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <BRepFill_ThruSectionErrorStatus.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopoDS_Shell.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
@@ -69,12 +68,6 @@ public:
//! Returns the current mutable input state
Standard_EXPORT Standard_Boolean IsMutableInput() const;
//! Returns status of the operation
BRepFill_ThruSectionErrorStatus GetStatus() const
{
return myStatus;
}
protected:
private:
@@ -85,7 +78,6 @@ private:
TopTools_DataMapOfShapeShape myOldNewShapes;
BRepTools_ReShape myReshaper;
Standard_Boolean myMutableInput;
BRepFill_ThruSectionErrorStatus myStatus;
};

View File

@@ -1,29 +0,0 @@
// Copyright (c) 2022 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepFill_ThruSectionErrorStatus_HeaderFile
#define _BRepFill_ThruSectionErrorStatus_HeaderFile
//! Errors that can occur at thrusection algorithm.
enum BRepFill_ThruSectionErrorStatus
{
BRepFill_ThruSectionErrorStatus_Done, //!< Thrusection algorithm is done
BRepFill_ThruSectionErrorStatus_NotDone, //!< Thrusection algorithm is not done
BRepFill_ThruSectionErrorStatus_NotSameTopology, //!< All profiles have not same topology (they should be all closed or all opened)
BRepFill_ThruSectionErrorStatus_ProfilesInconsistent, //!< Profiles are inconsistent
BRepFill_ThruSectionErrorStatus_WrongUsage, //!< Wrong usage of punctual sections
BRepFill_ThruSectionErrorStatus_Null3DCurve, //!< Null 3D curve in edge
BRepFill_ThruSectionErrorStatus_Failed //!< Thrusection algorithm has failed
};
#endif // _BRepFill_ThruSectionErrorStatus_HeaderFile

View File

@@ -56,7 +56,6 @@
#include <TopTools_MapOfShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <BRepExtrema_ExtCC.hxx>
#include <ShapeFix_Edge.hxx>
static TopoDS_Edge FindEdgeCloseToBisectorPlane(const TopoDS_Vertex& theVertex,
TopoDS_Compound& theComp,
@@ -535,26 +534,6 @@ BRepFill_TrimShellCorner::MakeFacesNonSec(const Standard_Integer
if(bHasNewEdge) {
aNewEdge.Orientation(TopAbs_FORWARD);
// Refer to BrepFill_Sweep.cxx BuildEdge Construct an edge via an iso
gp_Pnt P1, P2;
Standard_Real p11, p12, p21, p22;
P1 = BRep_Tool::Pnt(TopExp::FirstVertex(TopoDS::Edge(aNewEdge)));
P2 = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(aNewEdge)));
TopoDS_Edge aERef = TopoDS::Edge(fit == 1 ? aE1 : aE2);
p11 = P1.Distance(BRep_Tool::Pnt(TopExp::FirstVertex(aERef)));
p22 = P2.Distance(BRep_Tool::Pnt(TopExp::LastVertex(aERef)));
p12 = P1.Distance(BRep_Tool::Pnt(TopExp::LastVertex(aERef)));
p21 = P2.Distance(BRep_Tool::Pnt(TopExp::FirstVertex(aERef)));
if (p11 > p12 && p22 > p21) {
aNewEdge.Reverse();
}
// for nonPlane surface, we should add pCurve
Handle(ShapeFix_Edge) sfe = new ShapeFix_Edge();
sfe->FixAddPCurve(aNewEdge, TopoDS::Face(aFace), Standard_False);
}
TopTools_ListOfShape aOrderedList;

View File

@@ -77,7 +77,6 @@ BRepFill_ShapeLaw.hxx
BRepFill_ShapeLaw.lxx
BRepFill_Sweep.cxx
BRepFill_Sweep.hxx
BRepFill_ThruSectionErrorStatus.hxx
BRepFill_TransitionStyle.hxx
BRepFill_TrimEdgeTool.cxx
BRepFill_TrimEdgeTool.hxx

View File

@@ -44,13 +44,13 @@ BRepFilletAPI_MakeFillet::BRepFilletAPI_MakeFillet(const TopoDS_Shape& S,
//=======================================================================
void BRepFilletAPI_MakeFillet::SetParams(const Standard_Real Tang,
const Standard_Real Tesp,
const Standard_Real T2d,
const Standard_Real TApp3d,
const Standard_Real TolApp2d,
const Standard_Real Fleche)
const Standard_Real Tesp,
const Standard_Real T2d,
const Standard_Real TApp3d,
const Standard_Real TolApp2d,
const Standard_Real Fleche)
{
myBuilder.SetParams(Tang, Tesp, T2d, TApp3d, TolApp2d, Fleche);
myBuilder.SetParams(Tang,Tesp, T2d, TApp3d, TolApp2d, Fleche);
}
//=======================================================================

View File

@@ -802,7 +802,7 @@ static void GetEdgeTol(const TopoDS_Edge& theEdge,
}
if(temp > d2) d2 = temp;
}
d2 = 1.05*sqrt(d2);
d2 = 1.5*sqrt(d2);
theEdTol = d2;
}
@@ -884,6 +884,10 @@ static void UpdShTol(const TopTools_DataMapOfShapeReal& theShToTol,
case TopAbs_VERTEX:
{
const Handle(BRep_TVertex)& aTV = *((Handle(BRep_TVertex)*)&aNsh.TShape());
//
if(aTV->Locked())
throw TopoDS_LockedShape("BRep_Builder::UpdateVertex");
//
if (theVForceUpdate)
aTV->Tolerance(aTol);
else
@@ -961,9 +965,6 @@ static void InternalSameParameter(const TopoDS_Shape& theSh, BRepTools_ReShape&
TopExp_Explorer ex2;
for(ex2.Init(curface,TopAbs_EDGE); ex2.More(); ex2.Next()){
const TopoDS_Edge& E = TopoDS::Edge(ex2.Current());
if (BRep_Tool::Degenerated(E))
continue;
TopoDS_Shape aNe = theReshaper.Value(E);
Standard_Real aNewEtol = -1;
GetEdgeTol(TopoDS::Edge(aNe), curface, aNewEtol);
@@ -1708,8 +1709,8 @@ static void InternalUpdateTolerances(const TopoDS_Shape& theOldShape,
for (iCur=1; iCur<=nbV; iCur++) {
tol=0;
const TopoDS_Vertex& V = TopoDS::Vertex(parents.FindKey(iCur));
gp_Pnt aPV = BRep_Tool::Pnt(V);
Standard_Real aMaxDist = 0.;
Bnd_Box box;
box.Add(BRep_Tool::Pnt(V));
gp_Pnt p3d;
for (lConx.Initialize(parents(iCur)); lConx.More(); lConx.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(lConx.Value());
@@ -1731,10 +1732,8 @@ static void InternalUpdateTolerances(const TopoDS_Shape& theOldShape,
if (!C.IsNull()) { // edge non degenerated
p3d = C->Value(par);
p3d.Transform(L.Transformation());
Standard_Real aDist = p3d.SquareDistance(aPV);
if (aDist > aMaxDist)
aMaxDist = aDist;
}
box.Add(p3d);
}
}
else if (cr->IsCurveOnSurface()) {
const Handle(Geom_Surface)& Su = cr->Surface();
@@ -1746,22 +1745,21 @@ static void InternalUpdateTolerances(const TopoDS_Shape& theOldShape,
gp_Pnt2d p2d = PC->Value(par);
p3d = Su->Value(p2d.X(),p2d.Y());
p3d.Transform(L.Transformation());
Standard_Real aDist = p3d.SquareDistance(aPV);
if (aDist > aMaxDist)
aMaxDist = aDist;
box.Add(p3d);
if (!PC2.IsNull()) {
p2d = PC2->Value(par);
p3d = Su->Value(p2d.X(),p2d.Y());
p3d.Transform(L.Transformation());
aDist = p3d.SquareDistance(aPV);
if (aDist > aMaxDist)
aMaxDist = aDist;
box.Add(p3d);
}
}
itcr.Next();
}
}
tol = Max(tol, sqrt(aMaxDist));
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
box.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
aXmax -= aXmin; aYmax -= aYmin; aZmax -= aZmin;
tol = Max(tol,sqrt(aXmax*aXmax+aYmax*aYmax+aZmax*aZmax));
tol += 2.*Epsilon(tol);
//
Standard_Real aVTol = BRep_Tool::Tolerance(V);

View File

@@ -256,7 +256,7 @@ BRepLib_MakeFace::BRepLib_MakeFace(const TopoDS_Wire& W,
myError = BRepLib_NotPlanar;
return;
}
// build the face and add the wire
BRep_Builder B;
myError = BRepLib_FaceDone;
@@ -264,40 +264,13 @@ BRepLib_MakeFace::BRepLib_MakeFace(const TopoDS_Wire& W,
Standard_Real tol = Max(1.2*FS.ToleranceReached(), FS.Tolerance());
B.MakeFace(TopoDS::Face(myShape),FS.Surface(),FS.Location(),tol);
TopoDS_Wire aW;
if (OnlyPlane)
{
// get rid of degenerative edges in the input wire
BRep_Builder aB;
aB.MakeWire (aW);
TopoDS_Wire aWForw = W;
aWForw.Orientation (TopAbs_FORWARD);
TopoDS_Iterator anIter (aWForw);
for (; anIter.More(); anIter.Next())
{
const TopoDS_Edge& aE = TopoDS::Edge (anIter.Value());
if (!BRep_Tool::Degenerated (aE))
aB.Add (aW, aE);
}
aW.Orientation (W.Orientation()); // return to original orient
aW.Closed (W.Closed());
}
else
{
aW = W;
}
Add (aW);
Add(W);
//
BRepLib::UpdateTolerances(myShape);
//
BRepLib::SameParameter(myShape, tol, Standard_True);
//
if (BRep_Tool::IsClosed(aW))
if (BRep_Tool::IsClosed(W))
CheckInside();
}

View File

@@ -101,21 +101,9 @@ void BRepMesh_CurveTessellator::init()
myEdgeSqTol = BRep_Tool::Tolerance (myEdge);
myEdgeSqTol *= myEdgeSqTol;
Standard_Integer aMinPntThreshold = 2;
switch (myCurve.GetType())
{
case GeomAbs_Circle:
case GeomAbs_Ellipse:
case GeomAbs_Parabola:
case GeomAbs_Hyperbola:
aMinPntThreshold = 4;
break;
const Standard_Integer aMinPntNb = Max(myMinPointsNb,
(myCurve.GetType() == GeomAbs_Circle) ? 4 : 2); //OCC287
default:
break;
}
const Standard_Integer aMinPntNb = Max (myMinPointsNb, aMinPntThreshold); //OCC287
myDiscretTool.Initialize (myCurve,
myCurve.FirstParameter(), myCurve.LastParameter(),
aPreciseAngDef, aPreciseLinDef, aMinPntNb,

View File

@@ -41,7 +41,6 @@
#include <TopoDS_Vertex.hxx>
#include <TopTools_MapOfShape.hxx>
#include <ChFi3d.hxx>
#include <LocalAnalysis_SurfaceContinuity.hxx>
static void CorrectOrientationOfTangent(gp_Vec& TangVec,
const TopoDS_Vertex& aVertex,
@@ -51,12 +50,6 @@ static void CorrectOrientationOfTangent(gp_Vec& TangVec,
if (aVertex.IsSame(Vlast))
TangVec.Reverse();
}
static Standard_Boolean CheckMixedContinuity (const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace1,
const TopoDS_Face& theFace2,
const Standard_Real theAngTol);
//=======================================================================
//function : BRepOffset_Analyse
//purpose :
@@ -112,168 +105,15 @@ static void EdgeAnalyse(const TopoDS_Edge& E,
}
else
{
Standard_Boolean isTwoSplines = (aSurfType1 == GeomAbs_BSplineSurface || aSurfType1 == GeomAbs_BezierSurface) &&
(aSurfType2 == GeomAbs_BSplineSurface || aSurfType2 == GeomAbs_BezierSurface);
Standard_Boolean isMixedConcavity = Standard_False;
if (isTwoSplines)
{
Standard_Real anAngTol = 0.1;
isMixedConcavity = CheckMixedContinuity(E, F1, F2, anAngTol);
}
if (!isMixedConcavity)
{
if (ChFi3d::IsTangentFaces(E, F1, F2)) //weak condition
{
ConnectType = ChFiDS_Tangential;
}
else
{
ConnectType = ChFi3d::DefineConnectType(E, F1, F2, SinTol, Standard_False);
}
}
if (ChFi3d::IsTangentFaces(E, F1, F2)) //weak condition
ConnectType = ChFiDS_Tangential;
else
{
ConnectType = ChFiDS_Mixed;
}
ConnectType = ChFi3d::DefineConnectType(E, F1, F2, SinTol, Standard_False);
}
I.Type(ConnectType);
LI.Append(I);
}
//=======================================================================
//function : CheckMixedConcavity
//purpose :
//=======================================================================
Standard_Boolean CheckMixedContinuity (const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace1,
const TopoDS_Face& theFace2,
const Standard_Real theAngTol)
{
Standard_Boolean aMixedCont = Standard_False;
GeomAbs_Shape aCurrOrder = BRep_Tool::Continuity(theEdge, theFace1, theFace2);
if (aCurrOrder > GeomAbs_C0)
{
//Method BRep_Tool::Continuity(...) always returns minimal continuity between faces
//so, if aCurrOrder > C0 it means that faces are tangent along whole edge.
return aMixedCont;
}
//But we caqnnot trust result, if it is C0. because this value set by default.
Standard_Real TolC0 = Max(0.001, 1.5*BRep_Tool::Tolerance(theEdge));
Standard_Real aFirst;
Standard_Real aLast;
Handle(Geom2d_Curve) aC2d1, aC2d2;
if (!theFace1.IsSame(theFace2) &&
BRep_Tool::IsClosed(theEdge, theFace1) &&
BRep_Tool::IsClosed(theEdge, theFace2))
{
//Find the edge in the face 1: this edge will have correct orientation
TopoDS_Edge anEdgeInFace1;
TopoDS_Face aFace1 = theFace1;
aFace1.Orientation(TopAbs_FORWARD);
TopExp_Explorer anExplo(aFace1, TopAbs_EDGE);
for (; anExplo.More(); anExplo.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge(anExplo.Current());
if (anEdge.IsSame(theEdge))
{
anEdgeInFace1 = anEdge;
break;
}
}
if (anEdgeInFace1.IsNull())
{
return aMixedCont;
}
aC2d1 = BRep_Tool::CurveOnSurface(anEdgeInFace1, aFace1, aFirst, aLast);
TopoDS_Face aFace2 = theFace2;
aFace2.Orientation(TopAbs_FORWARD);
anEdgeInFace1.Reverse();
aC2d2 = BRep_Tool::CurveOnSurface(anEdgeInFace1, aFace2, aFirst, aLast);
}
else
{
// Obtaining of pcurves of edge on two faces.
aC2d1 = BRep_Tool::CurveOnSurface(theEdge, theFace1, aFirst, aLast);
//For the case of seam edge
TopoDS_Edge EE = theEdge;
if (theFace1.IsSame(theFace2))
{
EE.Reverse();
}
aC2d2 = BRep_Tool::CurveOnSurface(EE, theFace2, aFirst, aLast);
}
if (aC2d1.IsNull() || aC2d2.IsNull())
{
return aMixedCont;
}
// Obtaining of two surfaces from adjacent faces.
Handle(Geom_Surface) aSurf1 = BRep_Tool::Surface(theFace1);
Handle(Geom_Surface) aSurf2 = BRep_Tool::Surface(theFace2);
if (aSurf1.IsNull() || aSurf2.IsNull())
{
return aMixedCont;
}
Standard_Integer aNbSamples = 23;
// Computation of the continuity.
Standard_Real aPar;
Standard_Real aDelta = (aLast - aFirst) / (aNbSamples - 1);
Standard_Integer i, istart = 1;
Standard_Boolean isG1 = Standard_False;
for (i = 1, aPar = aFirst; i <= aNbSamples; i++, aPar += aDelta)
{
if (i == aNbSamples) aPar = aLast;
LocalAnalysis_SurfaceContinuity aCont(aC2d1, aC2d2, aPar,
aSurf1, aSurf2, GeomAbs_G1, 0.001, TolC0, theAngTol, theAngTol, theAngTol);
if (aCont.IsDone())
{
istart = i + 1;
isG1 = aCont.IsG1();
break;
}
}
if (istart > aNbSamples / 2)
{
return aMixedCont;
}
for (i = istart, aPar = aFirst; i <= aNbSamples; i++, aPar += aDelta)
{
if (i == aNbSamples) aPar = aLast;
LocalAnalysis_SurfaceContinuity aCont(aC2d1, aC2d2, aPar,
aSurf1, aSurf2, GeomAbs_G1, 0.001, TolC0, theAngTol, theAngTol, theAngTol);
if (!aCont.IsDone())
{
continue;
}
if (aCont.IsG1() == isG1)
{
continue;
}
else
{
aMixedCont = Standard_True;
break;
}
}
return aMixedCont;
}
//=======================================================================
//function : BuildAncestors

View File

@@ -29,8 +29,7 @@ enum BRepOffset_Error
BRepOffset_CannotTrimEdges, //!< exception while trim edges
BRepOffset_CannotFuseVertices, //!< exception while fuse vertices
BRepOffset_CannotExtentEdge, //!< exception while extent edges
BRepOffset_UserBreak, //!< user break
BRepOffset_MixedConnectivity //!< Different connectivity of faces along edge: partially C0 and tangent
BRepOffset_UserBreak //!< user break
};
#endif // _BRepOffset_Error_HeaderFile

View File

@@ -336,10 +336,8 @@ static BRepOffset_Error checkSinglePoint(const Standard_Real theUParam,
const NCollection_Vector<gp_Pnt>& theBadPoints);
//---------------------------------------------------------------------
static void UpdateTolerance ( TopoDS_Shape& theShape,
const TopTools_IndexedMapOfShape& theFaces,
const TopoDS_Shape& theInitShape);
static void UpdateTolerance ( TopoDS_Shape& myShape,
const TopTools_IndexedMapOfShape& myFaces);
static Standard_Real ComputeMaxDist(const gp_Pln& thePlane,
const Handle(Geom_Curve)& theCrv,
const Standard_Real theFirst,
@@ -910,19 +908,6 @@ void BRepOffset_MakeOffset::MakeOffsetShape(const Message_ProgressRange& theRang
myAnalyse.SetFaceOffsetMap (myFaceOffset);
}
myAnalyse.Perform(myFaceComp,TolAngle, aPS.Next(aSteps(PIOperation_Analyse)));
TopExp_Explorer anEExp(myFaceComp, TopAbs_EDGE);
for (; anEExp.More(); anEExp.Next())
{
const TopoDS_Edge& anE = TopoDS::Edge(anEExp.Current());
const BRepOffset_ListOfInterval& aLI = myAnalyse.Type(anE);
if (aLI.IsEmpty())
continue;
if (aLI.Last().Type() == ChFiDS_Mixed)
{
myError = BRepOffset_MixedConnectivity;
return;
}
}
if (!aPS.More())
{
myError = BRepOffset_UserBreak;
@@ -1051,16 +1036,8 @@ void BRepOffset_MakeOffset::MakeOffsetShape(const Message_ProgressRange& theRang
// MAJ Tolerance edge and Vertex
// ----------------------------
if (!myOffsetShape.IsNull()) {
if (myThickening)
{
UpdateTolerance(myOffsetShape, myFaces, myShape);
}
else
{
TopoDS_Shape aDummy;
UpdateTolerance(myOffsetShape, myFaces, aDummy);
}
BRepLib::UpdateTolerances(myOffsetShape);
UpdateTolerance (myOffsetShape,myFaces);
BRepLib::UpdateTolerances( myOffsetShape );
}
CorrectConicalFaces();
@@ -2973,36 +2950,6 @@ void BRepOffset_MakeOffset::MakeMissingWalls (const Message_ProgressRange& theRa
TopExp::Vertices(anEdge, V1, V2);
Standard_Real aF, aL;
const Handle(Geom_Curve) aC = BRep_Tool::Curve(anEdge, aF, aL);
if (V3.IsNull() && V4.IsNull())
{
// Initially offset edge is created without vertices.
// Then edge is trimmed by intersection line between
// two adjacent extended offset faces and get vertices.
// When intersection lines are invalid for any reason,
// (one of reson is mixed connectivity of faces)
// algoritm of cutting offset edge by intersection line
// can fail and offset edge cannot get vertices.
// Follwing workaround is only to avoid exeption if V3 and V4 are Null
// Vertex points are invalid.
Standard_Real anOEF, anOEL;
TopAbs_Orientation anOEOri = OE.Orientation();
OE.Orientation(TopAbs_FORWARD);
Handle(Geom_Curve) anOEC = BRep_Tool::Curve(OE, anOEF, anOEL);
BRep_Builder aBB;
gp_Pnt aP1 = anOEC->Value(aF);
gp_Pnt aP2 = anOEC->Value(aL);
TopoDS_Vertex anOEV1, anOEV2;
Standard_Real aTol = Max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2));
aBB.MakeVertex(anOEV1, aP1, aTol);
anOEV1.Orientation(TopAbs_FORWARD);
aBB.MakeVertex(anOEV2, aP2, aTol);
anOEV2.Orientation(TopAbs_REVERSED);
aBB.Add(OE, anOEV1);
aBB.Add(OE, anOEV2);
aBB.Range(OE, aF, aL);
OE.Orientation(anOEOri);
TopExp::Vertices(OE, V4, V3);
}
if (!aC.IsNull() &&
(!aC->IsClosed() && !aC->IsPeriodic()))
{
@@ -3218,38 +3165,13 @@ void BRepOffset_MakeOffset::MakeMissingWalls (const Message_ProgressRange& theRa
} //if both edges are arcs of circles
if (NewFace.IsNull())
{
Standard_Real anEdgeTol = BRep_Tool::Tolerance(anEdge);
//Tolerances of input shape should not be increased by BRepLib_MakeFace
BRepLib_FindSurface aFindPlane(theWire, anEdgeTol, Standard_True); //only plane
IsPlanar = Standard_False;
if(aFindPlane.Found() && aFindPlane.ToleranceReached() <= anEdgeTol)
BRepLib_MakeFace MF(theWire, Standard_True); //Only plane
if (MF.Error() == BRepLib_FaceDone)
{
Standard_Real f, l;
Handle(Geom_Curve) aGC = BRep_Tool::Curve(anEdge, f, l);
Handle(Geom_Plane) aPln = Handle(Geom_Plane)::DownCast(aFindPlane.Surface());
Standard_Real aMaxDist = ComputeMaxDist(aPln->Pln(), aGC, f, l);
if (aMaxDist <= anEdgeTol)
{
BRepLib_MakeFace MF(aPln->Pln(), theWire);
if (MF.IsDone())
{
NewFace = MF.Face();
TopoDS_Iterator anItE(theWire);
for (; anItE.More(); anItE.Next())
{
const TopoDS_Edge& anE = TopoDS::Edge(anItE.Value());
if (anE.IsSame(anEdge))
continue;
aGC = BRep_Tool::Curve(anE, f, l);
aMaxDist = ComputeMaxDist(aPln->Pln(), aGC, f, l);
BB.UpdateEdge(anE, aMaxDist);
}
IsPlanar = Standard_True;
}
}
NewFace = MF.Face();
IsPlanar = Standard_True;
}
//
if(!IsPlanar) //Extrusion (by thrusections)
else //Extrusion (by thrusections)
{
Handle(Geom_Curve) EdgeCurve = BRep_Tool::Curve(anEdge, fpar, lpar);
Handle(Geom_TrimmedCurve) TrEdgeCurve =
@@ -3263,6 +3185,7 @@ void BRepOffset_MakeOffset::MakeMissingWalls (const Message_ProgressRange& theRa
ThrusecGenerator.AddCurve( TrOffsetCurve );
ThrusecGenerator.Perform( Precision::PConfusion() );
theSurf = ThrusecGenerator.Surface();
//theSurf = new Geom_SurfaceOfLinearExtrusion( TrOffsetCurve, OffsetDir );
Standard_Real Uf, Ul, Vf, Vl;
theSurf->Bounds(Uf, Ul, Vf, Vl);
TopLoc_Location Loc;
@@ -3349,14 +3272,8 @@ void BRepOffset_MakeOffset::MakeMissingWalls (const Message_ProgressRange& theRa
BB.Range( anE3, FirstPar, LastPar );
}
}
if (!IsPlanar)
{
// For planar faces these operations are useless,
// because there are no curves on surface
BRepLib::SameParameter(NewFace);
BRepTools::Update(NewFace);
}
BRepLib::SameParameter(NewFace);
BRepTools::Update(NewFace);
//Check orientation
TopAbs_Orientation anOr = OrientationOfEdgeInFace(anEdge, aFaceOfEdge);
TopAbs_Orientation OrInNewFace = OrientationOfEdgeInFace(anEdge, NewFace);
@@ -3864,7 +3781,6 @@ void BRepOffset_MakeOffset::EncodeRegularity ()
#endif
}
//=======================================================================
//function : ComputeMaxDist
//purpose :
@@ -3891,15 +3807,13 @@ Standard_Real ComputeMaxDist(const gp_Pln& thePlane,
}
return sqrt(aMaxDist)*1.05;
}
//=======================================================================
//function : UpdateTolerance
//function : UpDateTolerance
//purpose :
//=======================================================================
void UpdateTolerance (TopoDS_Shape& S,
const TopTools_IndexedMapOfShape& Faces,
const TopoDS_Shape& theInitShape)
const TopTools_IndexedMapOfShape& Faces)
{
BRep_Builder B;
TopTools_MapOfShape View;
@@ -3915,31 +3829,12 @@ void UpdateTolerance (TopoDS_Shape& S,
}
}
// The edges of initial shape are not modified
TopTools_MapOfShape aMapInitF;
if (!theInitShape.IsNull())
{
TopExp_Explorer anExpF(theInitShape, TopAbs_FACE);
for (; anExpF.More(); anExpF.Next()) {
aMapInitF.Add(anExpF.Current());
TopExp_Explorer anExpE;
for (anExpE.Init(anExpF.Current(), TopAbs_EDGE); anExpE.More(); anExpE.Next()) {
View.Add(anExpE.Current());
TopoDS_Iterator anItV(anExpE.Current());
for (; anItV.More(); anItV.Next())
{
View.Add(anItV.Value());
}
}
}
}
Standard_Real Tol;
TopExp_Explorer anExpF(S, TopAbs_FACE);
for (; anExpF.More(); anExpF.Next())
TopExp_Explorer ExpF;
for (ExpF.Init(S, TopAbs_FACE); ExpF.More(); ExpF.Next())
{
const TopoDS_Shape& F = anExpF.Current();
if (Faces.Contains(F) || aMapInitF.Contains(F))
const TopoDS_Shape& F = ExpF.Current();
if (Faces.Contains(F))
{
continue;
}
@@ -3948,7 +3843,6 @@ void UpdateTolerance (TopoDS_Shape& S,
for (Exp.Init(F, TopAbs_EDGE); Exp.More(); Exp.Next()) {
TopoDS_Edge E = TopoDS::Edge(Exp.Current());
Standard_Boolean isUpdated = Standard_False;
Standard_Real aCurrTol = BRep_Tool::Tolerance(E);
if (aBAS.GetType() == GeomAbs_Plane)
{
//Edge does not seem to have pcurve on plane,
@@ -3956,22 +3850,17 @@ void UpdateTolerance (TopoDS_Shape& S,
Standard_Real aFirst, aLast;
Handle(Geom_Curve) aCrv = BRep_Tool::Curve(E, aFirst, aLast);
Standard_Real aMaxDist = ComputeMaxDist(aBAS.Plane(), aCrv, aFirst, aLast);
if (aMaxDist > aCurrTol)
{
B.UpdateEdge(E, aMaxDist);
isUpdated = Standard_True;
}
E.Locked (Standard_False);
B.UpdateEdge(E, aMaxDist);
isUpdated = Standard_True;
}
if (View.Add(E))
{
E.Locked(Standard_False);
BRepCheck_Edge EdgeCorrector(E);
Tol = EdgeCorrector.Tolerance();
if (Tol > aCurrTol)
{
B.UpdateEdge(E, Tol);
isUpdated = Standard_True;
}
B.UpdateEdge(E, Tol);
isUpdated = Standard_True;
}
if (isUpdated)
{
@@ -3980,11 +3869,11 @@ void UpdateTolerance (TopoDS_Shape& S,
TopExp::Vertices(E, V[0], V[1]);
for (Standard_Integer i = 0; i <= 1; i++) {
V[i].Locked(Standard_False);
if (View.Add(V[i])) {
Handle(BRep_TVertex) TV = Handle(BRep_TVertex)::DownCast(V[i].TShape());
TV->Tolerance(0.);
BRepCheck_Vertex VertexCorrector(V[i]);
V[i].Locked (Standard_False);
B.UpdateVertex(V[i], VertexCorrector.Tolerance());
// use the occasion to clean the vertices.
(TV->ChangePoints()).Clear();
@@ -5064,53 +4953,6 @@ Standard_Boolean BRepOffset_MakeOffset::IsPlanar()
if (aPlanarityChecker.IsPlanar())
{
gp_Pln aPln = aPlanarityChecker.Plan();
Standard_Real u1, u2, v1, v2, um, vm;
aSurf->Bounds(u1, u2, v1, v2);
Standard_Boolean isInf1 = Precision::IsInfinite(u1), isInf2 = Precision::IsInfinite(u2);
if (!isInf1 && !isInf2)
{
um = (u1 + u2) / 2.;
}
else if(isInf1 && !isInf2)
{
um = u2 - 1.;
}
else if(!isInf1 && isInf2)
{
um = u1 + 1.;
}
else //isInf1 && isInf2
{
um = 0.;
}
isInf1 = Precision::IsInfinite(v1), isInf2 = Precision::IsInfinite(v2);
if (!isInf1 && !isInf2)
{
vm = (v1 + v2) / 2.;
}
else if (isInf1 && !isInf2)
{
vm = v2 - 1.;
}
else if(!isInf1 && isInf2)
{
vm = v1 + 1.;
}
else //isInf1 && isInf2
{
vm = 0.;
}
gp_Pnt aP;
gp_Vec aD1, aD2;
aBAS.D1(um, vm, aP, aD1, aD2);
gp_Vec aNorm = aD1.Crossed(aD2);
gp_Dir aPlnNorm = aPln.Position().Direction();
if (aNorm.Dot(aPlnNorm) < 0.)
{
aPlnNorm.Reverse();
gp_Ax1 anAx(aPln.Position().Location(), aPlnNorm);
aPln.SetAxis(anAx);
}
Handle(Geom_Plane) aPlane = new Geom_Plane(aPln);
TopoDS_Face aPlanarFace;
aBB.MakeFace(aPlanarFace, aPlane, aTolForFace);

View File

@@ -5225,6 +5225,7 @@ void BRepOffset_BuildOffsetFaces::FilterInvalidEdges (const BRepOffset_DataMapOf
const TopTools_ListOfShape* pEOrigins = myOEOrigins.Seek (aE);
if (!pEOrigins)
{
theMEUseInRebuild.Add (aE);
continue;
}
@@ -5392,29 +5393,6 @@ void BRepOffset_BuildOffsetFaces::FindFacesToRebuild()
}
}
namespace
{
//=======================================================================
//function : mapShapes
//purpose : Collect theVecShapes into theMap with setted theType
//=======================================================================
template<class Container>
static void mapShapes (const Container& theVecShapes,
const TopAbs_ShapeEnum theType,
TopTools_MapOfShape& theMap)
{
for (const auto& aShape : theVecShapes)
{
for (TopExp_Explorer anExp(aShape, theType); anExp.More(); anExp.Next())
{
theMap.Add(anExp.Current());
}
}
}
}
//=======================================================================
//function : IntersectFaces
//purpose : Intersection of the faces that should be rebuild to resolve all invalidities
@@ -5737,10 +5715,7 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
TopoDS_Compound aCBE;
aBB.MakeCompound (aCBE);
//
// remember inside edges and vertices to further check
TopTools_MapOfShape anInsideEdges;
TopTools_MapOfShape anInsideVertices;
TopExp_Explorer aExp(aCBInv, TopAbs_EDGE);
TopExp_Explorer aExp (aCBInv, TopAbs_EDGE);
for (; aExp.More(); aExp.Next())
{
const TopoDS_Shape& aE = aExp.Current();
@@ -5749,15 +5724,6 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
if (aMEFence.Add (aE))
{
aBB.Add (aCBE, aE);
if (!myEdgesToAvoid.Contains(aE) && myInvalidEdges.Contains(aE))
{
anInsideEdges.Add(aE);
TopoDS_Iterator anIt(aE);
for (; anIt.More(); anIt.Next())
{
anInsideVertices.Add(anIt.Value());
}
}
}
}
}
@@ -5783,6 +5749,10 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
TopExp::MapShapes (aCBELoc, TopAbs_EDGE, aME);
aMECV = aME;
TopExp::MapShapes (aCBELoc, TopAbs_VERTEX, aME);
//
// Using the map <aME> find chain of faces to be intersected;
//
// faces for intersection
TopTools_IndexedMapOfShape aMFInt;
// additional faces for intersection
TopTools_IndexedMapOfShape aMFIntExt;
@@ -5831,14 +5801,6 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
if (pMFInter && !pInterFi)
continue;
// create map of edges and vertices for aLFImi
TopTools_MapOfShape aMEVIm;
mapShapes(*aLFImi, TopAbs_EDGE, aMEVIm);
mapShapes(*aLFImi, TopAbs_VERTEX, aMEVIm);
Standard_Boolean isIContainsE = aMEVIm.HasIntersection(anInsideEdges);
Standard_Boolean isIContainsV = aMEVIm.HasIntersection(anInsideVertices);
for (j = i + 1; j <= aNb; ++j)
{
const TopoDS_Face& aFj = TopoDS::Face (aMFInt (j));
@@ -5858,28 +5820,6 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
if (!aLFEj)
continue;
// create map of edges and vertices for aLFImi
aMEVIm.Clear();
mapShapes(*aLFImj, TopAbs_EDGE, aMEVIm);
mapShapes(*aLFImj, TopAbs_VERTEX, aMEVIm);
// check images of both faces contain anInsideEdges and anInsideVertices
// not process if false and true
Standard_Boolean isJContainsE = aMEVIm.HasIntersection(anInsideEdges);
Standard_Boolean isJContainsV = aMEVIm.HasIntersection(anInsideVertices);
// Check if one face is connected to inside edge then
// the other must be also connected
if ((isIContainsE && !isJContainsV) ||
(isJContainsE && !isIContainsV))
{
TopTools_ListOfShape aLVC;
// it is necessary to process the images if they already have
// common vertices
FindCommonParts(*aLFImi, *aLFImj, aLVC, TopAbs_VERTEX);
if (aLVC.IsEmpty())
continue;
}
//
// if there are some common edges between faces
// we should use these edges and do not intersect again.

View File

@@ -262,7 +262,6 @@ BRepOffsetAPI_ThruSections::BRepOffsetAPI_ThruSections(const Standard_Boolean is
myCritWeights[1] = .2;
myCritWeights[2] = .4;
myUseSmoothing = Standard_False;
myStatus = BRepFill_ThruSectionErrorStatus_NotDone;
}
@@ -287,7 +286,7 @@ void BRepOffsetAPI_ThruSections::Init(const Standard_Boolean isSolid, const Stan
myCritWeights[1] = .2;
myCritWeights[2] = .4;
myUseSmoothing = Standard_False;
myStatus = BRepFill_ThruSectionErrorStatus_NotDone;
}
@@ -344,7 +343,6 @@ void BRepOffsetAPI_ThruSections::CheckCompatibility(const Standard_Boolean check
void BRepOffsetAPI_ThruSections::Build(const Message_ProgressRange& /*theRange*/)
{
myStatus = BRepFill_ThruSectionErrorStatus_Done;
myBFGenerator.Nullify();
//Check set of section for right configuration of punctual sections
Standard_Integer i;
@@ -358,10 +356,7 @@ void BRepOffsetAPI_ThruSections::Build(const Message_ProgressRange& /*theRange*/
wdeg = wdeg && (BRep_Tool::Degenerated(anEdge));
}
if (wdeg)
{
myStatus = BRepFill_ThruSectionErrorStatus_WrongUsage;
return;
}
throw Standard_Failure("Wrong usage of punctual sections");
}
if (myWires.Length() <= 2)
{
@@ -376,8 +371,7 @@ void BRepOffsetAPI_ThruSections::Build(const Message_ProgressRange& /*theRange*/
}
if (wdeg)
{
myStatus = BRepFill_ThruSectionErrorStatus_WrongUsage;
return;
throw Standard_Failure("Wrong usage of punctual sections");
}
}
@@ -453,13 +447,6 @@ void BRepOffsetAPI_ThruSections::Build(const Message_ProgressRange& /*theRange*/
}
}
}
else
{
myStatus = Georges.GetStatus();
NotDone();
return;
}
myWires = WorkingSections;
} //if (myWCheck)
else //no check
@@ -511,12 +498,6 @@ void BRepOffsetAPI_ThruSections::Build(const Message_ProgressRange& /*theRange*/
NotDone();
return;
}
if (myStatus != BRepFill_ThruSectionErrorStatus_Done)
{
NotDone();
return;
}
// Encode the Regularities
BRepLib::EncodeRegularity(myShape);
}
@@ -539,12 +520,6 @@ void BRepOffsetAPI_ThruSections::CreateRuled()
myBFGenerator->AddWire(TopoDS::Wire(myWires(i)));
}
myBFGenerator->Perform();
BRepFill_ThruSectionErrorStatus aStatus = myBFGenerator->GetStatus();
if (aStatus != BRepFill_ThruSectionErrorStatus_Done)
{
myStatus = aStatus;
return;
}
TopoDS_Shell shell = myBFGenerator->Shell();
if (myIsSolid) {
@@ -764,7 +739,6 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed()
TS = TotalSurf(shapes,nbSects,nbEdges,w1Point,w2Point,vClosed);
if(TS.IsNull()) {
myStatus = BRepFill_ThruSectionErrorStatus_Failed;
return;
}
@@ -960,12 +934,14 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed()
else {
myShape = MakeSolid(shell, newW1, newW2, myPres3d, myFirst, myLast);
}
Done();
}
else {
myShape = shell;
Done();
}
Done();
TopTools_DataMapOfShapeReal aVertexToleranceMap;
TopExp_Explorer aTopExplorer(myShape,TopAbs_EDGE);
@@ -1064,9 +1040,7 @@ static Handle(Geom_BSplineCurve) EdgeToBSpline (const TopoDS_Edge& theEdge)
Standard_Real aFirst, aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve (theEdge, aLoc, aFirst, aLast);
if (aCurve.IsNull())
{
return nullptr;
}
throw Standard_NullObject("Null 3D curve in edge");
// convert its part used by edge to bspline; note that if edge curve is bspline,
// conversion made via trimmed curve is still needed -- it will copy it, segment
@@ -1158,10 +1132,6 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::
// read the first edge to initialise CompBS;
TopoDS_Edge aPrevEdge = TopoDS::Edge (shapes((j-1)*NbEdges+1));
Handle(Geom_BSplineCurve) curvBS = EdgeToBSpline (aPrevEdge);
if (curvBS.IsNull())
{
return nullptr;
}
// initialization
GeomConvert_CompCurveToBSplineCurve CompBS(curvBS);
@@ -1175,10 +1145,6 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::
aTolV = Max(aTolV, BRep_Tool::Tolerance(vl));
aTolV = Min(aTolV, 1.e-3);
curvBS = EdgeToBSpline (aNextEdge);
if (curvBS.IsNull())
{
return nullptr;
}
// concatenation
CompBS.Add(curvBS, aTolV, Standard_True, Standard_False, 1);
@@ -1537,11 +1503,7 @@ void BRepOffsetAPI_ThruSections::CriteriumWeight(Standard_Real& W1, Standard_Rea
void BRepOffsetAPI_ThruSections::SetCriteriumWeight(const Standard_Real W1, const Standard_Real W2, const Standard_Real W3)
{
if (W1 < 0 || W2 < 0 || W3 < 0)
{
myStatus = BRepFill_ThruSectionErrorStatus_Failed;
return;
}
if (W1 < 0 || W2 < 0 || W3 < 0 ) throw Standard_DomainError();
myCritWeights[0] = W1;
myCritWeights[1] = W2;
myCritWeights[2] = W3;

View File

@@ -21,7 +21,6 @@
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepFill_ThruSectionErrorStatus.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopoDS_Face.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
@@ -164,11 +163,6 @@ public:
//! Returns the current mutable input state
Standard_EXPORT Standard_Boolean IsMutableInput() const;
//! Returns the status of thrusection operation
BRepFill_ThruSectionErrorStatus GetStatus() const
{
return myStatus;
}
protected:
@@ -212,7 +206,6 @@ private:
Standard_Boolean myUseSmoothing;
Standard_Boolean myMutableInput;
NCollection_Handle<BRepFill_Generator> myBFGenerator;
BRepFill_ThruSectionErrorStatus myStatus;
};

View File

@@ -281,11 +281,9 @@ static Standard_Integer mkedge(Draw_Interpretor& di, Standard_Integer n, const c
Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[2]);
Handle(Geom2d_Curve) C2d = DrawTrSurf::GetCurve2d(a[2]);
Handle(Poly_Polygon3D) P3d = DrawTrSurf::GetPolygon3D(a[2]);
if (C.IsNull() && C2d.IsNull() && P3d.IsNull()) {
if (C.IsNull() && C2d.IsNull()) {
//std::cout << a[2] << " is not a curve" << std::endl;
di << a[2] << " is not a curve or polygon 3d\n";
di << a[2] << " is not a curve\n";
return 1;
}
@@ -293,12 +291,7 @@ static Standard_Integer mkedge(Draw_Interpretor& di, Standard_Integer n, const c
if (n == 3) {
if (!C.IsNull()) edge = BRepBuilderAPI_MakeEdge(C);
else if (!C2d.IsNull()) edge = BRepBuilderAPI_MakeEdge2d(C2d);
else
{
BRep_Builder aBB;
aBB.MakeEdge(edge, P3d);
}
else edge = BRepBuilderAPI_MakeEdge2d(C2d);
}
else {
Handle(Geom_Surface) S;

View File

@@ -112,7 +112,6 @@ static Standard_Boolean pidef = Standard_False;
static Standard_Boolean lfdef = Standard_False;
static Standard_Boolean rfdef = Standard_False;
static Standard_Real tesp = 1.0e-4;
static Standard_Real t3d = 1.e-4;
static Standard_Real t2d = 1.e-5;
static Standard_Real ta = 1.e-2;
@@ -415,11 +414,6 @@ static void reportOffsetState(Draw_Interpretor& theCommands,
theCommands << "ERROR. Can not extent edge.";
break;
}
case BRepOffset_MixedConnectivity:
{
theCommands << "ERROR. Mixed connectivity of faces.";
break;
}
default:
{
theCommands << "ERROR. offsetperform operation not done.";
@@ -979,10 +973,7 @@ Standard_Integer thickshell(Draw_Interpretor& theCommands,
const BRepOffset_Error aRetCode = B.Error();
reportOffsetState(theCommands, aRetCode);
if (!B.Shape().IsNull())
{
DBRep::Set(a[1], B.Shape());
}
DBRep::Set(a[1], B.Shape());
return 0;
}
@@ -1117,10 +1108,7 @@ Standard_Integer offsetshape(Draw_Interpretor& theCommands,
const BRepOffset_Error aRetCode = B.Error();
reportOffsetState(theCommands, aRetCode);
if (!B.Shape().IsNull())
{
DBRep::Set(a[1], B.Shape());
}
DBRep::Set(a[1], B.Shape());
return 0;
}
@@ -2373,7 +2361,7 @@ static Standard_Integer BOSS(Draw_Interpretor& theCommands,
if (Rakk)
delete Rakk;
Rakk = new BRepFilletAPI_MakeFillet(V, FSh);
Rakk->SetParams(ta, tesp, t2d, t3d, t2d, fl);
Rakk->SetParams(ta, t3d, t2d, t3d, t2d, fl);
Rakk->SetContinuity(blend_cont, tapp_angle);
Standard_Real Rad;
TopoDS_Shape S;

View File

@@ -47,7 +47,7 @@
#include <stdio.h>
static Standard_Real tesp = 1.0e-4;
static Standard_Real t3d = 1.e-4;
static Standard_Real t2d = 1.e-5;
static Standard_Real ta = 1.e-2;
@@ -152,7 +152,7 @@ static Standard_Integer BLEND(Draw_Interpretor& di, Standard_Integer narg, const
}
}
Rakk = new BRepFilletAPI_MakeFillet(V,FSh);
Rakk->SetParams(ta, tesp, t2d, t3d, t2d, fl);
Rakk->SetParams(ta,t3d,t2d,t3d,t2d,fl);
Rakk->SetContinuity(blend_cont, tapp_angle);
Standard_Real Rad;
TopoDS_Edge E;
@@ -254,7 +254,7 @@ static Standard_Integer MKEVOL(Draw_Interpretor& di,
if (narg < 3) return 1;
TopoDS_Shape V = DBRep::Get(a[2]);
Rake = new BRepFilletAPI_MakeFillet(V);
Rake->SetParams(ta, tesp, t2d, t3d, t2d, fl);
Rake->SetParams(ta,t3d,t2d,t3d,t2d,fl);
Rake->SetContinuity(blend_cont, tapp_angle);
if (narg == 4) {
ChFi3d_FilletShape FSh = ChFi3d_Rational;
@@ -410,7 +410,7 @@ Standard_Integer boptopoblend(Draw_Interpretor& di, Standard_Integer narg, const
const TopoDS_Shape& aSolid = Explo.Current();
BRepFilletAPI_MakeFillet Blender(aSolid);
Blender.SetParams(ta, tesp, t2d, t3d, t2d, fl);
Blender.SetParams(ta,t3d,t2d,t3d,t2d,fl);
Blender.SetContinuity( blend_cont, tapp_angle );
TopExp_Explorer expsec( theSection, TopAbs_EDGE );

View File

@@ -443,7 +443,7 @@ Standard_Integer gener(Draw_Interpretor&, Standard_Integer n, const char** a)
//purpose :
//=======================================================================
Standard_Integer thrusections(Draw_Interpretor& di, Standard_Integer n, const char** a)
Standard_Integer thrusections(Draw_Interpretor&, Standard_Integer n, const char** a)
{
if (n < 6) return 1;
@@ -525,30 +525,7 @@ Standard_Integer thrusections(Draw_Interpretor& di, Standard_Integer n, const ch
BRepTest_Objects::SetHistory(Generator->Wires(), *Generator);
}
else {
BRepFill_ThruSectionErrorStatus aStatus = Generator->GetStatus();
switch (aStatus)
{
case BRepFill_ThruSectionErrorStatus_NotDone:
di << "Algorithm is not done\n";
break;
case BRepFill_ThruSectionErrorStatus_NotSameTopology:
di << "The input profiles should be all closed or all opened\n";
break;
case BRepFill_ThruSectionErrorStatus_ProfilesInconsistent:
di << "Profiles inconsistent\n";
break;
case BRepFill_ThruSectionErrorStatus_WrongUsage:
di << "Wrong usage of punctual sections\n";
break;
case BRepFill_ThruSectionErrorStatus_Null3DCurve:
di << "Some edges have null 3d curve";
break;
case BRepFill_ThruSectionErrorStatus_Failed:
di << "Algorithm has failed\n";
break;
default:
break;
}
std::cout << "Algorithm is not done" << std::endl;
}
return 0;

View File

@@ -308,10 +308,15 @@ Standard_Boolean BRepTools_GTrsfModification::NewTriangulation(const TopoDS_Face
// modify normals
if (theTriangulation->HasNormals())
{
for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbTriangles(); ++anInd)
for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbNodes(); ++anInd)
{
gp_Dir aNormal = theTriangulation->Normal(anInd);
aNormal.Transform(aGTrsf.Trsf());
gp_Mat aMat = aGTrsf.VectorialPart();
aMat.SetDiagonal(1., 1., 1.);
gp_Trsf aTrsf;
aTrsf.SetForm(gp_Rotation);
(gp_Mat&)aTrsf.HVectorialPart() = aMat;
aNormal.Transform(aTrsf);
theTriangulation->SetNormal(anInd, aNormal);
}
}

View File

@@ -4234,133 +4234,6 @@ void BSplCLib::Resolution( Standard_Real& Poles,
UTolerance = Tolerance3D / RealSmall();
}
//=======================================================================
// function : Intervals
// purpose :
//=======================================================================
Standard_Integer BSplCLib::Intervals (const TColStd_Array1OfReal& theKnots,
const TColStd_Array1OfInteger& theMults,
Standard_Integer theDegree,
Standard_Boolean isPeriodic,
Standard_Integer theContinuity,
Standard_Real theFirst,
Standard_Real theLast,
Standard_Real theTolerance,
TColStd_Array1OfReal* theIntervals)
{
// remove all knots with multiplicity less or equal than (degree - continuity) except first and last
Standard_Integer aFirstIndex = isPeriodic ? 1 : FirstUKnotIndex (theDegree, theMults);
Standard_Integer aLastIndex = isPeriodic ? theKnots.Size() : LastUKnotIndex (theDegree, theMults);
TColStd_Array1OfReal aNewKnots (1, aLastIndex - aFirstIndex + 1);
Standard_Integer aNbNewKnots = 0;
for (Standard_Integer anIndex = aFirstIndex; anIndex <= aLastIndex; anIndex++)
{
if (theMults(anIndex) > (theDegree - theContinuity) ||
anIndex == aFirstIndex ||
anIndex == aLastIndex)
{
aNbNewKnots++;
aNewKnots(aNbNewKnots) = theKnots[anIndex];
}
}
aNewKnots.Resize (1, aNbNewKnots, Standard_True);
// the range boundaries
Standard_Real aCurFirst = theFirst;
Standard_Real aCurLast = theLast;
Standard_Real aPeriod = 0.0;
Standard_Integer aFirstPeriod = 0;
Standard_Integer aLastPeriod = 0;
// move boundaries into period
if (isPeriodic)
{
Standard_Real aLower = theKnots.First();
Standard_Real anUpper = theKnots.Last();
aPeriod = anUpper - aLower;
while (aCurFirst < aLower)
{
aCurFirst += aPeriod;
aFirstPeriod--;
}
while (aCurLast < aLower)
{
aCurLast += aPeriod;
aLastPeriod--;
}
while (aCurFirst >= anUpper)
{
aCurFirst -= aPeriod;
aFirstPeriod += 1;
}
while (aCurLast >= anUpper)
{
aCurLast -= aPeriod;
aLastPeriod += 1;
}
}
// locate the left and nearest knot for boundaries
Standard_Integer anIndex1 = 0;
Standard_Integer anIndex2 = 0;
Standard_Real aDummyDouble;
// we use version of LocateParameter that doesn't need multiplicities
LocateParameter(theDegree, aNewKnots, TColStd_Array1OfInteger(), aCurFirst, Standard_False, 1, aNbNewKnots, anIndex1, aDummyDouble);
LocateParameter(theDegree, aNewKnots, TColStd_Array1OfInteger(), aCurLast, Standard_False, 1, aNbNewKnots, anIndex2, aDummyDouble);
// the case when the beginning of the range coincides with the next knot
if (anIndex1 < aNbNewKnots && Abs(aNewKnots[anIndex1 + 1] - aCurFirst) < theTolerance)
{
anIndex1 += 1;
}
// the case when the ending of the range coincides with the current knot
if (aNbNewKnots && Abs(aNewKnots[anIndex2] - aCurLast) < theTolerance)
{
anIndex2 -= 1;
}
Standard_Integer aNbIntervals = anIndex2 - anIndex1 + 1 + (aLastPeriod - aFirstPeriod) * (aNbNewKnots - 1);
// fill the interval array
if (theIntervals)
{
theIntervals->Resize (1, aNbIntervals + 1, Standard_False);
if (isPeriodic && aLastPeriod != aFirstPeriod)
{
Standard_Integer anIndex = 1;
// part from the begging of range to the end of the first period
for (Standard_Integer i = anIndex1; i < aNewKnots.Size(); i++, anIndex++)
{
theIntervals->ChangeValue(anIndex) = aNewKnots[i] + aFirstPeriod * aPeriod;
}
// full periods
for (Standard_Integer aPeriodNum = aFirstPeriod + 1; aPeriodNum < aLastPeriod; aPeriodNum++)
{
for (Standard_Integer i = 1; i < aNewKnots.Size(); i++, anIndex++)
{
theIntervals->ChangeValue(anIndex) = aNewKnots[i] + aPeriodNum * aPeriod;
}
}
// part from the begging of the last period to the end of range
for (Standard_Integer i = 1; i <= anIndex2; i++, anIndex++)
{
theIntervals->ChangeValue(anIndex) = aNewKnots[i] + aLastPeriod * aPeriod;
}
}
else
{
Standard_Integer anIndex = 1;
for (Standard_Integer i = anIndex1; i <= anIndex2; i++, anIndex++)
{
theIntervals->ChangeValue(anIndex) = aNewKnots[i] + aFirstPeriod * aPeriod;
}
}
// update the first position (the begging of range doesn't coincide with the knot at anIndex1 in general)
theIntervals->ChangeValue(1) = theFirst;
// write the ending of the range (we didn't write it at all)
theIntervals->ChangeValue(aNbIntervals + 1) = theLast;
}
return aNbIntervals;
}
//=======================================================================
// function: FlatBezierKnots
// purpose :

View File

@@ -1456,26 +1456,8 @@ public:
//! we have |f (u1) - f (u0)| < Tolerance3D
Standard_EXPORT static void Resolution (const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const Standard_Integer NumPoles, const TColStd_Array1OfReal& FlatKnots, const Standard_Integer Degree, const Standard_Real Tolerance3D, Standard_Real& UTolerance);
//! Splits the given range to BSpline intervals of given continuity
//! @param[in] theKnots the knots of BSpline
//! @param[in] theMults the knots' multiplicities
//! @param[in] theDegree the degree of BSpline
//! @param[in] isPeriodic the periodicity of BSpline
//! @param[in] theContinuity the target interval's continuity
//! @param[in] theFirst the begin of the target range
//! @param[in] theLast the end of the target range
//! @param[in] theTolerance the tolerance
//! @param[in,out] theIntervals the array to store intervals if isn't nullptr
//! @return the number of intervals
Standard_EXPORT static Standard_Integer Intervals (const TColStd_Array1OfReal& theKnots,
const TColStd_Array1OfInteger& theMults,
Standard_Integer theDegree,
Standard_Boolean isPeriodic,
Standard_Integer theContinuity,
Standard_Real theFirst,
Standard_Real theLast,
Standard_Real theTolerance,
TColStd_Array1OfReal* theIntervals);
protected:

View File

@@ -515,8 +515,13 @@ BSplCLib::EvalBsplineBasis
//
// this should be always invertible if ii is correctly computed
//
Factor = (Parameter - FlatKnots(ii - qq + pp + 1))
/ (FlatKnots(ii + pp) - FlatKnots(ii - qq + pp + 1)) ;
const Standard_Real aScale = (FlatKnots(ii + pp) - FlatKnots(ii - qq + pp + 1));
if (Abs (aScale) < gp::Resolution())
{
return 2;
}
Factor = (Parameter - FlatKnots(ii - qq + pp + 1)) / aScale;
Saved = Factor * BsplineBasis(1,pp) ;
BsplineBasis(1,pp) *= (1.0e0 - Factor) ;
BsplineBasis(1,pp) += BsplineBasis(1,qq) ;
@@ -536,7 +541,13 @@ BSplCLib::EvalBsplineBasis
}
for (pp = 1 ; pp <= qq - 1 ; pp++) {
Inverse = 1.0e0 / (FlatKnots(ii + pp) - FlatKnots(ii - qq + pp + 1)) ;
const Standard_Real aScale = (FlatKnots(ii + pp) - FlatKnots(ii - qq + pp + 1));
if (Abs (aScale) < gp::Resolution())
{
return 2;
}
Inverse = 1.0e0 / aScale;
Factor = (Parameter - FlatKnots(ii - qq + pp + 1)) * Inverse ;
Saved = Factor * BsplineBasis(1,pp) ;
BsplineBasis(1,pp) *= (1.0e0 - Factor) ;
@@ -1157,97 +1168,82 @@ void BSplCLib::MergeBSplineKnots
index,
num_knots ;
if (StartValue < EndValue - Tolerance) {
TColStd_Array1OfReal knots1(1, Knots1.Length());
TColStd_Array1OfReal knots2(1, Knots2.Length());
degree = Degree1 + Degree2;
index = 1;
TColStd_Array1OfReal knots1(1,Knots1.Length()) ;
TColStd_Array1OfReal knots2(1,Knots2.Length()) ;
degree = Degree1 + Degree2 ;
index = 1 ;
for (ii = Knots1.Lower(); ii <= Knots1.Upper(); ii++) {
knots1(index) = Knots1(ii);
index += 1;
for (ii = Knots1.Lower() ; ii <= Knots1.Upper() ; ii++) {
knots1(index) = Knots1(ii) ;
index += 1 ;
}
index = 1;
index = 1 ;
for (ii = Knots2.Lower(); ii <= Knots2.Upper(); ii++) {
knots2(index) = Knots2(ii);
index += 1;
for (ii = Knots2.Lower() ; ii <= Knots2.Upper() ; ii++) {
knots2(index) = Knots2(ii) ;
index += 1 ;
}
BSplCLib::Reparametrize(StartValue,
EndValue,
knots1);
EndValue,
knots1) ;
BSplCLib::Reparametrize(StartValue,
EndValue,
knots2);
num_knots = 0;
jj = 1;
EndValue,
knots2) ;
num_knots = 0 ;
jj = 1 ;
for (ii = 1; ii <= knots1.Length(); ii++) {
for (ii = 1 ; ii <= knots1.Length() ; ii++) {
while (jj <= knots2.Length() && knots2(jj) <= knots1(ii) - Tolerance) {
jj += 1;
num_knots += 1;
jj += 1 ;
num_knots += 1 ;
}
while (jj <= knots2.Length() && knots2(jj) <= knots1(ii) + Tolerance) {
jj += 1;
jj += 1 ;
}
num_knots += 1;
num_knots += 1 ;
}
NewKnots =
new TColStd_HArray1OfReal(1, num_knots);
NewKnots =
new TColStd_HArray1OfReal(1,num_knots) ;
NewMults =
new TColStd_HArray1OfInteger(1, num_knots);
num_knots = 1;
jj = 1;
new TColStd_HArray1OfInteger(1,num_knots) ;
num_knots = 1 ;
jj = 1 ;
for (ii = 1; ii <= knots1.Length(); ii++) {
for (ii = 1 ; ii <= knots1.Length() ; ii++) {
while (jj <= knots2.Length() && knots2(jj) <= knots1(ii) - Tolerance) {
NewKnots->ChangeArray1()(num_knots) = knots2(jj);
NewMults->ChangeArray1()(num_knots) = Mults2(jj) + Degree1;
jj += 1;
num_knots += 1;
NewKnots->ChangeArray1()(num_knots) = knots2(jj) ;
NewMults->ChangeArray1()(num_knots) = Mults2(jj) + Degree1 ;
jj += 1 ;
num_knots += 1 ;
}
set_mults_flag = 0;
set_mults_flag = 0 ;
while (jj <= knots2.Length() && knots2(jj) <= knots1(ii) + Tolerance) {
continuity = Min(Degree1 - Mults1(ii), Degree2 - Mults2(jj));
set_mults_flag = 1;
NewMults->ChangeArray1()(num_knots) = degree - continuity;
jj += 1;
continuity = Min(Degree1 - Mults1(ii), Degree2 - Mults2(jj)) ;
set_mults_flag = 1 ;
NewMults->ChangeArray1()(num_knots) = degree - continuity ;
jj += 1 ;
}
NewKnots->ChangeArray1()(num_knots) = knots1(ii);
if (!set_mults_flag) {
NewMults->ChangeArray1()(num_knots) = Mults1(ii) + Degree2;
NewKnots->ChangeArray1()(num_knots) = knots1(ii) ;
if (! set_mults_flag) {
NewMults->ChangeArray1()(num_knots) = Mults1(ii) + Degree2 ;
}
num_knots += 1;
num_knots += 1 ;
}
num_knots -= 1;
NewMults->ChangeArray1()(1) = degree + 1;
NewMults->ChangeArray1()(num_knots) = degree + 1;
index = 0;
num_knots -= 1 ;
NewMults->ChangeArray1()(1) = degree + 1 ;
NewMults->ChangeArray1()(num_knots) = degree + 1 ;
index = 0 ;
for (ii = 1; ii <= num_knots; ii++) {
index += NewMults->Value(ii);
for (ii = 1 ; ii <= num_knots ; ii++) {
index += NewMults->Value(ii) ;
}
NumPoles = index - degree - 1;
}
else
{
degree = Degree1 + Degree2;
num_knots = 2;
NewKnots =
new TColStd_HArray1OfReal(1, num_knots);
NewKnots->ChangeArray1()(1) = StartValue;
NewKnots->ChangeArray1()(num_knots) = EndValue;
NewMults =
new TColStd_HArray1OfInteger(1, num_knots);
NewMults->ChangeArray1()(1) = degree + 1;
NewMults->ChangeArray1()(num_knots) = degree + 1;
NumPoles = BSplCLib::NbPoles(degree, Standard_False, NewMults->Array1());
NumPoles = index - degree - 1 ;
}
}

View File

@@ -33,6 +33,7 @@
#include <Storage_Schema.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TDataStd_TreeNode.hxx>
#include <TDF_Attribute.hxx>
#include <TDF_Data.hxx>
#include <TDF_Label.hxx>
@@ -324,7 +325,16 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
// read sub-tree of the root label
if (!theFilter.IsNull())
theFilter->StartIteration();
Standard_Integer nbRead = ReadSubTree (theIStream, aData->Root(), theFilter, aQuickPart, aPS.Next());
const auto aStreamStartPosition = theIStream.tellg();
Standard_Integer nbRead = ReadSubTree (theIStream, aData->Root(), theFilter, aQuickPart, Standard_False, aPS.Next());
if (!myUnresolvedLinks.IsEmpty())
{
// In case we have skipped some linked TreeNodes before getting to
// their children.
theFilter->StartIteration();
theIStream.seekg(aStreamStartPosition, std::ios_base::beg);
nbRead += ReadSubTree(theIStream, aData->Root(), theFilter, aQuickPart, Standard_True, aPS.Next());
}
if (!aPS.More())
{
myReaderStatus = PCDM_RS_UserBreak;
@@ -373,6 +383,7 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
const TDF_Label& theLabel,
const Handle(PCDM_ReaderFilter)& theFilter,
const Standard_Boolean& theQuickPart,
const Standard_Boolean theReadMissing,
const Message_ProgressRange& theRange)
{
Standard_Integer nbRead = 0;
@@ -393,7 +404,7 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
aLabelSize = InverseUint64(aLabelSize);
#endif
// no one sub-label is needed, so, skip everything
if (aSkipAttrs && !theFilter->IsSubPassed())
if (aSkipAttrs && !theFilter->IsSubPassed() && myUnresolvedLinks.IsEmpty())
{
aLabelSize -= sizeof (uint64_t);
theIS.seekg (aLabelSize, std::ios_base::cur);
@@ -403,6 +414,11 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
}
}
if (theReadMissing)
{
aSkipAttrs = Standard_True;
}
const auto anAttStartPosition = theIS.tellg();
// Read attributes:
for (theIS >> myPAtt;
theIS && myPAtt.TypeId() > 0 && // not an end marker ?
@@ -415,6 +431,12 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
myReaderStatus = PCDM_RS_UserBreak;
return -1;
}
if (myUnresolvedLinks.Remove(myPAtt.Id()) && aSkipAttrs)
{
aSkipAttrs = Standard_False;
theIS.seekg(anAttStartPosition, std::ios_base::beg);
continue;
}
if (aSkipAttrs)
{
if (myPAtt.IsDirect()) // skip direct written stream
@@ -487,7 +509,17 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
aDriver->TypeName(), Message_Warning);
}
else if (!isBound)
{
myRelocTable.Bind(anID, tAtt);
Handle(TDataStd_TreeNode) aNode = Handle(TDataStd_TreeNode)::DownCast(tAtt);
if (!theFilter.IsNull() && !aNode.IsNull() && !aNode->Father().IsNull() && aNode->Father()->IsNew())
{
Standard_Integer anUnresolvedLink;
myPAtt.SetPosition(BP_HEADSIZE);
myPAtt >> anUnresolvedLink;
myUnresolvedLinks.Add(anUnresolvedLink);
}
}
}
else if (!myMapUnsupported.Contains(myPAtt.TypeId()))
myMsgDriver->Send(aMethStr + "warning: type ID not registered in header: "
@@ -522,7 +554,7 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
// read sub-tree
if (!theFilter.IsNull())
theFilter->Down (aTag);
Standard_Integer nbSubRead = ReadSubTree (theIS, aLab, theFilter, theQuickPart, aPS.Next());
Standard_Integer nbSubRead = ReadSubTree (theIS, aLab, theFilter, theQuickPart, theReadMissing, aPS.Next());
// check for error
if (nbSubRead == -1)
return -1;

View File

@@ -80,6 +80,7 @@ protected:
const TDF_Label& theData,
const Handle(PCDM_ReaderFilter)& theFilter,
const Standard_Boolean& theQuickPart,
const Standard_Boolean theReadMissing,
const Message_ProgressRange& theRanges = Message_ProgressRange());
@@ -125,6 +126,7 @@ private:
BinObjMgt_Persistent myPAtt;
TColStd_MapOfInteger myMapUnsupported;
BinLDrivers_VectorOfDocumentSection mySections;
NCollection_Map<Standard_Integer> myUnresolvedLinks;
};

View File

@@ -28,9 +28,9 @@ void Blend_CSWalking::Perform(Blend_CSFunction& Func,
const Standard_Real Pdep,
const Standard_Real Pmax,
const Standard_Real MaxStep,
const Standard_Real Tol3d,
const Standard_Real TolGuide,
const math_Vector& ParDep,
const Standard_Real Tolesp,
const Standard_Real Fleche,
const Standard_Boolean Appro)
{
@@ -40,7 +40,7 @@ void Blend_CSWalking::Perform(Blend_CSFunction& Func,
comptra = Standard_False;
line = new TheLine ();
Standard_Integer Nbvar = Func.NbVariables();
tolpoint3d = Tol3d;
tolesp = Abs(Tolesp);
tolgui = Abs(TolGuide);
fleche = Abs(Fleche);
rebrou = Standard_False;
@@ -68,7 +68,7 @@ void Blend_CSWalking::Perform(Blend_CSFunction& Func,
TopAbs_State situ;
// math_Vector tolerance(1,3),infbound(1,3),supbound(1,3);
math_Vector tolerance(1,Nbvar),infbound(1,Nbvar),supbound(1,Nbvar);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetTolerance(tolerance,tolesp);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -115,8 +115,8 @@ void Blend_CSWalking::Perform(Blend_CSFunction& Func,
Standard_Real U,V,W;
previousP.ParametersOnS(U,V);
W = previousP.ParameterOnC();
TheExtremity P1(previousP.PointOnS(),U,V,previousP.Parameter(),tolpoint3d);
TheExtremity P2(previousP.PointOnC(),W,previousP.Parameter(),tolpoint3d);
TheExtremity P1(previousP.PointOnS(),U,V,previousP.Parameter(),tolesp);
TheExtremity P2(previousP.PointOnC(),W,previousP.Parameter(),tolesp);
if (sens>0.) {
line->SetStartPoints(P1,P2);
}

View File

@@ -39,7 +39,7 @@ Blend_Status Blend_CSWalking::TestArret(Blend_CSFunction& Function,
Blend_Status State1,State2;
IntSurf_TypeTrans tras = IntSurf_Undecided;
if (Function.IsSolution(Sol,tolpoint3d)) {
if (Function.IsSolution(Sol,tolesp)) {
pt1 = Function.PointOnS();
pt2 = Function.PointOnC();
@@ -176,16 +176,15 @@ Blend_Status Blend_CSWalking::CheckDeflectionOnSurf
prevP = previousP.PointOnS();
prevTg = previousP.TangentOnS();
tolu = TheSurfaceTool::UResolution(surf,tolpoint3d);
tolv = TheSurfaceTool::VResolution(surf,tolpoint3d);
tolu = TheSurfaceTool::UResolution(surf,tolesp);
tolv = TheSurfaceTool::VResolution(surf,tolesp);
gp_Vec Corde(prevP,Psurf);
Norme = Corde.SquareMagnitude();
prevNorme = prevTg.SquareMagnitude(); // JAG MODIF 25.04.94
const Standard_Real toler3d = tolpoint3d;
if (Norme <= toler3d * toler3d || prevNorme <= toler3d * toler3d) { // JAG MODIF 25.04.94
if (Norme <= tolesp*tolesp || prevNorme <= tolesp*tolesp) { // JAG MODIF 25.04.94
// il faudra peut etre forcer meme point JAG MODIF 25.04.94
return Blend_SamePoints;
}
@@ -276,20 +275,19 @@ Blend_Status Blend_CSWalking::CheckDeflectionOnCurv
prevP = previousP.PointOnC();
prevTg = previousP.TangentOnC();
tolu = TheCurveTool::Resolution(curv,tolpoint3d);
tolu = TheCurveTool::Resolution(curv,tolesp);
gp_Vec Corde(prevP,Pcurv);
Norme = Corde.SquareMagnitude();
prevNorme = prevTg.SquareMagnitude(); // JAG MODIF 25.04.94
const Standard_Real toler3d = tolpoint3d;
// if (Norme <= tolesp*tolesp || prevNorme <= tolesp*tolesp) { // JAG MODIF 25.04.94
if (Norme <= toler3d * toler3d) { // le 95.01.10
if (Norme <= tolesp*tolesp) { // le 95.01.10
// il faudra peut etre forcer meme point JAG MODIF 25.04.94
return Blend_SamePoints;
}
else if (prevNorme > toler3d * toler3d) {
else if (prevNorme > tolesp*tolesp) {
Cosi = sens*Corde*prevTg;
if (Cosi <0.) { // angle 3d>pi/2. --> retour arriere
return Blend_Backward;
@@ -310,7 +308,7 @@ Blend_Status Blend_CSWalking::CheckDeflectionOnCurv
// Voir s il faut faire le controle sur le signe de prevtg*Tgsurf
if (Tgcurv.Magnitude() <= tolpoint3d) {
if (Tgcurv.Magnitude() <= tolesp) {
return Blend_SamePoints; // GROS BOBARD EN ATTENDANT
}
@@ -320,7 +318,7 @@ Blend_Status Blend_CSWalking::CheckDeflectionOnCurv
return Blend_StepTooLarge;
}
if (prevNorme > toler3d * toler3d) {
if (prevNorme > tolesp*tolesp) {
// Estimation de la fleche courante
/*

View File

@@ -205,7 +205,7 @@ void Blend_CSWalking::MakeExtremity(TheExtremity& Extrem,
// Extrem.SetValue(previousP.PointOnS(),sol(1),sol(2),tolesp);
previousP.ParametersOnS(U,V);
Extrem.SetValue(previousP.PointOnS(),U,V,previousP.Parameter(),tolpoint3d);
Extrem.SetValue(previousP.PointOnS(),U,V,previousP.Parameter(),tolesp);
Iter = domain;

View File

@@ -40,7 +40,7 @@ void Blend_CSWalking::InternalPerform(Blend_CSFunction& Func,
//IntSurf_Transition Tline,Tarc;
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetTolerance(tolerance,tolesp);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -146,9 +146,9 @@ void Blend_CSWalking::InternalPerform(Blend_CSFunction& Func,
*/
previousP.ParametersOnS(U,V);
Exts.SetValue(previousP.PointOnS(),U,V,
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Extc.SetValue(previousP.PointOnC(),previousP.ParameterOnC(),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
// Indiquer que fin sur Bound.
}
else {
@@ -171,9 +171,9 @@ void Blend_CSWalking::InternalPerform(Blend_CSFunction& Func,
*/
previousP.ParametersOnS(U,V);
Exts.SetValue(previousP.PointOnS(),U,V,
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Extc.SetValue(previousP.PointOnC(),previousP.ParameterOnC(),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Arrive = Standard_True;
if (line->NbPoints()>=2) {
// Indiquer qu on s arrete en cours de cheminement
@@ -214,9 +214,9 @@ void Blend_CSWalking::InternalPerform(Blend_CSFunction& Func,
*/
previousP.ParametersOnS(U,V);
Exts.SetValue(previousP.PointOnS(),U,V,
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Extc.SetValue(previousP.PointOnC(),previousP.ParameterOnC(),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
// Indiquer que fin sur Bound.
}
else {
@@ -244,7 +244,7 @@ void Blend_CSWalking::InternalPerform(Blend_CSFunction& Func,
MakeExtremity(Exts,Index,solrst(1),Isvtx,Vtx);
// Extc.SetValue(previousP.PointOnC(),sol(3),tolesp);
Extc.SetValue(previousP.PointOnC(),previousP.ParameterOnC(),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Arrive = Standard_True;
}
break;
@@ -259,9 +259,9 @@ void Blend_CSWalking::InternalPerform(Blend_CSFunction& Func,
*/
previousP.ParametersOnS(U,V);
Exts.SetValue(previousP.PointOnS(),U,V,
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Extc.SetValue(previousP.PointOnC(),previousP.ParameterOnC(),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Arrive = Standard_True;
}
break;

View File

@@ -62,9 +62,9 @@ void Blend_Walking::Perform(Blend_Function& Func,
const Standard_Real Pdep,
const Standard_Real Pmax,
const Standard_Real MaxStep,
const Standard_Real Tol3d,
const Standard_Real TolGuide,
const math_Vector& ParDep,
const Standard_Real Tolesp,
const Standard_Real Fleche,
const Standard_Boolean Appro)
{
@@ -75,7 +75,7 @@ void Blend_Walking::Perform(Blend_Function& Func,
Standard_Boolean doextremities = 1;
if(line.IsNull()) line = new TheLine ();
else {line->Clear();doextremities = 0;}
tolpoint3d = Tol3d;
tolesp = Abs(Tolesp);
tolgui = Abs(TolGuide);
fleche = Abs(Fleche);
rebrou = Standard_False;
@@ -96,7 +96,7 @@ void Blend_Walking::Perform(Blend_Function& Func,
TopAbs_State situ1,situ2;
math_Vector tolerance(1,4),infbound(1,4),supbound(1,4);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetTolerance(tolerance,tolesp);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -143,9 +143,9 @@ void Blend_Walking::Perform(Blend_Function& Func,
if(doextremities){
TheExtremity ptf1 (previousP.PointOnS1(),
sol(1),sol(2),tolpoint3d);
sol(1),sol(2),tolesp);
TheExtremity ptf2 (previousP.PointOnS2(),
sol(3),sol(4),tolpoint3d);
sol(3),sol(4),tolesp);
if (!previousP.IsTangencyPoint()) {
ptf1.SetTangent(previousP.TangentOnS1());
ptf2.SetTangent(previousP.TangentOnS2());
@@ -168,7 +168,7 @@ void Blend_Walking::Perform(Blend_Function& Func,
Standard_Boolean Blend_Walking::PerformFirstSection(Blend_Function& Func,
const Standard_Real Pdep,
math_Vector& ParDep,
const Standard_Real Tol3d,
const Standard_Real Tolesp,
const Standard_Real TolGuide,
TopAbs_State& Pos1,
TopAbs_State& Pos2)
@@ -176,7 +176,7 @@ Standard_Boolean Blend_Walking::PerformFirstSection(Blend_Function& Func,
iscomplete = Standard_False;
comptra = Standard_False;
line = new TheLine ();
tolpoint3d = Tol3d;
tolesp = Abs(Tolesp);
tolgui = Abs(TolGuide);
Pos1 = Pos2 = TopAbs_UNKNOWN;
@@ -185,7 +185,7 @@ Standard_Boolean Blend_Walking::PerformFirstSection(Blend_Function& Func,
Func.Set(param);
math_Vector tolerance(1, 4),infbound(1, 4),supbound(1, 4);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetTolerance(tolerance, tolesp);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld(Func, tolerance, 30);
@@ -220,7 +220,7 @@ Standard_Boolean Blend_Walking::PerformFirstSection (Blend_Function& Func,
const Standard_Real Pdep,
const Standard_Real Pmax,
const math_Vector& ParDep,
const Standard_Real Tol3d,
const Standard_Real Tolesp,
const Standard_Real TolGuide,
const Standard_Boolean RecOnS1,
const Standard_Boolean RecOnS2,
@@ -235,7 +235,7 @@ Standard_Boolean Blend_Walking::PerformFirstSection (Blend_Function& Func,
Standard_Real w1, w2, extrapol;
Standard_Boolean recad1, recad2;
tolpoint3d = Tol3d;
tolesp = Abs(Tolesp);
tolgui = Abs(TolGuide);
if (Pmax - Pdep >= 0.0)
{
@@ -262,7 +262,7 @@ Standard_Boolean Blend_Walking::PerformFirstSection (Blend_Function& Func,
Standard_Real CorrectedU = 0., CorrectedV = 0.;
gp_Pnt CorrectedPnt;
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetTolerance(tolerance, tolesp);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld(Func, tolerance, 30);
@@ -409,9 +409,9 @@ Standard_Boolean Blend_Walking::PerformFirstSection (Blend_Function& Func,
#endif
MakeExtremity(Ext1, Standard_True, Index1, solrst1(1), Isvtx1, Vtx1);
if (ToCorrectOnRst1)
Ext2.SetValue(CorrectedPnt, CorrectedU, CorrectedV, tolpoint3d);
Ext2.SetValue(CorrectedPnt, CorrectedU, CorrectedV, tolesp);
else
Ext2.SetValue(previousP.PointOnS2(), sol(3), sol(4), tolpoint3d);
Ext2.SetValue(previousP.PointOnS2(), sol(3), sol(4), tolesp);
}
break;
@@ -424,9 +424,9 @@ Standard_Boolean Blend_Walking::PerformFirstSection (Blend_Function& Func,
}
#endif
if (ToCorrectOnRst2)
Ext1.SetValue(CorrectedPnt, CorrectedU, CorrectedV, tolpoint3d);
Ext1.SetValue(CorrectedPnt, CorrectedU, CorrectedV, tolesp);
else
Ext1.SetValue(previousP.PointOnS1(), sol(1), sol(2), tolpoint3d);
Ext1.SetValue(previousP.PointOnS1(), sol(1), sol(2), tolesp);
MakeExtremity(Ext2, Standard_False, Index2, solrst2(1), Isvtx2, Vtx2);
}
break;

View File

@@ -41,7 +41,7 @@ Blend_Status Blend_Walking::TestArret(Blend_Function& Function,
IntSurf_TypeTrans tras1,tras2;
Blend_Point curpoint;
Standard_Boolean loctwist1 = Standard_False, loctwist2 = Standard_False;
Standard_Real tolsolu = tolpoint3d;
Standard_Real tolsolu = tolesp;
if ( !TestSolu) tolsolu *= 1000; //Ca doit toujours etre bon
if (Function.IsSolution(sol,tolsolu)) {
@@ -211,8 +211,8 @@ Blend_Status Blend_Walking::CheckDeflection
if(!prevpointistangent){
prevTg = previousP.TangentOnS1();
}
tolu = TheSurfaceTool::UResolution(surf1,tolpoint3d);
tolv = TheSurfaceTool::VResolution(surf1,tolpoint3d);
tolu = TheSurfaceTool::UResolution(surf1,tolesp);
tolv = TheSurfaceTool::VResolution(surf1,tolesp);
}
else {
Psurf = CurPoint.PointOnS2();
@@ -223,8 +223,8 @@ Blend_Status Blend_Walking::CheckDeflection
if(!prevpointistangent){
prevTg = previousP.TangentOnS2();
}
tolu = TheSurfaceTool::UResolution(surf2,tolpoint3d);
tolv = TheSurfaceTool::VResolution(surf2,tolpoint3d);
tolu = TheSurfaceTool::UResolution(surf2,tolesp);
tolv = TheSurfaceTool::VResolution(surf2,tolesp);
}
gp_Vec Corde(prevP,Psurf);
@@ -233,13 +233,12 @@ Blend_Status Blend_Walking::CheckDeflection
if(!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
const Standard_Real toler3d = 0.01 * tolpoint3d;
if (Norme <= toler3d * toler3d){
if (Norme <= tolesp*tolesp){
// il faudra peut etre forcer meme point
return Blend_SamePoints;
}
if(!prevpointistangent){
if(prevNorme <= toler3d * toler3d) {
if(prevNorme <= tolesp*tolesp) {
return Blend_SamePoints;
}
Cosi = sens*Corde*prevTg;

View File

@@ -125,7 +125,7 @@ Standard_Boolean Blend_Walking::Recadre(Blend_FuncInv& FuncInv,
infb(2) -= Extrap;
supb(2) += Extrap;
FuncInv.GetTolerance(toler,0.1 * tolpoint3d);//Il vaut mieux garder un peu de marge
FuncInv.GetTolerance(toler,tolesp/10);//Il vaut mieux garder un peu de marge
math_FunctionSetRoot rsnld(FuncInv,toler,35);
toler *= 10; // Mais on fait les tests correctements
@@ -262,7 +262,7 @@ Standard_Boolean Blend_Walking::Recadre(Blend_FuncInv& FuncInv,
else solrst(1) = pmin;
}
// On verifie le jalon
jalons_Trouve = (FuncInv.IsSolution(solrst,tolpoint3d));
jalons_Trouve = (FuncInv.IsSolution(solrst,tolesp));
}
if (!jalons_Trouve) {
@@ -276,7 +276,7 @@ Standard_Boolean Blend_Walking::Recadre(Blend_FuncInv& FuncInv,
}
else {
rsnld.Root(solrst);
recadre = FuncInv.IsSolution(solrst,tolpoint3d);
recadre = FuncInv.IsSolution(solrst,tolesp);
}
}
@@ -310,7 +310,7 @@ Standard_Boolean Blend_Walking::Recadre(Blend_FuncInv& FuncInv,
// Le probleme a resoudre
FuncInv.Set(OnFirst,thecur);
FuncInv.GetBounds(infb,supb);
FuncInv.GetTolerance(toler,0.1 * tolpoint3d);//Il vaut mieux garder un peu de marge
FuncInv.GetTolerance(toler,tolesp/10);//Il vaut mieux garder un peu de marge
math_FunctionSetRoot aRsnld(FuncInv,toler,35);
toler *= 10; // Mais on fait les tests correctements
// Resolution...
@@ -324,7 +324,7 @@ Standard_Boolean Blend_Walking::Recadre(Blend_FuncInv& FuncInv,
}
else {
aRsnld.Root(solrst);
recadre = FuncInv.IsSolution(solrst,tolpoint3d);
recadre = FuncInv.IsSolution(solrst,tolesp);
}
}
@@ -453,7 +453,7 @@ void Blend_Walking::MakeExtremity(TheExtremity& Extrem,
if (OnFirst) {
Extrem.SetValue(previousP.PointOnS1(),
sol(1),sol(2),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
if (!previousP.IsTangencyPoint())
Extrem.SetTangent(previousP.TangentOnS1());
Iter = recdomain1;
@@ -461,7 +461,7 @@ void Blend_Walking::MakeExtremity(TheExtremity& Extrem,
else {
Extrem.SetValue(previousP.PointOnS2(),
sol(3),sol(4),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
if (!previousP.IsTangencyPoint())
Extrem.SetTangent(previousP.TangentOnS2());
Iter = recdomain2;

View File

@@ -135,7 +135,7 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
//IntSurf_Transition Tline,Tarc;
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetTolerance(tolerance,tolesp);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -173,10 +173,10 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
if (Abs(stepw) < tolgui) {
Ext1.SetValue(previousP.PointOnS1(),
sol(1),sol(2),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Ext2.SetValue(previousP.PointOnS2(),
sol(3),sol(4),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
if (!previousP.IsTangencyPoint()) {
Ext1.SetTangent(previousP.TangentOnS1());
Ext2.SetTangent(previousP.TangentOnS2());
@@ -227,7 +227,7 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
if (recad1) {
Standard_Real wtemp;
wtemp = solrst1(2);
if ((param - wtemp)/sens>= -10*tolgui){
if ((param - wtemp)/sens>= -10*tolesp){
w1 = solrst1(2);
control = Standard_True;
}
@@ -253,7 +253,7 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
if (recad2) {
Standard_Real wtemp;
wtemp = solrst2(2);
if ((param - wtemp)/sens>= -10*tolgui){
if ((param - wtemp)/sens>= -10*tolesp){
w2 = solrst2(2);
control = Standard_True;
}
@@ -505,10 +505,10 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
Arrive = Standard_True;
Ext1.SetValue(previousP.PointOnS1(),
sol(1),sol(2),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
Ext2.SetValue(previousP.PointOnS2(),
sol(3),sol(4),
previousP.Parameter(), tolpoint3d);
previousP.Parameter(), tolesp);
if (!previousP.IsTangencyPoint()) {
Ext1.SetTangent(previousP.TangentOnS1());
Ext2.SetTangent(previousP.TangentOnS2());
@@ -533,10 +533,10 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
if (Abs(stepw) < tolgui) {
Ext1.SetValue(previousP.PointOnS1(),
sol(1),sol(2),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Ext2.SetValue(previousP.PointOnS2(),
sol(3),sol(4),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
if (!previousP.IsTangencyPoint()) {
Ext1.SetTangent(previousP.TangentOnS1());
Ext2.SetTangent(previousP.TangentOnS2());
@@ -584,10 +584,10 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
Arrive = Standard_True;
Ext1.SetValue(previousP.PointOnS1(),
sol(1),sol(2),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Ext2.SetValue(previousP.PointOnS2(),
sol(3),sol(4),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
if (!previousP.IsTangencyPoint()) {
Ext1.SetTangent(previousP.TangentOnS1());
Ext2.SetTangent(previousP.TangentOnS2());
@@ -627,15 +627,15 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
MakeExtremity(Ext1,Standard_True,Index1,
solrst1(1),Isvtx1,Vtx1);
// On blinde le cas singulier ou un des recadrage a planter
if (previousP.PointOnS1().IsEqual(previousP.PointOnS2(), 2.0 * tolpoint3d)) {
if (previousP.PointOnS1().IsEqual(previousP.PointOnS2(), 2*tolesp)) {
Ext2.SetValue(previousP.PointOnS1(),
sol(3),sol(4),tolpoint3d);
sol(3),sol(4),tolesp);
if (Isvtx1) MakeSingularExtremity(Ext2, Standard_False, Vtx1);
}
else {
Ext2.SetValue(previousP.PointOnS2(),
sol(3),sol(4),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
}
Arrive = Standard_True;
}
@@ -661,15 +661,15 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
#endif
// On blinde le cas singulier ou un des recadrage a plante
if (previousP.PointOnS1().IsEqual(previousP.PointOnS2(), 2.0 * tolpoint3d)) {
if (previousP.PointOnS1().IsEqual(previousP.PointOnS2(), 2*tolesp)) {
Ext1.SetValue(previousP.PointOnS2(),
sol(1),sol(2),tolpoint3d);
sol(1),sol(2),tolesp);
if (Isvtx2) MakeSingularExtremity(Ext1, Standard_True, Vtx2);
}
else {
Ext1.SetValue(previousP.PointOnS1(),
sol(1),sol(2),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
}
MakeExtremity(Ext2,Standard_False,Index2,
solrst2(1),Isvtx2,Vtx2);
@@ -698,7 +698,7 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
#endif
if ( (Isvtx1 != Isvtx2) &&
(previousP.PointOnS1().IsEqual(previousP.PointOnS2(), 2.0 * tolpoint3d)) ) {
(previousP.PointOnS1().IsEqual(previousP.PointOnS2(), 2*tolesp)) ) {
// On blinde le cas singulier ou un seul recadrage
// est reconnu comme vertex.
if (Isvtx1) {
@@ -727,10 +727,10 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
#endif
Ext1.SetValue(previousP.PointOnS1(),
sol(1),sol(2),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
Ext2.SetValue(previousP.PointOnS2(),
sol(3),sol(4),
previousP.Parameter(),tolpoint3d);
previousP.Parameter(),tolesp);
if (!previousP.IsTangencyPoint()) {
Ext1.SetTangent(previousP.TangentOnS1());
Ext2.SetTangent(previousP.TangentOnS2());

View File

@@ -198,8 +198,7 @@ void ChFi3d_Builder::Compute()
ChFi3d_InitChron(cl_total);
ChFi3d_InitChron(cl_extent);
#endif
UpdateTolesp();
if (myListStripe.IsEmpty())
throw Standard_Failure("There are no suitable edges for chamfer or fillet");
@@ -336,7 +335,7 @@ void ChFi3d_Builder::Compute()
}
// 05/02/02 akm ^^^
Standard_Integer solidindex = st->SolidIndex();
ChFi3d_FilDS(solidindex,st,DStr,myRegul,tolapp3d,tol2d);
ChFi3d_FilDS(solidindex,st,DStr,myRegul,tolesp,tol2d);
if (!done) break;
}

View File

@@ -849,10 +849,6 @@ private:
Handle(BRepAdaptor_Surface)& HS1,
Handle(BRepAdaptor_Surface)& HS2) const;
//! Assign to tolesp parameter minimal value of spine's tolesp if it is less
//! than default initial value.
Standard_EXPORT void UpdateTolesp();
TopoDS_Shape myShape;
Standard_Real angular;

View File

@@ -325,7 +325,7 @@ ChFi3d_Builder::ChFi3d_Builder(const TopoDS_Shape& S,
myEShMap.Fill(S,TopAbs_EDGE,TopAbs_SHELL);
myVFMap.Fill(S,TopAbs_VERTEX,TopAbs_FACE);
myVEMap.Fill(S,TopAbs_VERTEX,TopAbs_EDGE);
SetParams(Ta, 1.0e-4, 1.e-5, 1.e-4, 1.e-5, 1.e-3);
SetParams(Ta,1.e-4,1.e-5,1.e-4,1.e-5,1.e-3);
SetContinuity(GeomAbs_C1, Ta);
}
@@ -336,7 +336,7 @@ ChFi3d_Builder::ChFi3d_Builder(const TopoDS_Shape& S,
void ChFi3d_Builder::SetParams(const Standard_Real Tang,
const Standard_Real Tesp,
const Standard_Real T2d,
const Standard_Real T2d,
const Standard_Real TApp3d,
const Standard_Real TolApp2d,
const Standard_Real Fleche)
@@ -692,6 +692,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
else{
sst = Spine->LastStatus();
iedge = Spine->NbEdges();
E[0] = Spine->Edges(iedge);
V = Spine->LastVertex();
}
//Before all it is checked if the tangency is not dead.
@@ -702,7 +703,6 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
}
if(sst == ChFiDS_BreakPoint){
Standard_Integer aLocNbG1Connections = 0;
TopTools_ListIteratorOfListOfShape It;//,Jt;
Standard_Boolean sommetpourri = Standard_False;
TopTools_IndexedMapOfOrientedShape EdgesOfV;
@@ -720,10 +720,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
if (!F2.IsNull() && ChFi3d::IsTangentFaces(anEdge, F1, F2, GeomAbs_G2)) //smooth edge
{
if (!F1.IsSame(F2))
{
NbG1Connections++;
aLocNbG1Connections++;
}
continue;
}
@@ -762,7 +759,7 @@ void ChFi3d_Builder::PerformExtremity (const Handle(ChFiDS_Spine)& Spine)
if (EdgesOfV.Extent() != 3)
sommetpourri = Standard_True;
if(!sommetpourri && aLocNbG1Connections < 4){
if(!sommetpourri){
sst = ChFi3d_EdgeState(E,myEFMap);
}
if(ii==1)Spine->SetFirstStatus(sst);

View File

@@ -188,7 +188,7 @@ static Standard_Boolean BonVoisin(const gp_Pnt& Point,
Standard_Real& XDep,
Standard_Real& YDep,
const ChFiDS_Map& EFMap,
const Standard_Real tol3d)
const Standard_Real tolesp)
{
Standard_Boolean bonvoisin = 1;
Standard_Real winter, Uf, Ul;
@@ -203,7 +203,7 @@ static Standard_Boolean BonVoisin(const gp_Pnt& Point,
const TopoDS_Edge& ecur = TopoDS::Edge(Ex.Current());
if(!ecur.IsSame(cured)){
hc->Initialize(ecur);
Standard_Real tolc = hc->Resolution(tol3d);
Standard_Real tolc = hc->Resolution(tolesp);
if(ChFi3d_InterPlaneEdge(plane,hc,winter,1,tolc)){
gp_Pnt np = hc->Value(winter);
Standard_Real ndist = np.SquareDistance(papp);
@@ -848,7 +848,7 @@ void ChFi3d_Builder::StartSol(const Handle(ChFiDS_Stripe)& Stripe,
const BRepAdaptor_Curve& Ced = Spine->CurrentElementarySpine(iedge);
gp_Pnt pnt = Ced.Value(woned);
if (Projection(PExt, pnt, els, w, tolapp3d) &&
if (Projection(PExt, pnt, els, w, tolesp) &&
PerformFirstSection(Spine,HGuide,Choix,HS1,HS2,
I1,I2,w,SolDep,Pos1,Pos2)) {
P1.SetCoord(SolDep(1),SolDep(2));
@@ -894,7 +894,7 @@ void ChFi3d_Builder::StartSol(const Handle(ChFiDS_Stripe)& Stripe,
// Extrema_LocateExtPC ext(pnt,els,w,1.e-8);
// if(ext.IsDone()){
// w = ext.Point().Parameter();
if (Projection(PExt, pnt, els, w, tolapp3d)) {
if (Projection(PExt, pnt, els, w, tolesp)) {
PerformFirstSection(Spine,HGuide,Choix,HS1,HS2,
I1,I2,w,SolDep,Pos1,Pos2);
gp_Pnt P;
@@ -909,11 +909,11 @@ void ChFi3d_Builder::StartSol(const Handle(ChFiDS_Stripe)& Stripe,
NbChangement++) {
if(Pos1 != TopAbs_IN){
bonvoisin = BonVoisin(P, HS1, f1, plane, cured,
SolDep(1),SolDep(2), myEFMap, tolapp3d);
SolDep(1),SolDep(2), myEFMap, tolesp);
}
if(Pos2 != TopAbs_IN && bonvoisin){
bonvoisin = BonVoisin(P, HS2, f2, plane, cured,
SolDep(3),SolDep(4), myEFMap, tolapp3d);
SolDep(3),SolDep(4), myEFMap, tolesp);
}
if(bonvoisin){
f1 = HS1->Face();
@@ -2712,7 +2712,7 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
pcprev1->D1(prevpar1,pdeb1,vdeb1);
pcnext1->D1(nextpar1,pfin1,vfin1);
Bon1 = ChFi3d_mkbound(S1,PC1,-1,pdeb1,vdeb1,1,
pfin1,vfin1,tolapp3d,2.e-4);
pfin1,vfin1,tolesp,2.e-4);
}
}
else{
@@ -2731,11 +2731,11 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
pdeb1 = PC1->Value(pardeb1);
pfin1 = PC1->Value(parfin1);
Bon1 = ChFi3d_mkbound(S1,PC1,-1,pdeb1,Vdeb1,1,
pfin1,Vfin1,tolapp3d,2.e-4);
pfin1,Vfin1,tolesp,2.e-4);
}
}
else{
Bon1 = ChFi3d_mkbound(S1,PC1,tolapp3d,2.e-4);
Bon1 = ChFi3d_mkbound(S1,PC1,tolesp,2.e-4);
}
if(tw2){
if(!yaprevon2 || !yanexton2){
@@ -2770,7 +2770,7 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
pcprev2->D1(prevpar2,pdeb2,vdeb2);
pcnext2->D1(nextpar2,pfin2,vfin2);
Bon2 = ChFi3d_mkbound(S2,PC2,-1,pdeb2,vdeb2,1,
pfin2,vfin2,tolapp3d,2.e-4);
pfin2,vfin2,tolesp,2.e-4);
}
}
else{
@@ -2789,11 +2789,11 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
pdeb2 = PC2->Value(pardeb2);
pfin2 = PC2->Value(parfin2);
Bon2 = ChFi3d_mkbound(S2,PC2,-1,pdeb2,Vdeb2,1,
pfin2,Vfin2,tolapp3d,2.e-4);
pfin2,Vfin2,tolesp,2.e-4);
}
}
else{
Bon2 = ChFi3d_mkbound(S2,PC2,tolapp3d,2.e-4);
Bon2 = ChFi3d_mkbound(S2,PC2,tolesp,2.e-4);
}
// The parameters of neighbor traces are updated, so
// straight lines uv are pulled.
@@ -2817,8 +2817,8 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
gp_Pnt2d pdebs2 = pcsprev2->Value(prevpar2);
gp_Pnt2d pfins1 = pcsnext1->Value(nextpar1);
gp_Pnt2d pfins2 = pcsnext2->Value(nextpar2);
Bdeb = ChFi3d_mkbound(sprev,pdebs1,pdebs2,tolapp3d,2.e-4);
Bfin = ChFi3d_mkbound(snext,pfins1,pfins2,tolapp3d,2.e-4);
Bdeb = ChFi3d_mkbound(sprev,pdebs1,pdebs2,tolesp,2.e-4);
Bfin = ChFi3d_mkbound(snext,pfins1,pfins2,tolesp,2.e-4);
GeomFill_ConstrainedFilling fil(11,20);
if(pointuon1) fil.Init(Bon2,Bfin,Bdeb,1);
@@ -3046,7 +3046,7 @@ void ChFi3d_Builder::PerformSetOfSurf(Handle(ChFiDS_Stripe)& Stripe,
ChFi3d_InitChron(ch); // init perf for ChFi3d_MakeExtremities
#endif
if(!Simul) ChFi3d_MakeExtremities(Stripe,DStr,myEFMap,tolapp3d,tol2d);
if(!Simul) ChFi3d_MakeExtremities(Stripe,DStr,myEFMap,tolesp,tol2d);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_makextremities); // result perf t_makextremities

View File

@@ -416,7 +416,7 @@ Standard_Boolean ChFi3d_Builder::CompleteData
const Standard_Boolean Gf2)
{
TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
Data->ChangeSurf(DStr.AddSurface(TopOpeBRepDS_Surface(Surfcoin,tolapp3d)));
Data->ChangeSurf(DStr.AddSurface(TopOpeBRepDS_Surface(Surfcoin,tolesp)));
#ifdef DRAW
ChFi3d_SettraceDRAWFIL(Standard_True);
if (ChFi3d_GettraceDRAWFIL()) {
@@ -987,7 +987,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
Standard_Real NewFirst = PFirst;
if(RecP || RecS || RecRst){
if(!TheWalk.PerformFirstSection(Func,FInv,FInvP,FInvC,PFirst,Target,Soldep,
tolapp3d,tolapp2d,TolGuide,RecRst,RecP,RecS,
tolesp,TolGuide,RecRst,RecP,RecS,
NewFirst,ParSol)){
#ifdef OCCT_DEBUG
std::cout<<"ChFi3d_Builder::ComputeData : calculation fail first section"<<std::endl;
@@ -1001,7 +1001,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
while (again < 2){
TheWalk.Perform (Func,FInv,FInvP,FInvC,NewFirst,Last,
MS,tolapp3d,tolapp2d,TolGuide,ParSol,Fleche,Appro);
MS,TolGuide,ParSol,tolesp,Fleche,Appro);
if (!TheWalk.IsDone()) {
#ifdef OCCT_DEBUG
@@ -1119,7 +1119,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
Standard_Real NewFirst = PFirst;
if (RecP1 || RecRst1 || RecP2 || RecRst2) {
if (!TheWalk.PerformFirstSection(Func, FInv1, FInvP1, FInv2, FInvP2, PFirst, Target, Soldep,
tolapp3d, TolGuide, RecRst1, RecP1, RecRst2, RecP2,
tolesp, TolGuide, RecRst1, RecP1, RecRst2, RecP2,
NewFirst, ParSol)){
#ifdef OCCT_DEBUG
std::cout<<"ChFi3d_Builder::ComputeData : fail calculation first section"<<std::endl;
@@ -1133,7 +1133,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
while (again < 2){
TheWalk.Perform (Func, FInv1, FInvP1, FInv2, FInvP2, NewFirst, Last,
MS, tolapp3d, TolGuide, ParSol, Fleche, Appro);
MS, TolGuide, ParSol, tolesp, Fleche, Appro);
if (!TheWalk.IsDone()) {
#ifdef OCCT_DEBUG
@@ -1249,7 +1249,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
Standard_Real NewFirst = PFirst;
if(RecP || RecS || RecRst){
if(!TheWalk.PerformFirstSection(Func,FInv,FInvP,FInvC,PFirst,Target,Soldep,
tolapp3d,tolapp2d,TolGuide,RecRst,RecP,RecS,
tolesp,TolGuide,RecRst,RecP,RecS,
NewFirst,ParSol)){
#ifdef OCCT_DEBUG
@@ -1264,7 +1264,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
while (again < 2){
TheWalk.Perform (Func,FInv,FInvP,FInvC,NewFirst,Last,
MS,tolapp3d,tolapp2d,TolGuide,ParSol,Fleche,Appro);
MS,TolGuide,ParSol,tolesp,Fleche,Appro);
if (!TheWalk.IsDone()) {
#ifdef OCCT_DEBUG
std::cout << "Path not done" << std::endl;
@@ -1375,7 +1375,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
Standard_Real NewFirst = PFirst;
if (RecP1 || RecRst1 || RecP2 || RecRst2) {
if(!TheWalk.PerformFirstSection(Func, FInv1, FInvP1, FInv2, FInvP2, PFirst, Target, Soldep,
tolapp3d, TolGuide, RecRst1, RecP1, RecRst2, RecP2,
tolesp, TolGuide, RecRst1, RecP1, RecRst2, RecP2,
NewFirst,ParSol)){
#ifdef OCCT_DEBUG
@@ -1390,7 +1390,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
while (again < 2){
TheWalk.Perform (Func, FInv1, FInvP1, FInv2, FInvP2, NewFirst, Last,
MS, tolapp3d, TolGuide, ParSol, Fleche, Appro);
MS, TolGuide, ParSol, tolesp, Fleche, Appro);
if (!TheWalk.IsDone()) {
#ifdef OCCT_DEBUG
std::cout << "Path not created" << std::endl;
@@ -1518,7 +1518,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
if(!HS.IsNull()) F2 = HS->Face();
// Path framing variables
Standard_Real TolGuide=tolguide;
Standard_Real TolGuide=tolguide, TolEsp = tolesp;
Standard_Integer nbptmin = 4;
BRepBlend_Walking TheWalk(S1,S2,I1,I2,HGuide);
@@ -1559,7 +1559,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
BP.ParametersOnS1(vec(1),vec(2));
BP.ParametersOnS2(vec(3),vec(4));
Func.Set(param);
if (Func.IsSolution(vec, tolapp3d)) {
if (Func.IsSolution(vec, tolesp)) {
TheWalk.AddSingularPoint(BP);
}
}
@@ -1574,7 +1574,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
BP.ParametersOnS1(vec(1),vec(2));
BP.ParametersOnS2(vec(3),vec(4));
Func.Set(param);
if (Func.IsSolution(vec, tolapp3d)) {
if (Func.IsSolution(vec, tolesp)) {
TheWalk.AddSingularPoint(BP);
}
}
@@ -1587,7 +1587,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
Standard_Real NewFirst = PFirst;
if(RecOnS1 || RecOnS2){
if(!TheWalk.PerformFirstSection(Func,FInv,PFirst,Target,Soldep,
tolapp3d,TolGuide,RecOnS1,RecOnS2,
tolesp,TolGuide,RecOnS1,RecOnS2,
NewFirst,ParSol)){
#ifdef OCCT_DEBUG
std::cout<<"ChFi3d_Builder::ComputeData : calculation fail first section"<<std::endl;
@@ -1617,9 +1617,10 @@ Standard_Boolean ChFi3d_Builder::ComputeData
if(!again && (MS < 5*TolGuide)) MS = 5*TolGuide;
else {
if (5*TolGuide > MS) TolGuide = MS/5;
if (5*TolEsp > MS) TolEsp = MS/5;
}
TheWalk.Perform(Func,FInv,NewFirst,Target,MS,tolapp3d,TolGuide,
ParSol,Fleche,Appro);
TheWalk.Perform(Func,FInv,NewFirst,Target,MS,TolGuide,
ParSol,TolEsp,Fleche,Appro);
if (!TheWalk.IsDone()) {
#ifdef OCCT_DEBUG
std::cout << "Path is not created" << std::endl;
@@ -1775,7 +1776,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
narc2 = Lin->StartPointOnSecond().NbPointOnRst();
if(narc1 != 0) {
ChFi3d_FilCommonPoint(Lin->StartPointOnFirst(),Lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(), tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
debarc1 = Standard_True;
if(!SearchFace(Spine,Data->VertexFirstOnS1(),F1,bif)){
//It is checked if there is not an obstacle.
@@ -1793,7 +1794,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
}
if(narc2 != 0){
ChFi3d_FilCommonPoint(Lin->StartPointOnSecond(),Lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
debarc2 = Standard_True;
if(!SearchFace(Spine,Data->VertexFirstOnS2(),F2,bif)){
//It is checked if it is not an obstacle.
@@ -1830,7 +1831,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
backwContinueFailed = Lin->StartPointOnFirst().ParameterOnGuide() > Target;
else {
ChFi3d_FilCommonPoint(Lin->StartPointOnFirst(),Lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(), tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
debarc1 = Standard_True;
if(!SearchFace(Spine,Data->VertexFirstOnS1(),F1,bif)){
//It is checked if it is not an obstacle.
@@ -1852,7 +1853,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
backwContinueFailed = Lin->StartPointOnSecond().ParameterOnGuide() > Target;
else {
ChFi3d_FilCommonPoint(Lin->StartPointOnSecond(),Lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(), tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
debarc2 = Standard_True;
if(!SearchFace(Spine,Data->VertexFirstOnS2(),F2,bif)){
//It is checked if it is not an obstacle.
@@ -1888,7 +1889,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
narc2 = Lin->EndPointOnSecond().NbPointOnRst();
if(narc1 != 0){
ChFi3d_FilCommonPoint(Lin->EndPointOnFirst(),Lin->TransitionOnS1(),
Standard_False, Data->ChangeVertexLastOnS1(), tolapp3d);
Standard_False, Data->ChangeVertexLastOnS1(),tolesp);
finarc1 = Standard_True;
if(!SearchFace(Spine,Data->VertexLastOnS1(),F1,bif)){
//It is checked if it is not an obstacle.
@@ -1901,7 +1902,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
}
if(narc2 != 0){
ChFi3d_FilCommonPoint(Lin->EndPointOnSecond(),Lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(), tolapp3d);
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
finarc2 = Standard_True;
if(!SearchFace(Spine,Data->VertexLastOnS2(),F2,bif)){
//It is checked if it is not an obstacle.
@@ -1933,7 +1934,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
forwContinueFailed = Lin->EndPointOnFirst().ParameterOnGuide() < Target;
else {
ChFi3d_FilCommonPoint(Lin->EndPointOnFirst(),Lin->TransitionOnS1(),
Standard_False, Data->ChangeVertexLastOnS1(), tolapp3d);
Standard_False, Data->ChangeVertexLastOnS1(),tolesp);
finarc1 = Standard_True;
if(!SearchFace(Spine,Data->VertexLastOnS1(),F1,bif)){
//It is checked if it is not an obstacle.
@@ -1950,7 +1951,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
forwContinueFailed = Lin->EndPointOnSecond().ParameterOnGuide() < Target;
else {
ChFi3d_FilCommonPoint(Lin->EndPointOnSecond(),Lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(), tolapp3d);
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
finarc2 = Standard_True;
if(!SearchFace(Spine,Data->VertexLastOnS2(),F2,bif)){
//On regarde si ce n'est pas un obstacle.
@@ -2124,7 +2125,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
TheWalk.Check2d(Standard_False);
Standard_Real MS = MaxStep;
Standard_Real TolGuide=tolguide;
Standard_Real TolGuide=tolguide, TolEsp = tolesp;
Standard_Integer Nbpnt = 0;
Standard_Real SpFirst = HGuide->FirstParameter();
Standard_Real SpLast = HGuide->LastParameter();
@@ -2144,7 +2145,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
Standard_Real NewFirst = PFirst;
if(RecOnS1 || RecOnS2){
if(!TheWalk.PerformFirstSection(Func,FInv,PFirst,Target,Soldep,
tolapp3d,TolGuide,RecOnS1,RecOnS2,
tolesp,TolGuide,RecOnS1,RecOnS2,
NewFirst,ParSol)){
#ifdef OCCT_DEBUG
std::cout<<"ChFi3d_Builder::SimulData : calculation fail first section"<<std::endl;
@@ -2162,10 +2163,11 @@ Standard_Boolean ChFi3d_Builder::SimulData
if(!again && (MS < 5*TolGuide)) MS = 5*TolGuide;
else {
if (5*TolGuide > MS) TolGuide = MS/5;
if (5*TolEsp > MS) TolEsp = MS/5;
}
TheWalk.Perform(Func,FInv,NewFirst,Target,MS,tolapp3d,TolGuide,
ParSol,Fleche,Appro);
TheWalk.Perform(Func,FInv,NewFirst,Target,MS,TolGuide,
ParSol,TolEsp,Fleche,Appro);
if (!TheWalk.IsDone()) {
#ifdef OCCT_DEBUG

View File

@@ -725,7 +725,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
ChFiDS_CommonPoint saveCPopArc = CPopArc;
c3df = DStr.Curve(FiopArc.LineIndex()).Curve();
inters = IntersUpdateOnSame (HGs,HBs,c3df,Fop,Fv,Arcprol,Vtx,isfirst,10*tolapp3d, // in
inters = IntersUpdateOnSame (HGs,HBs,c3df,Fop,Fv,Arcprol,Vtx,isfirst,10*tolesp, // in
FiopArc,CPopArc,p2dbout,wop); // out
Handle(BRepAdaptor_Curve2d) pced = new BRepAdaptor_Curve2d();
@@ -763,7 +763,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
TopoDS_Edge edgecouture;
Standard_Boolean couture,intcouture=Standard_False;
Standard_Real tolreached = tolapp3d;
Standard_Real tolreached = tolesp;
Standard_Real par1 =0.,par2 =0.;
Standard_Integer indpt = 0,Icurv1 = 0,Icurv2 = 0;
Handle(Geom_TrimmedCurve) curv1,curv2;
@@ -817,7 +817,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
if (!ChFi3d_ComputeCurves(HGs,HBs,Pardeb,Parfin,Cc,
Ps,
Pc,tolapp3d,tol2d,tolreached))
Pc,tolesp,tol2d,tolreached))
throw Standard_Failure("OneCorner : echec calcul intersection");
Udeb = Cc->FirstParameter();
@@ -1238,7 +1238,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
Handle(Geom2d_Curve) zob2dop, zob2dv;
//Standard_Real tolreached;
if (!ChFi3d_ComputeCurves(HBop,HBs,Pardeb,Parfin,zob3d,zob2dop,
zob2dv,tolapp3d,tol2d,tolreached))
zob2dv,tolesp,tol2d,tolreached))
throw Standard_Failure("OneCorner : echec calcul intersection");
Udeb = zob3d->FirstParameter();
@@ -2143,7 +2143,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
const Handle(Geom_Curve)& c3df = DStr.Curve(Fi1.LineIndex()).Curve();
Standard_Real Ufi= Fi2.Parameter(isfirst);
ChFiDS_FaceInterference& Fi = Fd->ChangeInterferenceOnS1();
if (!IntersUpdateOnSame (HGs,HBs,c3df,F1,Face[0],Edge[0],Vtx,isfirst,10*tolapp3d, // in
if (!IntersUpdateOnSame (HGs,HBs,c3df,F1,Face[0],Edge[0],Vtx,isfirst,10*tolesp, // in
Fi,CV1,pfac1,Ufi)) // out
throw Standard_Failure("IntersectionAtEnd: pb intersection Face - Fi");
Fi1 = Fi;
@@ -2155,14 +2155,14 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
paredge2 = proj.LowerDistanceParameter();
}
// update stripe point
TopOpeBRepDS_Point tpoint (CV1.Point(),tolapp3d);
TopOpeBRepDS_Point tpoint (CV1.Point(),tolesp);
indpoint1=DStr.AddPoint(tpoint);
stripe->SetIndexPoint(indpoint1,isfirst,1);
// reset arc of CV1
TopoDS_Vertex vert1,vert2;
TopExp::Vertices(Edge[0],vert1,vert2);
TopAbs_Orientation arcOri = Vtx.IsSame(vert1) ? TopAbs_FORWARD : TopAbs_REVERSED;
CV1.SetArc(tolapp3d,Edge[0],paredge2,arcOri);
CV1.SetArc(tolesp,Edge[0],paredge2,arcOri);
}
else {
if (Hc1.IsNull()) {
@@ -2389,7 +2389,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
const Handle(Geom_Curve)& c3df = DStr.Curve(Fi2.LineIndex()).Curve();
Standard_Real Ufi= Fi1.Parameter(isfirst);
ChFiDS_FaceInterference& Fi = Fd->ChangeInterferenceOnS2();
if (!IntersUpdateOnSame (HGs,HBs,c3df,F2,F,Edge[nb],Vtx,isfirst,10*tolapp3d, // in
if (!IntersUpdateOnSame (HGs,HBs,c3df,F2,F,Edge[nb],Vtx,isfirst,10*tolesp, // in
Fi,CV2,pfac2,Ufi)) // out
throw Standard_Failure("IntersectionAtEnd: pb intersection Face - Fi");
Fi2 = Fi;
@@ -2403,14 +2403,14 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
paredge2 = proj.LowerDistanceParameter();
}
// update stripe point
TopOpeBRepDS_Point tpoint (CV2.Point(),tolapp3d);
TopOpeBRepDS_Point tpoint (CV2.Point(),tolesp);
indpoint2=DStr.AddPoint(tpoint);
stripe->SetIndexPoint(indpoint2,isfirst,2);
// reset arc of CV2
TopoDS_Vertex vert1,vert2;
TopExp::Vertices(Edge[nbface],vert1,vert2);
TopAbs_Orientation arcOri = Vtx.IsSame(vert1) ? TopAbs_FORWARD : TopAbs_REVERSED;
CV2.SetArc(tolapp3d,Edge[nbface],paredge2,arcOri);
CV2.SetArc(tolesp,Edge[nbface],paredge2,arcOri);
}
@@ -2483,7 +2483,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
//////////////////////////////////////////////////////////////////////
if (!ChFi3d_ComputeCurves(HGs,HBs,Pardeb,Parfin,Cc,
Ps,Pc,tolapp3d,tol2d,tolreached,nbface==1)) {
Ps,Pc,tolesp,tol2d,tolreached,nbface==1)) {
PerformMoreThreeCorner (Index,1);
return;
}
@@ -2799,7 +2799,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
Standard_Real aTolreached;
ChFi3d_ComputePCurv(Cc,UV1,UV2,Ps,
DStr.Surface(SDprev->Surf()).Surface(),
p1,p2,tolapp3d,aTolreached);
p1,p2,tolesp,aTolreached);
TopOpeBRepDS_Curve& TCurv = DStr.ChangeCurve(indcurve[nb-1]);
TCurv.Tolerance(Max(TCurv.Tolerance(),aTolreached));
@@ -2858,7 +2858,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
//box.Add(aSurf->Value(UV.X(), UV.Y()));
ChFi3d_ComputeArete(CV1,UV1,CV2,UV2,aSurf, // in
C3d,Ps,p1,p2,tolapp3d,tol2d,aTolreached,0); // out except tolers
C3d,Ps,p1,p2,tolesp,tol2d,aTolreached,0); // out except tolers
indpoint1 = indpoint2 = midIpoint;
gp_Pnt point;
@@ -2890,7 +2890,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
UV1.SetCoord(isUShrink ? 1 : 2, prevSDParam);
UV2.SetCoord(isUShrink ? 1 : 2, prevSDParam);
ChFi3d_ComputePCurv(C3d,UV1,UV2,Pc,aSurf,p1,p2,tolapp3d,aTolreached);
ChFi3d_ComputePCurv(C3d,UV1,UV2,Pc,aSurf,p1,p2,tolesp,aTolreached);
Crv.Tolerance(Max(Crv.Tolerance(),aTolreached));
Interfc= ChFi3d_FilCurveInDS (Icurv,IsurfPrev,Pc,TopAbs::Reverse(orcourbe));
@@ -3974,7 +3974,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index)
Handle(Geom2dAdaptor_Curve) pcprol = new Geom2dAdaptor_Curve(gpcprol);
Standard_Real partemp = BRep_Tool::Parameter(Vtx,Arcprol);
inters = Update(HBs,pcprol,HGs,FiopArc,CPopArc,p2dbout,
isfirst,partemp,wop,10*tolapp3d);
isfirst,partemp,wop,10*tolesp);
}
Handle(BRepAdaptor_Curve2d) pced = new BRepAdaptor_Curve2d();
pced->Initialize(CPadArc.Arc(),Fv);
@@ -3987,7 +3987,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index)
TopoDS_Edge edgecouture;
Standard_Boolean couture,intcouture=Standard_False;
Standard_Real tolreached = tolapp3d;
Standard_Real tolreached = tolesp;
Standard_Real par1 = 0.,par2 = 0.;
Standard_Integer indpt =0,Icurv1 =0,Icurv2 =0;
Handle(Geom_TrimmedCurve) curv1,curv2;
@@ -4039,7 +4039,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index)
if (!ChFi3d_ComputeCurves(HGs,HBs,Pardeb,Parfin,Cc,
Ps,
Pc,tolapp3d,tol2d,tolreached))
Pc,tolesp,tol2d,tolreached))
throw Standard_Failure("OneCorner : failed calculation intersection");
Udeb = Cc->FirstParameter();
@@ -4311,7 +4311,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index)
Handle(Geom2d_Curve) zob2dop, zob2dv;
// Standard_Real tolreached;
if (!ChFi3d_ComputeCurves(HBop,HBs,Pardeb,Parfin,zob3d,zob2dop,
zob2dv,tolapp3d,tol2d,tolreached))
zob2dv,tolesp,tol2d,tolreached))
throw Standard_Failure("OneCorner : echec calcul intersection");
Udeb = zob3d->FirstParameter();

View File

@@ -230,7 +230,7 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
}
gp_Pnt psp1 = Hpivot->Value(parCP1);
gp_Pnt psp2 = Hpivot->Value(parCP2);
Standard_Real sameparam = (psp1.Distance(psp2) < 10.0 * tolapp3d);
Standard_Real sameparam = (psp1.Distance(psp2) < 10 * tolesp);
TopoDS_Face FF1 = TopoDS::Face(DStr.Shape(Fd1->Index(IFaArc1)));
TopoDS_Face FF2 = TopoDS::Face(DStr.Shape(Fd2->Index(IFaArc2)));
@@ -289,10 +289,10 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
Reduce(UIntPC1,UIntPC2,HS1,HS2);
}
Standard_Real tolreached = tolapp3d;
Standard_Real tolreached = tolesp;
if (IFaCo1 == 1 &&
!ChFi3d_ComputeCurves(HS1,HS2,Pardeb,Parfin,Gc,
PGc1,PGc2,tolapp3d,tol2d,tolreached)) {
PGc1,PGc2,tolesp,tol2d,tolreached)) {
#ifdef OCCT_DEBUG
std::cout<<"failed to calculate bevel error interSS"<<std::endl;
#endif
@@ -301,7 +301,7 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
}
else if (IFaCo1 == 2 &&
!ChFi3d_ComputeCurves(HS1,HS2,Parfin,Pardeb,Gc,
PGc1,PGc2,tolapp3d,tol2d,tolreached)) {
PGc1,PGc2,tolesp,tol2d,tolreached)) {
#ifdef OCCT_DEBUG
std::cout<<"failed to calculate bevel error interSS"<<std::endl;
#endif
@@ -451,7 +451,7 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
Standard_Real tolreached;
if (!ChFi3d_ComputeCurves(SmaHS,BigHS,Pardeb,Parfin,Gc,
PGc1,PGc2,tolapp3d,tol2d,tolreached)) {
PGc1,PGc2,tolesp,tol2d,tolreached)) {
#ifdef OCCT_DEBUG
std::cout<<"failed to calculate bevel failed interSS"<<std::endl;
#endif
@@ -573,7 +573,7 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
ChFi3d_BoundFac (*HF, uu1, uu2, vv1, vv2, Standard_True);
if (!ChFi3d_ComputeCurves(HF,BigHS,Pardeb,Parfin,Gc,
PGc1,PGc2,tolapp3d,tol2d,tolreached)) {
PGc1,PGc2,tolesp,tol2d,tolreached)) {
#ifdef OCCT_DEBUG
std::cout<<"fail calculation bevel fail interSS"<<std::endl;
#endif
@@ -638,26 +638,7 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
}
//=======================================================================
//function : UpdateTolesp
//purpose : Update tolesp field to fit it to range of parameter of spine curve
//=======================================================================
void ChFi3d_Builder::UpdateTolesp()
{
ChFiDS_ListIteratorOfListOfStripe itel;
// tolesp = Precision::Infinite();
for (itel.Initialize(myListStripe); itel.More(); itel.Next())
{
Handle(ChFiDS_Stripe)& curStripe = itel.Value();
Handle(ChFiDS_Spine)& Spine = curStripe->ChangeSpine();
const Standard_Real current_stripe_tolesp = Spine->GetTolesp();
if (tolesp > current_stripe_tolesp)
{
tolesp = current_stripe_tolesp;
}
}
}

View File

@@ -2053,7 +2053,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
// Using constraint order > 0 very often causes unpredicable undulations of solution
Standard_Integer degree = 3, nbcurvpnt = 10, nbiter = 1;
Standard_Integer constr = 1; //G1
GeomPlate_BuildPlateSurface PSurf(degree, nbcurvpnt, nbiter, tol2d, tolapp3d, angular);
GeomPlate_BuildPlateSurface PSurf(degree, nbcurvpnt, nbiter, tol2d, tolesp, angular);
// calculation of curves on surface for each stripe
for (ic=0;ic<nedge;ic++) {
gp_Pnt2d p2d1, p2d2;
@@ -2081,7 +2081,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
//Order.SetValue(ic,1);
Order.SetValue(ic, constr);
Handle(GeomPlate_CurveConstraint) Cont =
new GeomPlate_CurveConstraint(HCons,Order.Value(ic),nbcurvpnt,tolapp3d,angular,0.1);
new GeomPlate_CurveConstraint(HCons,Order.Value(ic), nbcurvpnt,tolesp,angular,0.1);
PSurf.Add(Cont);
// calculate indexes of points and of the curve for the DS
@@ -2378,7 +2378,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
if (isG1.Value(ic))
Order.SetValue(n3d,1);
Handle(GeomPlate_CurveConstraint) Cont =
new GeomPlate_CurveConstraint(HCons,Order.Value(n3d),10,tolapp3d,angular,0.1);
new GeomPlate_CurveConstraint(HCons,Order.Value(n3d),10,tolesp,angular,0.1);
PSurf.Add(Cont);
//calculation of curve 3d if it is not a projection
@@ -2502,7 +2502,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
Handle(Adaptor3d_CurveOnSurface) HCons =new Adaptor3d_CurveOnSurface(CurvOnS);
Order.SetValue(n3d,1);
Handle(GeomPlate_CurveConstraint) Cont =
new GeomPlate_CurveConstraint(HCons,Order.Value(n3d),10,tolapp3d,angular,0.1);
new GeomPlate_CurveConstraint(HCons,Order.Value(n3d),10,tolesp,angular,0.1);
PSurf.Add(Cont);
TopOpeBRepDS_Curve tcurv3d( cproj,error);
indcurve3d.SetValue(n3d, DStr.AddCurve(tcurv3d));
@@ -2615,7 +2615,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
Handle(Adaptor3d_CurveOnSurface) HCons =new Adaptor3d_CurveOnSurface(CurvOnS);
Order.SetValue(n3d,0);
Handle(GeomPlate_CurveConstraint) Cont =
new GeomPlate_CurveConstraint(HCons,Order.Value(n3d),10,tolapp3d,angular,0.1);
new GeomPlate_CurveConstraint(HCons,Order.Value(n3d),10,tolesp,angular,0.1);
PSurf.Add(Cont);
TopOpeBRepDS_Curve tcurv3d( ctrim,1.e-4);
indcurve3d.SetValue(n3d, DStr.AddCurve(tcurv3d));

View File

@@ -654,7 +654,7 @@ Standard_Boolean ChFi3d_Builder::SplitKPart
// Cutting of tangency lines (hatching).
Geom2dHatch_Intersector Inter(pitol,pitol);
Geom2dHatch_Hatcher H1(Inter,tol2d,tolapp3d), H2(Inter,tol2d,tolapp3d);
Geom2dHatch_Hatcher H1(Inter,tol2d,tolesp), H2(Inter,tol2d,tolesp);
Standard_Integer ie;
Handle(Geom2d_Curve) C1 = Data->InterferenceOnS1().PCurveOnFace();
Geom2dAdaptor_Curve ll1;

View File

@@ -822,13 +822,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
Data->SetSimul(sec);
Data->Set2dPoints(pf1,pl1,pf2,pl2);
ChFi3d_FilCommonPoint(lin->StartPointOnFirst(),lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(),tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
ChFi3d_FilCommonPoint(lin->EndPointOnFirst(),lin->TransitionOnS1(),
Standard_False,Data->ChangeVertexLastOnS1(),tolapp3d);
Standard_False,Data->ChangeVertexLastOnS1(),tolesp);
ChFi3d_FilCommonPoint(lin->StartPointOnSecond(),lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
ChFi3d_FilCommonPoint(lin->EndPointOnSecond(),lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(),tolapp3d);
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
Standard_Boolean reverse = (!Forward || Inside);
if(intf && reverse){
@@ -932,13 +932,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
Data->SetSimul(sec);
Data->Set2dPoints(pf1,pl1,pf2,pl2);
ChFi3d_FilCommonPoint(lin->StartPointOnFirst(),lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(),tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
ChFi3d_FilCommonPoint(lin->EndPointOnFirst(),lin->TransitionOnS1(),
Standard_False,Data->ChangeVertexLastOnS1(),tolapp3d);
Standard_False,Data->ChangeVertexLastOnS1(),tolesp);
ChFi3d_FilCommonPoint(lin->StartPointOnSecond(),lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
ChFi3d_FilCommonPoint(lin->EndPointOnSecond(),lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(),tolapp3d);
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
Standard_Boolean reverse = (!Forward || Inside);
if(intf && reverse){
@@ -1017,13 +1017,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
Data->SetSimul(sec);
Data->Set2dPoints(pf1,pl1,pf2,pl2);
ChFi3d_FilCommonPoint(lin->StartPointOnFirst(),lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(),tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
ChFi3d_FilCommonPoint(lin->EndPointOnFirst(),lin->TransitionOnS1(),
Standard_False,Data->ChangeVertexLastOnS1(),tolapp3d);
Standard_False,Data->ChangeVertexLastOnS1(),tolesp);
ChFi3d_FilCommonPoint(lin->StartPointOnSecond(),lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
ChFi3d_FilCommonPoint(lin->EndPointOnSecond(),lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(),tolapp3d);
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
Standard_Boolean reverse = (!Forward || Inside);
if(intf && reverse){
@@ -1175,7 +1175,7 @@ Standard_Boolean ChFi3d_ChBuilder::PerformFirstSection
if (chsp.IsNull())
throw Standard_ConstructionError("PerformSurf : this is not the spine of a chamfer");
Standard_Real TolGuide = HGuide->Resolution(tolapp3d);
Standard_Real TolGuide = HGuide->Resolution(tolesp) ;
if (chsp->IsChamfer() == ChFiDS_Sym) {
@@ -1244,7 +1244,7 @@ Standard_Boolean ChFi3d_ChBuilder::PerformFirstSection
}
return TheWalk.PerformFirstSection(*pFunc,Par,SolDep,
tolapp3d,TolGuide,Pos1,Pos2);
tolesp,TolGuide,Pos1,Pos2);
}
else if (chsp->IsChamfer() == ChFiDS_TwoDist) {
Standard_Real dis1, dis2;
@@ -1347,7 +1347,7 @@ Standard_Boolean ChFi3d_ChBuilder::PerformFirstSection
}
return TheWalk.PerformFirstSection(*pFunc,Par,SolDep,
tolapp3d,TolGuide,Pos1,Pos2);
tolesp,TolGuide,Pos1,Pos2);
}
else { //distance and angle
Standard_Real dis1, angle;
@@ -1415,7 +1415,7 @@ Standard_Boolean ChFi3d_ChBuilder::PerformFirstSection
}
return TheWalk.PerformFirstSection(Func,Par,SolDep,
tolapp3d,TolGuide,Pos1,Pos2);
tolesp,TolGuide,Pos1,Pos2);
} //distance and angle
}

View File

@@ -478,7 +478,7 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
if (!ComputeIntersection(DStr,fdpiv,coin,
p3d[fin],p2d[fin],p3d[deb],p2d[deb],
gcpiv,pivpc1,pivpc2,deru,derv,ptbid,
tolapp3d,tol2d,tolrcoinpiv))
tolesp,tol2d,tolrcoinpiv))
throw StdFail_NotDone("echec calcul intersection coin-pivot");
gp_Vec norpiv = deru.Crossed(derv);
@@ -495,7 +495,7 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
if (!ComputeIntersection(DStr,fddeb,coin,
p3d[pivot],p2d1,p3d[fin],p2d2,
gcdeb,debpc1,debpc2,deru,derv,ptbid,
tolapp3d,tol2d,tolrcoindeb))
tolesp,tol2d,tolrcoindeb))
throw StdFail_NotDone("echec calcul intersection coin-deb");
Icf = DStr.AddCurve(TopOpeBRepDS_Curve(gcdeb,tolrcoindeb));
@@ -514,7 +514,7 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
if (!ComputeIntersection(DStr,fdfin,coin,
p3dface,p2d1,p3d[deb],p2d2,
gcfin,finpc1,finpc2,deru,derv,ptbid,
tolapp3d,tol2d,tolrcoinfin))
tolesp,tol2d,tolrcoinfin))
throw StdFail_NotDone("echec calcul intersection coin-face");
Icl = DStr.AddCurve(TopOpeBRepDS_Curve(gcfin,tolrcoinfin));
@@ -543,8 +543,8 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
gaf->Initialize(face[pivot]);
Standard_Real tolr;
ChFi3d_ProjectPCurv(gac,gaf,facepc1,tolapp3d,tolr);
ChFi3d_ProjectPCurv(gac,gas,facepc2,tolapp3d,tolr);
ChFi3d_ProjectPCurv(gac,gaf,facepc1,tolesp,tolr);
ChFi3d_ProjectPCurv(gac,gas,facepc2,tolesp,tolr);
}
}
}
@@ -616,18 +616,18 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
// les bords de coin sont des lignes courbes qui suivent les
// tangentes donnees
Bfac = ChFi3d_mkbound(Fac,PCurveOnFace,sens[deb],p2d[pivot],Tgpiv,
sens[fin],p2d[3],Tg3,tolapp3d,2.e-4);
sens[fin],p2d[3],Tg3,tolesp,2.e-4);
Bpiv = ChFi3d_mkbound(Surf,PCurveOnPiv,sens[deb],p2d[fin],vpfin,
sens[fin],p2d[deb],vpdeb,tolapp3d,2.e-4);
sens[fin],p2d[deb],vpdeb,tolesp,2.e-4);
}
else {
// les bords de coin sont des segments
// Bfac = ChFi3d_mkbound(Fac,PCurveOnFace,p2d[pivot],
// p2d[3],tolesp,2.e-4);
Bfac = ChFi3d_mkbound(Fac,PCurveOnFace,p2d[pivot],
p2d[3],tolapp3d,2.e-4);
p2d[3],tolesp,2.e-4);
Bpiv = ChFi3d_mkbound(Surf,PCurveOnPiv,p2d[fin],
p2d[deb],tolapp3d,2.e-4);
p2d[deb],tolesp,2.e-4);
}
gp_Pnt2d pdeb1 = fddeb->Interference(jf[deb][pivot]).PCurveOnSurf()->Value(p[deb][pivot]);
@@ -637,15 +637,15 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
if (issmooth) {
// il faut homogeneiser, mettre les bords "BoundWithSurf"
Bdeb = ChFi3d_mkbound(DStr.Surface(fddeb->Surf()).Surface(),pdeb1,pdeb2,tolapp3d,2.e-4);
Bfin = ChFi3d_mkbound(DStr.Surface(fdfin->Surf()).Surface(),pfin1,pfin2,tolapp3d,2.e-4);
Bdeb = ChFi3d_mkbound(DStr.Surface(fddeb->Surf()).Surface(),pdeb1,pdeb2,tolesp,2.e-4);
Bfin = ChFi3d_mkbound(DStr.Surface(fdfin->Surf()).Surface(),pfin1,pfin2,tolesp,2.e-4);
}
else {
// ou les 4 bords de type "FreeBoundary"
Bdeb = ChFi3d_mkbound(DStr.Surface(fddeb->Surf()).Surface(),pdeb1,pdeb2,
tolapp3d,2.e-4,Standard_True);
tolesp,2.e-4,Standard_True);
Bfin = ChFi3d_mkbound(DStr.Surface(fdfin->Surf()).Surface(),pfin1,pfin2,
tolapp3d,2.e-4,Standard_True);
tolesp,2.e-4,Standard_True);
}
GeomFill_ConstrainedFilling fil(8,20);
fil.Init(Bpiv,Bfin,Bfac,Bdeb);
@@ -704,7 +704,7 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
ChFi3d_ComputeArete(Pf1,pp1,Pf2,pp2,
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeFirstPCurve(),P1deb,P2deb,
tolapp3d,tol2d,tolreached,0);
tolesp,tol2d,tolreached,0);
TopOpeBRepDS_Curve Tcurv(C3d,tolreached);
Icf = DStr.AddCurve(Tcurv);
}
@@ -733,7 +733,7 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
ChFi3d_ComputeArete(Pl1,pp1,Pl2,pp2,
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeLastPCurve(),P1fin,P2fin,
tolapp3d,tol2d,tolreached,0);
tolesp,tol2d,tolreached,0);
TopOpeBRepDS_Curve Tcurv(C3d,tolreached);
Icl = DStr.AddCurve(Tcurv);
}

View File

@@ -689,13 +689,13 @@ ChFi3d_FilBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
Data->SetSimul(sec);
Data->Set2dPoints(pf1,pl1,pf2,pl2);
ChFi3d_FilCommonPoint(lin->StartPointOnFirst(),lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(),tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
ChFi3d_FilCommonPoint(lin->EndPointOnFirst(),lin->TransitionOnS1(),
Standard_False,Data->ChangeVertexLastOnS1(),tolapp3d);
Standard_False,Data->ChangeVertexLastOnS1(),tolesp);
ChFi3d_FilCommonPoint(lin->StartPointOnSecond(),lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
ChFi3d_FilCommonPoint(lin->EndPointOnSecond(),lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(),tolapp3d);
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
Standard_Boolean reverse = (!Forward || Inside);
if(intf && reverse){
Standard_Boolean ok = Standard_False;
@@ -857,13 +857,13 @@ void ChFi3d_FilBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
// gp_Pnt2d pbid;
Data->Set2dPoints(ppcf,ppcl,pf,pl);
ChFi3d_FilCommonPoint(lin->StartPointOnFirst(),lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
ChFi3d_FilCommonPoint(lin->EndPointOnFirst(),lin->TransitionOnS1(),
Standard_False,Data->ChangeVertexLastOnS2(),tolapp3d);
Standard_False,Data->ChangeVertexLastOnS2(),tolesp);
ChFi3d_FilCommonPoint(lin->StartPointOnSecond(),lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS1(),tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
ChFi3d_FilCommonPoint(lin->EndPointOnSecond(),lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS1(),tolapp3d);
Standard_False, Data->ChangeVertexLastOnS1(),tolesp);
}
//=======================================================================
@@ -989,13 +989,13 @@ void ChFi3d_FilBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
//gp_Pnt2d pbid;
Data->Set2dPoints(pf,pl,ppcf,ppcl);
ChFi3d_FilCommonPoint(lin->StartPointOnFirst(),lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(),tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
ChFi3d_FilCommonPoint(lin->EndPointOnFirst(),lin->TransitionOnS1(),
Standard_False,Data->ChangeVertexLastOnS1(),tolapp3d);
Standard_False,Data->ChangeVertexLastOnS1(),tolesp);
ChFi3d_FilCommonPoint(lin->StartPointOnSecond(),lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
ChFi3d_FilCommonPoint(lin->EndPointOnSecond(),lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(),tolapp3d);
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
}
@@ -1153,13 +1153,13 @@ void ChFi3d_FilBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
// Data->Set2dPoints(pf,pl,pbid,pbid);
ChFi3d_FilCommonPoint(lin->StartPointOnFirst(),lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(),tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
ChFi3d_FilCommonPoint(lin->EndPointOnFirst(),lin->TransitionOnS1(),
Standard_False,Data->ChangeVertexLastOnS1(),tolapp3d);
Standard_False,Data->ChangeVertexLastOnS1(),tolesp);
ChFi3d_FilCommonPoint(lin->StartPointOnSecond(),lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolapp3d);
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
ChFi3d_FilCommonPoint(lin->EndPointOnSecond(),lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(),tolapp3d);
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
}
@@ -1188,14 +1188,14 @@ Standard_Boolean ChFi3d_FilBuilder::PerformFirstSection
{
Handle(ChFiDS_FilSpine) fsp = Handle(ChFiDS_FilSpine)::DownCast(Spine);
if(fsp.IsNull()) throw Standard_ConstructionError("PerformSurf : this is not the spine of a fillet");
Standard_Real TolGuide = HGuide->Resolution(tolapp3d);
Standard_Real TolGuide = HGuide->Resolution(tolesp);
if(fsp->IsConstant()){
BRepBlend_ConstRad Func(S1,S2,HGuide);
Func.Set(fsp->Radius(),Choix);
Func.Set(myShape);
BRepBlend_Walking TheWalk(S1,S2,I1,I2,HGuide);
return TheWalk.PerformFirstSection(Func,Par,SolDep,
tolapp3d,TolGuide,Pos1,Pos2);
tolesp,TolGuide,Pos1,Pos2);
}
else {
BRepBlend_EvolRad Func(S1,S2,HGuide,fsp->Law(HGuide));
@@ -1203,7 +1203,7 @@ Standard_Boolean ChFi3d_FilBuilder::PerformFirstSection
Func.Set(myShape);
BRepBlend_Walking TheWalk(S1,S2,I1,I2,HGuide);
return TheWalk.PerformFirstSection(Func,Par,SolDep,
tolapp3d,TolGuide,Pos1,Pos2);
tolesp,TolGuide,Pos1,Pos2);
}
}

View File

@@ -321,7 +321,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
parCP2 = CP2.ParameterOnArc();
gp_Pnt tst1 = Hpivot->Value(parCP1);
gp_Pnt tst2 = Hpivot->Value(parCP2);
sameparam = tst1.Distance(tst2) <= tolapp3d;
sameparam = tst1.Distance(tst2) <= tolesp;
}
Handle(BRepAdaptor_Surface) HFaCo = new BRepAdaptor_Surface();
Handle(BRepAdaptor_Surface) HFaPiv;
@@ -477,18 +477,18 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch ); // init perf filling
#endif
B1 = ChFi3d_mkbound(surf1,p2df1,p2da1,tolapp3d,2.e-4);
B2 = ChFi3d_mkbound(surf2,p2df2,p2da2,tolapp3d,2.e-4);
B1 = ChFi3d_mkbound(surf1,p2df1,p2da1,tolesp,2.e-4);
B2 = ChFi3d_mkbound(surf2,p2df2,p2da2,tolesp,2.e-4);
Handle(Geom2d_Curve) PCurveOnFace;
Bfac = ChFi3d_mkbound(HFaCo,PCurveOnFace,Sens1,p2dfac1,v2dfac1,
Sens2,p2dfac2,v2dfac2,tolapp3d,2.e-4);
Sens2,p2dfac2,v2dfac2,tolesp,2.e-4);
GeomFill_ConstrainedFilling fil(8,20);
if(sameparam) {
fil.Init(Bfac,B2,B1,1);
}
else {
Handle(Adaptor3d_Curve) HPivTrim = Hpivot->Trim(Min(parCP1,parCP2),Max(parCP1,parCP2),tolesp);
Bpiv = new GeomFill_SimpleBound(HPivTrim,tolapp3d,2.e-4);
Bpiv = new GeomFill_SimpleBound(HPivTrim,tolesp,2.e-4);
fil.Init(Bfac,B2,Bpiv,B1,1);
BRepAdaptor_Curve2d pcpivot;
gp_Vec dArc,dcf;
@@ -597,14 +597,14 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
ChFi3d_ComputeArete(Pf1,pp1,Pf2,pp2,
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeFirstPCurve(),P1deb,P2deb,
tolapp3d,tol2d,tolreached,0);
tolesp,tol2d,tolreached,0);
Standard_Real par1 = sd1->Interference(IFaArc1).Parameter(isfirst1);
pp1 = sd1->Interference(IFaCo1).PCurveOnSurf()->Value(par1);
pp2 = sd1->Interference(IFaArc1).PCurveOnSurf()->Value(par1);
Standard_Real tolr1;
ChFi3d_ComputePCurv(C3d,pp1,pp2,st1->ChangePCurve(isfirst1),
DStr.Surface(sd1->Surf()).Surface(),
P1deb,P2deb,tolapp3d,tolr1);
P1deb,P2deb,tolesp,tolr1);
tolreached = Max(tolreached,tolr1);
TopOpeBRepDS_Curve Tcurv1(C3d,tolreached);
Icf = DStr.AddCurve(Tcurv1);
@@ -624,14 +624,14 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
ChFi3d_ComputeArete(Pl1,pp1,Pl2,pp2,
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeLastPCurve(),P1fin,P2fin,
tolapp3d,tol2d,tolreached,0);
tolesp,tol2d,tolreached,0);
Standard_Real par2 = sd2->Interference(IFaArc2).Parameter(isfirst2);
pp1 = sd2->Interference(IFaCo2).PCurveOnSurf()->Value(par2);
pp2 = sd2->Interference(IFaArc2).PCurveOnSurf()->Value(par2);
Standard_Real tolr2;
ChFi3d_ComputePCurv(C3d,pp1,pp2,st2->ChangePCurve(isfirst2),
DStr.Surface(sd2->Surf()).Surface(),
P1deb,P2deb,tolapp3d,tolr2);
P1deb,P2deb,tolesp,tolr2);
tolreached = Max(tolreached,tolr2);
TopOpeBRepDS_Curve Tcurv2(C3d,tolreached);
Icl = DStr.AddCurve(Tcurv2);
@@ -732,7 +732,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
Handle(Geom_Surface) surfsam = DStr.Surface(sdsam->Surf()).Surface();
Handle(GeomAdaptor_Surface) Hsurfsam = new GeomAdaptor_Surface(surfsam);
Handle(Geom2d_Curve) pcsurfsam;
Bsam = ChFi3d_mkbound(Hsurfsam,pcsurfsam,ppopsam,ppcosam,tolapp3d,2.e-4);
Bsam = ChFi3d_mkbound(Hsurfsam,pcsurfsam,ppopsam,ppcosam,tolesp,2.e-4);
Standard_Real upcopdif = sddif->Interference(ifaopdif).Parameter(isfirstdif);
gp_Pnt2d ppopdif =
sddif->Interference(ifaopdif).PCurveOnSurf()->Value(upcopdif);
@@ -741,7 +741,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
Handle(Geom_Surface) surfdif = DStr.Surface(sddif->Surf()).Surface();
Handle(GeomAdaptor_Surface) Hsurfdif = new GeomAdaptor_Surface(surfdif);
Handle(Geom2d_Curve) pcsurfdif;
Bdif = ChFi3d_mkbound(Hsurfdif,pcsurfdif,ppcodif,ppopdif,tolapp3d,2.e-4);
Bdif = ChFi3d_mkbound(Hsurfdif,pcsurfdif,ppcodif,ppopdif,tolesp,2.e-4);
gp_Pnt2d ppfacsam,ppfacdif;
gp_Pnt PPfacsam,PPfacdif;
gp_Vec VVfacsam,VVfacdif;
@@ -773,7 +773,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
Handle(Geom2d_Curve) pcFopsam = ChFi3d_BuildPCurve(HBRFopsam,
ppfacsam,VVfacsam,
ppfacdif,VVfacdif,1);
Bfac = ChFi3d_mkbound(HBRFopsam,pcFopsam,tolapp3d,2.e-4);
Bfac = ChFi3d_mkbound(HBRFopsam,pcFopsam,tolesp,2.e-4);
GeomFill_ConstrainedFilling fil(8,20);
fil.Init(Bsam,Bdif,Bfac,1);
#if 0
@@ -827,10 +827,10 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
ChFi3d_ComputeArete(Pf1,pp1,Pf2,pp2,
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeFirstPCurve(),P1deb,P2deb,
tolapp3d,tol2d,tolreached,0);
tolesp,tol2d,tolreached,0);
Standard_Real tolr1;
Handle(GeomAdaptor_Curve) HC3d = new GeomAdaptor_Curve(C3d);
ChFi3d_SameParameter(HC3d,pcFopsam,HBRFopsam,tolapp3d,tolr1);
ChFi3d_SameParameter(HC3d,pcFopsam,HBRFopsam,tolesp,tolr1);
tolreached = Max(tolreached,tolr1);
TopOpeBRepDS_Curve Tcurv1(C3d,tolreached);
Icf = DStr.AddCurve(Tcurv1);
@@ -858,10 +858,10 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
ChFi3d_ComputeArete(Pl1,pp1,Pl2,pp2,
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeLastPCurve(),P1fin,P2fin,
tolapp3d,tol2d,tolreached,0);
tolesp,tol2d,tolreached,0);
Standard_Real tolr2;
HC3d->Load(C3d);
ChFi3d_SameParameter(HC3d,pcsurfdif,Hsurfdif,tolapp3d,tolr2);
ChFi3d_SameParameter(HC3d,pcsurfdif,Hsurfdif,tolesp,tolr2);
tolreached = Max(tolreached,tolr2);
TopOpeBRepDS_Curve Tcurv2(C3d,tolreached);
Icl = DStr.AddCurve(Tcurv2);

View File

@@ -307,7 +307,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
pivot = ii; deb = jj; fin = kk;
}
}
if(!c1toric)c1spheric=(Abs(qr[0]-qr[1])<tolapp3d && Abs(qr[0]-qr[2])<tolapp3d);
if(!c1toric)c1spheric=(Abs(qr[0]-qr[1])<tolesp && Abs(qr[0]-qr[2])<tolesp);
}
// Previously to avoid loops the points were always located
@@ -543,14 +543,14 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
Handle(BRepBlend_Line) lin;
Standard_Real ffi = WFirst, lla = WLast + pasmax;
if (Abs(Rdeb-Rfin)<=tolapp3d){
if (Abs(Rdeb-Rfin)<=tolesp){
BRepBlend_ConstRad func(Fac,Surf,cornerspine);
BRepBlend_ConstRadInv finv(Fac,Surf,cornerspine);
func.Set(Rdeb,choix);
func.Set(myShape);
finv.Set(Rdeb,choix);
Standard_Real TolGuide = cornerspine->Resolution(tolapp3d);
Standard_Real TolGuide = cornerspine->Resolution(tolesp);
Standard_Integer intf = 3, intl = 3;
done = ComputeData(coin,cornerspine,NullSpine,lin,Fac,IFac,Surf,ISurf,
@@ -573,7 +573,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
func.Set(choix);
func.Set(myShape);
finv.Set(choix);
Standard_Real TolGuide = cornerspine->Resolution(tolapp3d);
Standard_Real TolGuide = cornerspine->Resolution(tolesp);
Standard_Integer intf = 3, intl = 3;
done = ComputeData(coin,cornerspine,NullSpine,lin,Fac,IFac,Surf,ISurf,
func,finv,ffi,pasmax,locfleche,TolGuide,ffi,lla,
@@ -607,7 +607,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
Handle(Geom2d_Curve) PCurveOnFace;
if(!c1pointu)
Bfac = ChFi3d_mkbound(Fac,PCurveOnFace,sens[deb],pfac1,vfac1,
sens[fin],pfac2,vfac2,tolapp3d,2.e-4);
sens[fin],pfac2,vfac2,tolesp,2.e-4);
Standard_Integer kkk;
gp_Pnt ppbid;
gp_Vec vp1,vp2;
@@ -620,7 +620,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
Handle(Geom2d_Curve) PCurveOnPiv;
// Bpiv = ChFi3d_mkbound(Surf,PCurveOnPiv,sens[deb],psurf1,vp1,
// sens[fin],psurf2,vp2,tolesp,2.e-4);
Bpiv = ChFi3d_mkbound(Surf,PCurveOnPiv,psurf1,psurf2,tolapp3d,2.e-4,0);
Bpiv = ChFi3d_mkbound(Surf,PCurveOnPiv,psurf1,psurf2,tolesp,2.e-4,0);
Standard_Real pardeb2 = p[deb][pivot];
Standard_Real parfin2 = p[fin][pivot];
if(c1pointu){
@@ -642,8 +642,8 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
DStr.Surface(CD[fin]->SetOfSurfData()->
Value(i[fin][pivot])->Surf()).Surface();
Bdeb = ChFi3d_mkbound(sdeb,pdeb1,pdeb2,tolapp3d,2.e-4);
Bfin = ChFi3d_mkbound(sfin,pfin1,pfin2,tolapp3d,2.e-4);
Bdeb = ChFi3d_mkbound(sdeb,pdeb1,pdeb2,tolesp,2.e-4);
Bfin = ChFi3d_mkbound(sfin,pfin1,pfin2,tolesp,2.e-4);
GeomFill_ConstrainedFilling fil(11,20);
if(c1pointu) fil.Init(Bpiv,Bfin,Bdeb,1);
@@ -712,7 +712,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
ChFi3d_ComputeArete(Pf1,pp1,Pf2,pp2,
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeFirstPCurve(),P1deb,P2deb,
tolapp3d,tol2d,tolreached,0);
tolesp,tol2d,tolreached,0);
TopOpeBRepDS_Curve Tcurv1(C3d,tolreached);
Icf = DStr.AddCurve(Tcurv1);
regdeb.SetCurve(Icf);
@@ -732,7 +732,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
ChFi3d_ComputeArete(Pl1,pp1,Pl2,pp2,
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeLastPCurve(),P1fin,P2fin,
tolapp3d,tol2d,tolreached,0);
tolesp,tol2d,tolreached,0);
TopOpeBRepDS_Curve Tcurv2(C3d,tolreached);
Icl = DStr.AddCurve(Tcurv2);
regfin.SetCurve(Icl);
@@ -770,7 +770,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
Standard_Real tolrdeb;
ChFi3d_ComputePCurv(crefdeb,pp1,pp2,CD[deb]->ChangePCurve(isfirst),
DStr.Surface(fddeb->Surf()).Surface(),
P1deb,P2deb,tolapp3d,tolrdeb,rev);
P1deb,P2deb,tolesp,tolrdeb,rev);
tcdeb.Tolerance(Max(tolrdeb,tcdeb.Tolerance()));
if(rev) ChFi3d_EnlargeBox(DStr,CD[deb],fddeb,*pbf2,*pbf1,isfirst);
else ChFi3d_EnlargeBox(DStr,CD[deb],fddeb,*pbf1,*pbf2,isfirst);
@@ -800,7 +800,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
Standard_Real tolrfin;
ChFi3d_ComputePCurv(creffin,pp1,pp2,CD[fin]->ChangePCurve(isfirst),
DStr.Surface(fdfin->Surf()).Surface(),
P1fin,P2fin,tolapp3d,tolrfin,rev);
P1fin,P2fin,tolesp,tolrfin,rev);
tcfin.Tolerance(Max(tolrfin,tcfin.Tolerance()));
if(rev) ChFi3d_EnlargeBox(DStr,CD[fin],fdfin,*pbl2,*pbl1,isfirst);
else ChFi3d_EnlargeBox(DStr,CD[fin],fdfin,*pbl1,*pbl2,isfirst);
@@ -823,7 +823,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
Standard_Real tolr;
ChFi3d_SameParameter(Ccoinpiv,C2dOnPiv,Spiv,
fi.FirstParameter(),fi.LastParameter(),
tolapp3d,tolr);
tolesp,tolr);
TCcoinpiv.Tolerance(Max(TCcoinpiv.Tolerance(),tolr));
CD[pivot]->ChangePCurve(isfirst) = C2dOnPiv;
CD[pivot]->SetIndexPoint(If2,isfirst,isurf1);

View File

@@ -558,17 +558,6 @@ void ChFiDS_Spine::Load()
}
indexofcurve =1;
myCurve.Initialize(TopoDS::Edge(spine.Value(1)));
// Here, we should update tolesp according to curve parameter range
// if tolesp candidate less than default initial value.
const Standard_Real umin = FirstParameter();
const Standard_Real umax = LastParameter();
Standard_Real new_tolesp = 5.0e-5 * (umax - umin);
if (tolesp > new_tolesp)
{
tolesp = new_tolesp;
}
}

View File

@@ -244,9 +244,6 @@ public:
//! Return the mode of chamfers used
Standard_EXPORT ChFiDS_ChamfMode Mode() const;
//! Return tolesp parameter
Standard_EXPORT Standard_Real GetTolesp() const;
DEFINE_STANDARD_RTTIEXT(ChFiDS_Spine,Standard_Transient)

View File

@@ -214,12 +214,3 @@ inline ChFiDS_ChamfMode ChFiDS_Spine::Mode() const
return myMode;
}
//=======================================================================
//function : GetTolesp
//purpose :
//=======================================================================
inline Standard_Real ChFiDS_Spine::GetTolesp() const
{
return tolesp;
}

View File

@@ -24,8 +24,7 @@ ChFiDS_Concave,
ChFiDS_Convex,
ChFiDS_Tangential,
ChFiDS_FreeBound,
ChFiDS_Other,
ChFiDS_Mixed
ChFiDS_Other
};
#endif // _ChFiDS_TypeOfConcavity_HeaderFile

View File

@@ -538,7 +538,6 @@ Standard_Boolean DE_Wrapper::FindProvider(const TCollection_AsciiString& thePath
{
theProvider = aNode->BuildProvider();
aNode->GlobalParameters = GlobalParameters;
theProvider->SetNode(aNode);
return Standard_True;
}
}
@@ -547,7 +546,7 @@ Standard_Boolean DE_Wrapper::FindProvider(const TCollection_AsciiString& thePath
}
//=======================================================================
// function : UpdateLoad
// function : ReLoadNodes
// purpose :
//=======================================================================
Standard_EXPORT void DE_Wrapper::UpdateLoad(const Standard_Boolean theToForceUpdate) const

View File

@@ -226,14 +226,14 @@ public:
const Standard_Boolean theToImport,
Handle(DE_Provider)& theProvider) const;
//! Updates all registered nodes, all changes will be saved in nodes
//! @param[in] theToForceUpdate flag that turns on/of nodes, according to updated ability to import/export
//! Updates all registered nodes, save all result.
//! @param[in] theToForceUpdate flag to turn on/of nodes according opportunity to transfer
Standard_EXPORT void UpdateLoad(const Standard_Boolean theToForceUpdate = Standard_False) const;
//! Gets flag that keeps changes on configuration nodes which are being updated, false by default
//! Gets flag to save updates operation while transfer checks
Standard_Boolean KeepUpdates() const { return myKeepUpdates; }
//! Sets flag that keeps changes on configuration nodes which are being updated, false by default
//! Sets flag to save updates operation while transfer checks
void SetKeepUpdates(const Standard_Boolean theToKeepUpdates) { myKeepUpdates = theToKeepUpdates; }
//! Gets format map, contains vendor map with nodes
@@ -258,7 +258,7 @@ public:
private:
Standard_Boolean myKeepUpdates; //!< Flag that keeps changes on configuration nodes which are being updated
Standard_Boolean myKeepUpdates; //!< Flag to save updates operation while transfer checks
DE_ConfigurationFormatMap myConfiguration; //!< Internal map of formats
};

View File

@@ -125,7 +125,7 @@ Handle(DE_ConfigurationNode) DEXCAFCascade_ConfigurationNode::Copy() const
//=======================================================================
Handle(DE_Provider) DEXCAFCascade_ConfigurationNode::BuildProvider()
{
return new DEXCAFCascade_Provider();
return new DEXCAFCascade_Provider (this);
}
//=======================================================================

Some files were not shown because too many files have changed in this diff Show More