1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

Compare commits

..

5 Commits

Author SHA1 Message Date
bugmaster
94c00556ea Update version up to 7.5.1 2021-02-02 11:51:56 +03:00
emv
bf67bbf8fe 0031912: Modeling Algorithms - Boolean Cut can't build resulting shape
Problem is fixed by #0032058. Integrating test case only.
2021-02-02 11:49:33 +03:00
ifv
edf111202c 0032058: Modeling Data - Extrema curve-surface gives wrong result for planar surface of revolunion and circle
Extrema_GenExtCS.cxx : added solution refinement, if solution seems to be "bad" according to special criteria.
Extrema_FuncExtCS.cxx : "cosmetic" modifications
BOPAlgo_PaveFiller_3.cxx : adding control of shape index to prevent exception in ShapeInfo
bugs/moddata_3/bug32058 : new test
2021-02-02 11:30:40 +03:00
jgv
bbdcdcdd80 0031845: Modeling Algorithms - BRepOffsetAPI_MakeThickSolid fails
Multiple changes in BRepOffset_MakeOffset algorithm:
- correct fusing vertices;
- correct building intersection edges;
- correct intersecting new edges in 2D;
- correct building wire on a new face;
- correct building history.
2021-01-29 13:47:21 +03:00
bugmaster
2ecd3a06a6 Update version up to 7.5.1.dev 2020-11-11 20:08:01 +03:00
91 changed files with 1580 additions and 1838 deletions

View File

@@ -15,10 +15,6 @@ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
endif()
endmacro()
# set using memory manager option for TKernel
set (USE_MMGR_TYPE "JEMALLOC" CACHE STRING "Select using memory manager tool.")
set_property(CACHE USE_MMGR_TYPE PROPERTY STRINGS "NATIVE" "TBB" "JEMALLOC")
# include variable description
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vardescr")
@@ -732,14 +728,6 @@ else()
OCCT_CHECK_AND_UNSET ("3RDPARTY_FLEX_EXECUTABLE")
endif()
# Jemalloc
if ("${USE_MMGR_TYPE}" STREQUAL "JEMALLOC")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/jemalloc")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_JEMALLOC")
OCCT_CHECK_AND_UNSET ("INSTALL_JEMALLOC")
endif()
# qt for inspector and samples
if (BUILD_Inspector OR BUILD_SAMPLES_QT)
# check qt 3rdparty path

View File

@@ -1,143 +0,0 @@
# JeMalloc
if (NOT DEFINED INSTALL_JEMALLOC)
set (INSTALL_JEMALLOC OFF CACHE BOOL "${INSTALL_INSTALL_JEMALLOC_DESCR}")
endif()
# include occt macros. compiler_bitness, os_with_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
# specify JEMALLOC folder in connection with 3RDPARTY_DIR
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
if (NOT 3RDPARTY_JEMALLOC_DIR OR NOT EXISTS "${3RDPARTY_JEMALLOC_DIR}")
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" jemalloc JEMALLOC_DIR_NAME)
if (JEMALLOC_DIR_NAME)
set (3RDPARTY_JEMALLOC_DIR "${3RDPARTY_DIR}/${JEMALLOC_DIR_NAME}" CACHE PATH "The directory containing JEMALLOC" FORCE)
set (3RDPARTY_JEMALLOC_DIR "${3RDPARTY_DIR}/${JEMALLOC_DIR_NAME}")
message(STATUS "Info: JEMALLOC detected in ${3RDPARTY_JEMALLOC_DIR}")
endif()
endif()
else()
endif()
# define required JEMALLOC variables
if (NOT DEFINED 3RDPARTY_JEMALLOC_INCLUDE_DIR)
set (3RDPARTY_JEMALLOC_INCLUDE_DIR "" CACHE PATH "the path of headers directory")
endif()
# check 3RDPARTY_${PRODUCT_NAME}_ paths for consistency with specified 3RDPARTY_${PRODUCT_NAME}_DIR
if (3RDPARTY_JEMALLOC_DIR AND EXISTS "${3RDPARTY_JEMALLOC_DIR}")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_JEMALLOC_DIR 3RDPARTY_JEMALLOC_INCLUDE_DIR PATH "the path to JEMALLOC")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_JEMALLOC_DIR 3RDPARTY_JEMALLOC_LIBRARY_DIR FILEPATH "The directory containing JEMALLOC libraries")
endif()
# header
if (NOT 3RDPARTY_JEMALLOC_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_JEMALLOC_INCLUDE_DIR}")
set (HEADER_NAMES jemalloc.h)
# set 3RDPARTY_JEMALLOC_INCLUDE_DIR as notfound, otherwise find_library can't assign a new value to 3RDPARTY_JEMALLOC_INCLUDE_DIR
set (3RDPARTY_JEMALLOC_INCLUDE_DIR "3RDPARTY_JEMALLOC_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "the path to header directory" FORCE)
if (3RDPARTY_JEMALLOC_DIR AND EXISTS "${3RDPARTY_JEMALLOC_DIR}")
find_path (3RDPARTY_JEMALLOC_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_JEMALLOC_DIR}
PATH_SUFFIXES include/jemalloc
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
endif()
endif()
if (3RDPARTY_JEMALLOC_INCLUDE_DIR AND EXISTS "${3RDPARTY_JEMALLOC_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_JEMALLOC_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_JEMALLOC_INCLUDE_DIR)
set (3RDPARTY_JEMALLOC_INCLUDE_DIR "" CACHE FILEPATH "the path to jemalloc.h" FORCE)
endif()
# Installing destination path
if (WIN32)
set (JEMALLOC_INSTALL_DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
else()
set (JEMALLOC_INSTALL_DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}")
endif()
macro (JEMALLOC_LIB_SEARCH MMGR_LIB PREFIX)
if (NOT 3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB})
set (JEMALLOC_PATH_SUFFIXES "lib" "bin")
set (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} "3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}-NOTFOUND")
if (3RDPARTY_JEMALLOC_DIR AND EXISTS "${3RDPARTY_JEMALLOC_DIR}")
find_library (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} NAMES ${MMGR_LIB}
PATHS "${3RDPARTY_JEMALLOC_LIBRARY_DIR}" "${3RDPARTY_JEMALLOC_DIR}"
PATH_SUFFIXES ${JEMALLOC_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} NAMES ${MMGR_LIB}
PATH_SUFFIXES ${JEMALLOC_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
if (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB})
get_filename_component (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} "${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}}" PATH)
set (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} "${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}}")
else()
set (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} "")
endif()
endif()
if (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB})
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}}")
set (3RDPARTY_JEMALLOC_LIBRARY_DIR "${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}}" CACHE PATH "The directory containing JEMALLOC libraries" FORCE)
else()
message("Cannot find ${MMGR_LIB} library in jemalloc 3rdparty")
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB})
set (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} "")
endif()
set (JEMALLOC_IS_STATIC_LIB FALSE)
if (((${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}} MATCHES "lib$")) OR ((${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}} MATCHES "a$")))
get_filename_component(STATIC_LIB_NAME ${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}} NAME)
list(APPEND CSF_MMGR "${STATIC_LIB_NAME}")
set (JEMALLOC_IS_STATIC_LIB TRUE)
endif()
# install instructions
if (INSTALL_JEMALLOC AND NOT JEMALLOC_IS_STATIC_LIB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
get_filename_component(3RDPARTY_JEMALLOC_LIBRARY ${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}} REALPATH)
if (SINGLE_GENERATOR)
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}")
else()
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
CONFIGURATIONS Debug
DESTINATION "${JEMALLOC_INSTALL_DESTINATION}d")
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
CONFIGURATIONS Release
DESTINATION "${JEMALLOC_INSTALL_DESTINATION}")
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${JEMALLOC_INSTALL_DESTINATION}i")
endif()
set (USED_3RDPARTY_JEMALLOC_DIR "")
elseif(NOT JEMALLOC_IS_STATIC_LIB)
# the library directory for using by the executable
set (USED_3RDPARTY_JEMALLOC_DIR ${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}})
endif()
unset(3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} CACHE)
unset(3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} CACHE)
endmacro()
# Reset CSF variable
set (CSF_MMGR "")
# find static jemalloc lib
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".a")
if (WIN32)
JEMALLOC_LIB_SEARCH ("jemalloc" "STATIC")
elseif(NOT WIN32)
JEMALLOC_LIB_SEARCH ("jemalloc_pic" "STATIC")
SET(CMAKE_FIND_LIBRARY_SUFFIXES "" "so")
JEMALLOC_LIB_SEARCH ("jemalloc.so.2" "SHARED")
endif()
# find shared jemalloc lib
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".so")
JEMALLOC_LIB_SEARCH ("jemalloc" "SHARED")

View File

@@ -11,12 +11,9 @@ set(FLAGS_ALREADY_INCLUDED 1)
# project can be switched later to use Intel Compiler (ICC).
# Enforcing -fp:precise ensures that in such case ICC will use correct
# option instead of its default -fp:fast which is harmful for OCCT.
# Enforcing OMP only for internal test env
if (MSVC)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:precise")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp")
endif()
# add SSE2 option for old MSVC compilers (VS 2005 - 2010, 32 bit only)

View File

@@ -14,7 +14,6 @@ if /I "%VCVER%" == "@COMPILER@" (
set "TBB_DIR=@3RDPARTY_TBB_DLL_DIR@"
set "VTK_DIR=@3RDPARTY_VTK_DLL_DIR@"
set "FFMPEG_DIR=@3RDPARTY_FFMPEG_DLL_DIR@"
set "JEMALLOC_DIR=@3RDPARTY_JEMALLOC_LIBRARY_DIR@"
set "OPENVR_DIR=@3RDPARTY_OPENVR_DLL_DIRS@"
if not "@3RDPARTY_QT_DIR@" == "" (
@@ -41,7 +40,7 @@ if /I "%VCVER%" == "@COMPILER@" (
set "CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests"
set "CSF_OCCTDocPath=@CMAKE_SOURCE_DIR@/doc"
rem for compatibility with external application using CASROOT
rem for compatability with external application using CASROOT
set "CASROOT=@CMAKE_SOURCE_DIR@"
)
)

View File

@@ -12,7 +12,6 @@ if [ "$1" == "@BIN_LETTER@" ]; then
export TBB_DIR="@3RDPARTY_TBB_LIBRARY_DIR@"
export VTK_DIR="@3RDPARTY_VTK_LIBRARY_DIR@"
export FFMPEG_DIR="@3RDPARTY_FFMPEG_LIBRARY_DIR@"
export JEMALLOC_DIR="@3RDPARTY_JEMALLOC_LIBRARY_DIR@"
if [ "x@3RDPARTY_QT_DIR" != "x" ]; then
export QTDIR="@3RDPARTY_QT_DIR@"
@@ -30,7 +29,7 @@ if [ "$1" == "@BIN_LETTER@" ]; then
export CSF_OCCTTestsPath="@CMAKE_SOURCE_DIR@/tests"
export CSF_OCCTDocPath="@CMAKE_SOURCE_DIR@/doc"
# for compatibility with external application using CASROOT
# for compatability with external application using CASROOT
export CASROOT="@CMAKE_SOURCE_DIR@"
fi
fi

View File

@@ -16,7 +16,6 @@ if /I "%VCVER%" == "@COMPILER@" (
set "TBB_DIR=@USED_3RDPARTY_TBB_DIR@"
set "VTK_DIR=@USED_3RDPARTY_VTK_DIR@"
set "FFMPEG_DIR=@USED_3RDPARTY_FFMPEG_DIR@"
set "JEMALLOC_DIR=@USED_3RDPARTY_JEMALLOC_DIR@"
set "OPENVR_DIR=@USED_3RDPARTY_OPENVR_DIR@"
if not "@USED_3RDPARTY_QT_DIR@" == "" (

View File

@@ -12,7 +12,6 @@ if [ "$1" == "@BIN_LETTER@" ]; then
export TBB_DIR="@USED_3RDPARTY_TBB_DIR@"
export VTK_DIR="@USED_3RDPARTY_VTK_DIR@"
export FFMPEG_DIR="@USED_3RDPARTY_FFMPEG_DIR@"
export JEMALLOC_DIR="@USED_3RDPARTY_JEMALLOC_DIR@"
if [ "x@USED_3RDPARTY_QT_DIR@" != "x" ]; then
export QTDIR="@USED_3RDPARTY_QT_DIR@"

View File

@@ -74,10 +74,6 @@ if not "%DevEnvDir%" == "" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "vc143" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[17.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
) else (
@@ -111,11 +107,6 @@ if /I "%VCFMT%" == "vc9" (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=v142"
) else if /I "%VCFMT%" == "vc143" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[17.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=v142"
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
) else (
@@ -124,7 +115,7 @@ if /I "%VCFMT%" == "vc9" (
exit
)
rem ----- For compatibility with external application using CASROOT -----
rem ----- For compatability with external application using CASROOT -----
if ["%CASROOT%"] == [""] set "CASROOT=%SCRIPTROOT%"
rem ----- Define path to 3rdparty products -----
@@ -135,16 +126,11 @@ if ["%ARCH%"] == ["64"] set VCARCH=amd64
if /I ["%1"] == ["vc141"] set "VCVER=vc14"
if /I ["%1"] == ["vc142"] set "VCVER=vc14"
if /I ["%1"] == ["vc143"] set "VCVER=vc14"
if exist "%CASROOT%\custom.bat" (
call "%CASROOT%\custom.bat" %VCVER% %ARCH% %CASDEB%
)
if not ["%QTDIR%"] == [""] (
set "PATH=%QTDIR%/bin;%PATH%"
set "QT_PLUGIN_PATH=%QTDIR%/plugins"
)
if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%"
if not ["%TK_DIR%"] == [""] set "PATH=%TK_DIR%;%PATH%"
if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%"
@@ -154,8 +140,11 @@ if not ["%GLES2_DIR%"] == [""] set "PATH=%GLES2_DIR%;%PATH%"
if not ["%TBB_DIR%"] == [""] set "PATH=%TBB_DIR%;%PATH%"
if not ["%VTK_DIR%"] == [""] set "PATH=%VTK_DIR%;%PATH%"
if not ["%FFMPEG_DIR%"] == [""] set "PATH=%FFMPEG_DIR%;%PATH%"
if not ["%JEMALLOC_DIR%"] == [""] set "PATH=%JEMALLOC_DIR%;%PATH%"
if not ["%OPENVR_DIR%"] == [""] set "PATH=%OPENVR_DIR%;%PATH%"
if not ["%QTDIR%"] == [""] (
set "PATH=%QTDIR%/bin;%PATH%"
set "QT_PLUGIN_PATH=%QTDIR%/plugins"
)
rem ----- Set path to 3rd party and OCCT libraries -----
if not "%CSF_OCCTBinPath%" == "" (

View File

@@ -2,7 +2,7 @@
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
# ----- For compatibility with external application using CASROOT -----
# ----- For compatability with external application using CASROOT -----
if [ "${CASROOT}" == "" ]; then
export CASROOT="${aScriptPath}"
fi
@@ -69,10 +69,6 @@ if [ "$FFMPEG_DIR" != "" ]; then
THRDPARTY_PATH="${FFMPEG_DIR}:${THRDPARTY_PATH}"
fi
if [ "$JEMALLOC_DIR" != "" ]; then
THRDPARTY_PATH="${JEMALLOC_DIR}:${THRDPARTY_PATH}"
fi
if [ "$QTDIR" != "" ]; then
THRDPARTY_PATH="${QTDIR}/lib:${THRDPARTY_PATH}"
fi

View File

@@ -2,7 +2,7 @@
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
# ----- For compatibility with external application using CASROOT -----
# ----- For compatability with external application using CASROOT -----
if [ "${CASROOT}" == "" ]; then
export CASROOT="@INSTALL_DIR@"
fi
@@ -71,10 +71,6 @@ if [ "$FFMPEG_DIR" != "" ]; then
THRDPARTY_PATH="${FFMPEG_DIR}:${THRDPARTY_PATH}"
fi
if [ "$JEMALLOC_DIR" != "" ]; then
THRDPARTY_PATH="${JEMALLOC_DIR}:${THRDPARTY_PATH}"
fi
if [ "$QTDIR" != "" ]; then
THRDPARTY_PATH="${QTDIR}/lib:${THRDPARTY_PATH}"
fi

View File

@@ -2440,7 +2440,7 @@ void AIS_InteractiveContext::setObjectStatus (const Handle(AIS_InteractiveObject
{
if (theStatus != AIS_DS_None)
{
Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (theStatus, theDispMode, theSelectionMode);
Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (AIS_DS_Displayed, theDispMode, theSelectionMode);
myObjects.Bind (theIObj, aStatus);
}
else

View File

@@ -655,6 +655,12 @@ void BOPAlgo_PaveFiller::FillShrunkData(Handle(BOPDS_PaveBlock)& thePB)
// Vertices
Standard_Integer nV1, nV2;
thePB->Indices(nV1, nV2);
if (nV1 < 0 || nV2 < 0)
{
return;
}
const TopoDS_Vertex& aV1=(*(TopoDS_Vertex *)(&myDS->Shape(nV1)));
const TopoDS_Vertex& aV2=(*(TopoDS_Vertex *)(&myDS->Shape(nV2)));
// Get the edge

View File

@@ -23,8 +23,10 @@
#include <BRepAlgo_Loop.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_Surface.hxx>
#include <GeomLib.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Ax2.hxx>
#include <Precision.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
@@ -160,6 +162,15 @@ void BRepAlgo_Loop::AddConstEdges(const TopTools_ListOfShape& LE)
}
}
//=======================================================================
//function : SetImageVV
//purpose :
//=======================================================================
void BRepAlgo_Loop::SetImageVV (const BRepAlgo_Image& theImageVV)
{
myImageVV = theImageVV;
}
//=======================================================================
//function : UpdateClosedEdge
@@ -606,6 +617,8 @@ void BRepAlgo_Loop::Perform()
TopoDS_Wire NW;
Standard_Boolean End;
UpdateVEmap (MVE);
TopTools_MapOfShape UsedEdges;
while (MVE.Extent() > 0) {
@@ -924,6 +937,7 @@ void BRepAlgo_Loop::GetVerticesForSubstitute( TopTools_DataMapOfShapeShape& Ver
{
VerVerMap = myVerticesForSubstitute;
}
//=======================================================================
//function : VerticesForSubstitute
//purpose :
@@ -933,3 +947,123 @@ void BRepAlgo_Loop::VerticesForSubstitute( TopTools_DataMapOfShapeShape& VerVer
{
myVerticesForSubstitute = VerVerMap;
}
//=======================================================================
//function : UpdateVEmap
//purpose :
//=======================================================================
void BRepAlgo_Loop::UpdateVEmap (TopTools_IndexedDataMapOfShapeListOfShape& theVEmap)
{
TopTools_IndexedDataMapOfShapeListOfShape VerLver;
for (Standard_Integer ii = 1; ii <= theVEmap.Extent(); ii++)
{
const TopoDS_Vertex& aVertex = TopoDS::Vertex (theVEmap.FindKey(ii));
const TopTools_ListOfShape& aElist = theVEmap(ii);
if (aElist.Extent() == 1 && myImageVV.IsImage(aVertex))
{
const TopoDS_Vertex& aProVertex = TopoDS::Vertex (myImageVV.ImageFrom(aVertex));
if (VerLver.Contains(aProVertex))
{
TopTools_ListOfShape& aVlist = VerLver.ChangeFromKey(aProVertex);
aVlist.Append (aVertex.Oriented(TopAbs_FORWARD));
}
else
{
TopTools_ListOfShape aVlist;
aVlist.Append (aVertex.Oriented(TopAbs_FORWARD));
VerLver.Add (aProVertex, aVlist);
}
}
}
if (VerLver.IsEmpty())
return;
BRep_Builder aBB;
for (Standard_Integer ii = 1; ii <= VerLver.Extent(); ii++)
{
const TopTools_ListOfShape& aVlist = VerLver(ii);
if (aVlist.Extent() == 1)
continue;
Standard_Real aMaxTol = 0.;
TColgp_Array1OfPnt Points (1, aVlist.Extent());
TopTools_ListIteratorOfListOfShape itl (aVlist);
Standard_Integer jj = 0;
for (; itl.More(); itl.Next())
{
const TopoDS_Vertex& aVertex = TopoDS::Vertex (itl.Value());
Standard_Real aTol = BRep_Tool::Tolerance(aVertex);
aMaxTol = Max (aMaxTol, aTol);
gp_Pnt aPnt = BRep_Tool::Pnt(aVertex);
Points(++jj) = aPnt;
}
gp_Ax2 anAxis;
Standard_Boolean IsSingular;
GeomLib::AxeOfInertia (Points, anAxis, IsSingular);
gp_Pnt aCentre = anAxis.Location();
Standard_Real aMaxDist = 0.;
for (jj = 1; jj <= Points.Upper(); jj++)
{
Standard_Real aSqDist = aCentre.SquareDistance (Points(jj));
aMaxDist = Max (aMaxDist, aSqDist);
}
aMaxDist = Sqrt(aMaxDist);
aMaxTol = Max (aMaxTol, aMaxDist);
//Find constant vertex
TopoDS_Vertex aConstVertex;
for (itl.Initialize(aVlist); itl.More(); itl.Next())
{
const TopoDS_Vertex& aVertex = TopoDS::Vertex (itl.Value());
const TopTools_ListOfShape& aElist = theVEmap.FindFromKey(aVertex);
const TopoDS_Shape& anEdge = aElist.First();
TopTools_ListIteratorOfListOfShape itcedges (myConstEdges);
for (; itcedges.More(); itcedges.Next())
if (anEdge.IsSame (itcedges.Value()))
{
aConstVertex = aVertex;
break;
}
if (!aConstVertex.IsNull())
break;
}
if (aConstVertex.IsNull())
aConstVertex = TopoDS::Vertex(aVlist.First());
aBB.UpdateVertex (aConstVertex, aCentre, aMaxTol);
for (itl.Initialize(aVlist); itl.More(); itl.Next())
{
const TopoDS_Vertex& aVertex = TopoDS::Vertex (itl.Value());
if (aVertex.IsSame(aConstVertex))
continue;
const TopTools_ListOfShape& aElist = theVEmap.FindFromKey (aVertex);
TopoDS_Edge anEdge = TopoDS::Edge (aElist.First());
anEdge.Orientation(TopAbs_FORWARD);
TopoDS_Vertex aV1, aV2;
TopExp::Vertices (anEdge, aV1, aV2);
TopoDS_Vertex aVertexToRemove = (aV1.IsSame(aVertex))? aV1 : aV2;
anEdge.Free(Standard_True);
aBB.Remove (anEdge, aVertexToRemove);
aBB.Add (anEdge, aConstVertex.Oriented (aVertexToRemove.Orientation()));
}
}
TopTools_IndexedMapOfShape Emap;
for (Standard_Integer ii = 1; ii <= theVEmap.Extent(); ii++)
{
const TopTools_ListOfShape& aElist = theVEmap(ii);
TopTools_ListIteratorOfListOfShape itl (aElist);
for (; itl.More(); itl.Next())
Emap.Add (itl.Value());
}
theVEmap.Clear();
for (Standard_Integer ii = 1; ii <= Emap.Extent(); ii++)
TopExp::MapShapesAndAncestors (Emap(ii), TopAbs_VERTEX, TopAbs_EDGE, theVEmap);
}

View File

@@ -25,6 +25,8 @@
#include <TopTools_ListOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <BRepAlgo_Image.hxx>
class TopoDS_Face;
class TopoDS_Edge;
@@ -53,9 +55,15 @@ public:
//! Add <LE> as a set of const edges.
Standard_EXPORT void AddConstEdges (const TopTools_ListOfShape& LE);
//! Sets the Image Vertex - Vertex
Standard_EXPORT void SetImageVV (const BRepAlgo_Image& theImageVV);
//! Make loops.
Standard_EXPORT void Perform();
//! Update VE map according to Image Vertex - Vertex
Standard_EXPORT void UpdateVEmap (TopTools_IndexedDataMapOfShapeListOfShape& theVEmap);
//! Cut the edge <E> in several edges <NE> on the
//! vertices<VonE>.
Standard_EXPORT void CutEdge (const TopoDS_Edge& E, const TopTools_ListOfShape& VonE, TopTools_ListOfShape& NE) const;
@@ -102,6 +110,7 @@ private:
TopTools_ListOfShape myNewFaces;
TopTools_DataMapOfShapeListOfShape myCutEdges;
TopTools_DataMapOfShapeShape myVerticesForSubstitute;
BRepAlgo_Image myImageVV;
};

View File

@@ -101,44 +101,38 @@ Standard_Boolean BRepMesh_BaseMeshAlgo::initDataStructure()
for (Standard_Integer aEdgeIt = 0; aEdgeIt < aDWire->EdgesNb(); ++aEdgeIt)
{
const IMeshData::IEdgeHandle aDEdge = aDWire->GetEdge (aEdgeIt);
const IMeshData::IEdgeHandle aDEdge = aDWire->GetEdge(aEdgeIt);
const IMeshData::ICurveHandle& aCurve = aDEdge->GetCurve();
const IMeshData::ListOfInteger& aListOfPCurves = aDEdge->GetPCurves (myDFace.get());
const IMeshData::IPCurveHandle& aPCurve = aDEdge->GetPCurve(
myDFace.get(), aDWire->GetEdgeOrientation(aEdgeIt));
for (IMeshData::ListOfInteger::Iterator aPCurveIt(aListOfPCurves); aPCurveIt.More(); aPCurveIt.Next())
const TopAbs_Orientation aOri = fixSeamEdgeOrientation(aDEdge, aPCurve);
Standard_Integer aPrevNodeIndex = -1;
const Standard_Integer aLastPoint = aPCurve->ParametersNb() - 1;
for (Standard_Integer aPointIt = 0; aPointIt <= aLastPoint; ++aPointIt)
{
const IMeshData::IPCurveHandle& aPCurve = aDEdge->GetPCurve (aPCurveIt.Value());
const Standard_Integer aNodeIndex = registerNode(
aCurve ->GetPoint(aPointIt),
aPCurve->GetPoint(aPointIt),
BRepMesh_Frontier, Standard_False/*aPointIt > 0 && aPointIt < aLastPoint*/);
const TopAbs_Orientation aOri = fixSeamEdgeOrientation(aDEdge, aPCurve);
aPCurve->GetIndex(aPointIt) = aNodeIndex;
myUsedNodes->Bind(aNodeIndex, aNodeIndex);
Standard_Integer aPrevNodeIndex = -1;
const Standard_Integer aLastPoint = aPCurve->ParametersNb() - 1;
Standard_Integer aPointIt = 0;
for (; aPointIt <= aLastPoint; ++aPointIt)
if (aPrevNodeIndex != -1 && aPrevNodeIndex != aNodeIndex)
{
const Standard_Integer aNodeIndex = registerNode(
aCurve->GetPoint(aPointIt),
aPCurve->GetPoint(aPointIt),
BRepMesh_Frontier, Standard_False/*aPointIt > 0 && aPointIt < aLastPoint*/);
aPCurve->GetIndex (aPointIt) = aNodeIndex;
myUsedNodes->Bind (aNodeIndex, aNodeIndex);
if (aPrevNodeIndex != -1 && aPrevNodeIndex != aNodeIndex)
const Standard_Integer aLinksNb = myStructure->NbLinks();
const Standard_Integer aLinkIndex = addLinkToMesh(aPrevNodeIndex, aNodeIndex, aOri);
if (aWireIt != 0 && aLinkIndex <= aLinksNb)
{
const Standard_Integer aLinksNb = myStructure->NbLinks();
const Standard_Integer aLinkIndex = addLinkToMesh(aPrevNodeIndex, aNodeIndex, aOri);
if (aWireIt != 0 && aLinkIndex <= aLinksNb)
{
// Prevent holes around wire of zero area.
BRepMesh_Edge& aLink = const_cast<BRepMesh_Edge&>(myStructure->GetLink(aLinkIndex));
aLink.SetMovability(BRepMesh_Fixed);
}
// Prevent holes around wire of zero area.
BRepMesh_Edge& aLink = const_cast<BRepMesh_Edge&>(myStructure->GetLink(aLinkIndex));
aLink.SetMovability(BRepMesh_Fixed);
}
aPrevNodeIndex = aNodeIndex;
}
aPrevNodeIndex = aNodeIndex;
}
}
}

View File

@@ -93,15 +93,6 @@ const IMeshData::IPCurveHandle& BRepMeshData_Edge::GetPCurve (
myPCurves (aListOfPCurves.Last ());
}
//=======================================================================
// Function: GetPCurves
// Purpose :
//=======================================================================
const IMeshData::ListOfInteger& BRepMeshData_Edge::GetPCurves (const IMeshData::IFacePtr& theDFace) const
{
return myPCurvesMap.Find (theDFace);
}
//=======================================================================
// Function: GetPCurve
// Purpose :

View File

@@ -49,10 +49,6 @@ public:
const IMeshData::IFacePtr& theDFace,
const TopAbs_Orientation theOrientation) const Standard_OVERRIDE;
//! Returns an array of pcurves indices for the specified discrete face.
Standard_EXPORT virtual const IMeshData::ListOfInteger& GetPCurves(
const IMeshData::IFacePtr& theDFace) const Standard_OVERRIDE;
//! Returns pcurve with the given index.
Standard_EXPORT virtual const IMeshData::IPCurveHandle& GetPCurve (
const Standard_Integer theIndex) const Standard_OVERRIDE;

View File

@@ -32,6 +32,7 @@
#include <BRepAdaptor_Curve2d.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepAlgo_AsDes.hxx>
#include <BRepAlgo_Image.hxx>
#include <BRepLib.hxx>
#include <BRepLib_MakeVertex.hxx>
#include <BRepOffset_Analyse.hxx>
@@ -78,6 +79,7 @@
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <stdio.h>
#ifdef DRAW
@@ -113,27 +115,153 @@ static TopoDS_Vertex CommonVertex(TopoDS_Edge& E1,
return V;
}
static Standard_Boolean IsOrientationChanged(TopTools_IndexedMapOfShape& theMap,
const TopoDS_Edge& theEdge)
static Standard_Integer DefineClosedness(const TopoDS_Face& theFace)
{
Standard_Boolean IsOrChanged = Standard_False;
if (!theMap.Contains(theEdge))
theMap.Add(theEdge);
else
TopExp_Explorer anExplo (theFace, TopAbs_EDGE);
for (; anExplo.More(); anExplo.Next())
{
Standard_Integer anInd = theMap.FindIndex(theEdge);
const TopoDS_Shape& anEdge = theMap(anInd);
if (theEdge.Orientation() != anEdge.Orientation())
const TopoDS_Edge& anEdge = TopoDS::Edge (anExplo.Current());
if (BRepTools::IsReallyClosed(anEdge, theFace))
{
theMap.Substitute( anInd, theEdge );
IsOrChanged = Standard_True;
Standard_Real fpar, lpar;
Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(anEdge, theFace, fpar, lpar);
gp_Vec2d aTangent = aPCurve->DN(fpar, 1);
Standard_Real aCrossProd1 = aTangent ^ gp::DX2d();
Standard_Real aCrossProd2 = aTangent ^ gp::DY2d();
if (Abs(aCrossProd2) < Abs(aCrossProd1)) //pcurve is parallel to OY
return 1;
else
return 2;
}
}
return IsOrChanged;
return 0;
}
static void GetEdgesOrientedInFace(const TopoDS_Shape& theShape,
const TopoDS_Face& theFace,
const Handle(BRepAlgo_AsDes)& theAsDes,
TopTools_SequenceOfShape& theSeqEdges)
{
const TopTools_ListOfShape& aEdges = theAsDes->Descendant (theFace);
TopExp_Explorer anExplo (theShape, TopAbs_EDGE);
for (; anExplo.More(); anExplo.Next())
{
const TopoDS_Shape& anEdge = anExplo.Current();
TopTools_ListIteratorOfListOfShape itl (aEdges);
for (; itl.More(); itl.Next())
{
const TopoDS_Shape& anEdgeInFace = itl.Value();
if (anEdgeInFace.IsSame(anEdge))
{
theSeqEdges.Append (anEdgeInFace);
break;
}
}
}
if (theSeqEdges.Length() == 1)
return;
TopTools_IndexedDataMapOfShapeListOfShape aVEmap;
for (Standard_Integer ii = 1; ii <= theSeqEdges.Length(); ii++)
TopExp::MapShapesAndAncestors (theSeqEdges(ii), TopAbs_VERTEX, TopAbs_EDGE, aVEmap);
TopoDS_Vertex aFirstVertex;
TopoDS_Edge aFirstEdge;
for (Standard_Integer ii = 1; ii <= aVEmap.Extent(); ii++)
{
const TopoDS_Vertex& aVertex = TopoDS::Vertex (aVEmap.FindKey(ii));
const TopTools_ListOfShape& aElist = aVEmap(ii);
if (aElist.Extent() == 1)
{
const TopoDS_Edge& anEdge = TopoDS::Edge(aElist.First());
TopoDS_Vertex aV1, aV2;
TopExp::Vertices(anEdge, aV1, aV2, Standard_True); //with orientation
if (aV1.IsSame(aVertex))
{
aFirstVertex = aVertex;
aFirstEdge = anEdge;
break;
}
}
}
if (aFirstEdge.IsNull()) //closed set of edges
{
//Standard_Real aPeriod = 0.;
Standard_Integer IndCoord = DefineClosedness (theFace);
/*
BRepAdaptor_Surface aBAsurf (theFace, Standard_False);
if (IndCoord == 1)
aPeriod = aBAsurf.LastUParameter() - aBAsurf.FirstUParameter();
else if (IndCoord == 2)
aPeriod = aBAsurf.LastVParameter() - aBAsurf.FirstVParameter();
*/
if (IndCoord != 0)
{
Standard_Real aMaxDelta = 0.;
for (Standard_Integer ii = 1; ii <= aVEmap.Extent(); ii++)
{
const TopoDS_Vertex& aVertex = TopoDS::Vertex (aVEmap.FindKey(ii));
const TopTools_ListOfShape& aElist = aVEmap(ii);
const TopoDS_Edge& anEdge1 = TopoDS::Edge(aElist.First());
const TopoDS_Edge& anEdge2 = TopoDS::Edge(aElist.Last());
Standard_Real aParam1 = BRep_Tool::Parameter(aVertex, anEdge1);
Standard_Real aParam2 = BRep_Tool::Parameter(aVertex, anEdge2);
BRepAdaptor_Curve2d aBAcurve1 (anEdge1, theFace);
BRepAdaptor_Curve2d aBAcurve2 (anEdge2, theFace);
gp_Pnt2d aPnt1 = aBAcurve1.Value(aParam1);
gp_Pnt2d aPnt2 = aBAcurve2.Value(aParam2);
Standard_Real aDelta = Abs(aPnt1.Coord(IndCoord) - aPnt2.Coord(IndCoord));
if (aDelta > aMaxDelta)
{
aMaxDelta = aDelta;
aFirstVertex = aVertex;
}
}
const TopTools_ListOfShape& aElist = aVEmap.FindFromKey(aFirstVertex);
TopTools_ListIteratorOfListOfShape itl (aElist);
for (; itl.More(); itl.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge(itl.Value());
TopoDS_Vertex aV1, aV2;
TopExp::Vertices(anEdge, aV1, aV2, Standard_True); //with orientation
if (aV1.IsSame(aFirstVertex))
{
aFirstEdge = anEdge;
break;
}
}
}
}
Standard_Integer aNbEdges = theSeqEdges.Length();
theSeqEdges.Clear();
theSeqEdges.Append (aFirstEdge);
TopoDS_Edge anEdge = aFirstEdge;
for (;;)
{
TopoDS_Vertex aLastVertex = TopExp::LastVertex (anEdge, Standard_True); //with orientation
if (aLastVertex.IsSame(aFirstVertex))
break;
const TopTools_ListOfShape& aElist = aVEmap.FindFromKey(aLastVertex);
if (aElist.Extent() == 1)
break;
if (aElist.First().IsSame(anEdge))
anEdge = TopoDS::Edge(aElist.Last());
else
anEdge = TopoDS::Edge(aElist.First());
theSeqEdges.Append (anEdge);
if (theSeqEdges.Length() == aNbEdges)
break;
}
}
//=======================================================================
//function : Store
@@ -505,7 +633,7 @@ static void EdgeInter(const TopoDS_Face& F,
// Vertex storage in DS.
//---------------------------------
Standard_Real TolStore = BRep_Tool::Tolerance(E1) + BRep_Tool::Tolerance(E2);
TolStore = Max(TolStore, 10.*Tol);
TolStore = Max (TolStore, Tol);
Store (E1,E2,LV1,LV2,TolStore,AsDes, aDMVV);
}
}
@@ -518,10 +646,13 @@ static void RefEdgeInter(const TopoDS_Face& F,
const BRepAdaptor_Surface& BAsurf,
const TopoDS_Edge& E1,
const TopoDS_Edge& E2,
const TopAbs_Orientation theOr1,
const TopAbs_Orientation theOr2,
const Handle(BRepAlgo_AsDes)& AsDes,
Standard_Real Tol,
Standard_Boolean WithOri,
gp_Pnt& Pref,
const TopoDS_Vertex& theVref,
BRepAlgo_Image& theImageVV,
TopTools_IndexedDataMapOfShapeListOfShape& aDMVV,
Standard_Boolean& theCoincide)
{
@@ -567,20 +698,20 @@ static void RefEdgeInter(const TopoDS_Face& F,
Standard_Boolean WithDegen = BRep_Tool::Degenerated(E1) || BRep_Tool::Degenerated(E2);
if (WithDegen)
{
Standard_Integer ideg = (BRep_Tool::Degenerated(E1))? 1 : 2;
TopoDS_Iterator iter( EI[ideg] );
if (iter.More())
{
Standard_Integer ideg = (BRep_Tool::Degenerated(E1))? 1 : 2;
TopoDS_Iterator iter( EI[ideg] );
if (iter.More())
{
const TopoDS_Vertex& vdeg = TopoDS::Vertex(iter.Value());
DegPoint = BRep_Tool::Pnt(vdeg);
}
else
{
BRepAdaptor_Curve CEdeg( EI[ideg], F );
DegPoint = CEdeg.Value( CEdeg.FirstParameter() );
}
const TopoDS_Vertex& vdeg = TopoDS::Vertex(iter.Value());
DegPoint = BRep_Tool::Pnt(vdeg);
}
else
{
BRepAdaptor_Curve CEdeg( EI[ideg], F );
DegPoint = CEdeg.Value( CEdeg.FirstParameter() );
}
}
//
Handle(Geom2d_Curve) pcurve1 = BRep_Tool::CurveOnSurface(E1, F, f[1], l[1]);
Handle(Geom2d_Curve) pcurve2 = BRep_Tool::CurveOnSurface(E2, F, f[2], l[2]);
@@ -596,107 +727,113 @@ static void RefEdgeInter(const TopoDS_Face& F,
return;
}
}
Geom2dInt_GInter Inter2d( GAC1, GAC2, TolDub, TolDub );
//
if (!Inter2d.IsDone() || !Inter2d.NbPoints()) {
theCoincide = (Inter2d.NbSegments() &&
(GAC1.GetType() == GeomAbs_Line) &&
(GAC2.GetType() == GeomAbs_Line));
(GAC1.GetType() == GeomAbs_Line) &&
(GAC2.GetType() == GeomAbs_Line));
return;
}
//
for (i = 1; i <= Inter2d.NbPoints(); i++)
{
gp_Pnt P3d;
if (WithDegen)
P3d = DegPoint;
else
{
gp_Pnt P3d;
if (WithDegen)
P3d = DegPoint;
else
{
gp_Pnt2d P2d = Inter2d.Point(i).Value();
P3d = BAsurf.Value( P2d.X(), P2d.Y() );
}
ResPoints.Append( P3d );
ResParamsOnE1.Append( Inter2d.Point(i).ParamOnFirst() );
ResParamsOnE2.Append( Inter2d.Point(i).ParamOnSecond() );
gp_Pnt2d P2d = Inter2d.Point(i).Value();
P3d = BAsurf.Value( P2d.X(), P2d.Y() );
}
ResPoints.Append( P3d );
ResParamsOnE1.Append( Inter2d.Point(i).ParamOnFirst() );
ResParamsOnE2.Append( Inter2d.Point(i).ParamOnSecond() );
}
for (i = 1; i <= ResPoints.Length(); i++)
{
Standard_Real aT1 = ResParamsOnE1(i); //ponc1.Parameter();
Standard_Real aT2 = ResParamsOnE2(i); //ponc2.Parameter();
if (Precision::IsInfinite(aT1) || Precision::IsInfinite(aT2))
{
Standard_Real aT1 = ResParamsOnE1(i); //ponc1.Parameter();
Standard_Real aT2 = ResParamsOnE2(i); //ponc2.Parameter();
if (Precision::IsInfinite(aT1) || Precision::IsInfinite(aT2))
{
#ifdef OCCT_DEBUG
std::cout << "Inter2d : Solution rejected due to infinite parameter"<<std::endl;
std::cout << "Inter2d : Solution rejected due to infinite parameter"<<std::endl;
#endif
continue;
}
gp_Pnt P = ResPoints(i); //ponc1.Value();
TopoDS_Vertex aNewVertex = BRepLib_MakeVertex(P);
aNewVertex.Orientation(TopAbs_INTERNAL);
B.UpdateVertex( aNewVertex, aT1, E1, Tol );
B.UpdateVertex( aNewVertex, aT2, E2, Tol );
gp_Pnt P1 = CE1.Value(aT1);
gp_Pnt P2 = CE2.Value(aT2);
Standard_Real dist1, dist2, dist3;
dist1 = P1.Distance(P);
dist2 = P2.Distance(P);
dist3 = P1.Distance(P2);
dist1 = Max( dist1, dist2 );
dist1 = Max( dist1, dist3 );
B.UpdateVertex( aNewVertex, dist1 );
#ifdef OCCT_DEBUG
if (aT1 < f[1]-Tol || aT1 > l[1]+Tol)
{
std::cout << "out of limit"<<std::endl;
std::cout<<"aT1 = "<<aT1<<", f[1] = "<<f[1]<<", l[1] = "<<l[1]<<std::endl;
}
if (aT2 < f[2]-Tol || aT2 > l[2]+Tol)
{
std::cout << "out of limit"<<std::endl;
std::cout<<"aT2 = "<<aT2<<", f[2] = "<<f[2]<<", l[2] = "<<l[2]<<std::endl;
}
Standard_Real MilTol2 = 1000*Tol*Tol;
if (P1.SquareDistance(P) > MilTol2 || P2.SquareDistance(P) > MilTol2 || P1.Distance(P2) > 2.*Tol)
{
std::cout << "Inter2d : Solution rejected"<<std::endl;
std::cout<<"P = "<<P.X()<<" "<<P.Y()<<" "<<P.Z()<<std::endl;
std::cout<<"P1 = "<<P1.X()<<" "<<P1.Y()<<" "<<P1.Z()<<std::endl;
std::cout<<"P2 = "<<P2.X()<<" "<<P2.Y()<<" "<<P2.Z()<<std::endl;
std::cout<<"MaxDist = "<<dist1<<std::endl;
}
#endif
//define the orientation of a new vertex
TopAbs_Orientation OO1 = TopAbs_REVERSED;
TopAbs_Orientation OO2 = TopAbs_REVERSED;
if (WithOri)
{
BRepAdaptor_Curve2d PCE1( E1, F );
BRepAdaptor_Curve2d PCE2( E2, F );
gp_Pnt2d P2d1, P2d2;
gp_Vec2d V1, V2, V1or, V2or;
PCE1.D1( aT1, P2d1, V1 );
PCE2.D1( aT2, P2d2, V2 );
V1or = V1; V2or = V2;
if (E1.Orientation() == TopAbs_REVERSED) V1or.Reverse();
if (E2.Orientation() == TopAbs_REVERSED) V2or.Reverse();
Standard_Real CrossProd = V2or ^ V1;
#ifdef OCCT_DEBUG
if (Abs(CrossProd) <= gp::Resolution())
std::cout<<std::endl<<"CrossProd = "<<CrossProd<<std::endl;
#endif
if (CrossProd > 0.)
OO1 = TopAbs_FORWARD;
CrossProd = V1or ^ V2;
if (CrossProd > 0.)
OO2 = TopAbs_FORWARD;
}
LV1.Append( aNewVertex.Oriented(OO1) );
LV2.Append( aNewVertex.Oriented(OO2) );
continue;
}
gp_Pnt P = ResPoints(i); //ponc1.Value();
TopoDS_Vertex aNewVertex = BRepLib_MakeVertex(P);
aNewVertex.Orientation(TopAbs_INTERNAL);
B.UpdateVertex( aNewVertex, aT1, E1, Tol );
B.UpdateVertex( aNewVertex, aT2, E2, Tol );
gp_Pnt P1 = CE1.Value(aT1);
gp_Pnt P2 = CE2.Value(aT2);
Standard_Real dist1, dist2, dist3;
dist1 = P1.Distance(P);
dist2 = P2.Distance(P);
dist3 = P1.Distance(P2);
dist1 = Max( dist1, dist2 );
dist1 = Max( dist1, dist3 );
B.UpdateVertex( aNewVertex, dist1 );
#ifdef OCCT_DEBUG
if (aT1 < f[1]-Tol || aT1 > l[1]+Tol)
{
std::cout << "out of limit"<<std::endl;
std::cout<<"aT1 = "<<aT1<<", f[1] = "<<f[1]<<", l[1] = "<<l[1]<<std::endl;
}
if (aT2 < f[2]-Tol || aT2 > l[2]+Tol)
{
std::cout << "out of limit"<<std::endl;
std::cout<<"aT2 = "<<aT2<<", f[2] = "<<f[2]<<", l[2] = "<<l[2]<<std::endl;
}
Standard_Real MilTol2 = 1000*Tol*Tol;
if (P1.SquareDistance(P) > MilTol2 || P2.SquareDistance(P) > MilTol2 || P1.Distance(P2) > 2.*Tol)
{
std::cout << "Inter2d : Solution rejected"<<std::endl;
std::cout<<"P = "<<P.X()<<" "<<P.Y()<<" "<<P.Z()<<std::endl;
std::cout<<"P1 = "<<P1.X()<<" "<<P1.Y()<<" "<<P1.Z()<<std::endl;
std::cout<<"P2 = "<<P2.X()<<" "<<P2.Y()<<" "<<P2.Z()<<std::endl;
std::cout<<"MaxDist = "<<dist1<<std::endl;
}
#endif
//define the orientation of a new vertex
TopAbs_Orientation OO1 = TopAbs_REVERSED;
TopAbs_Orientation OO2 = TopAbs_REVERSED;
if (WithOri)
{
BRepAdaptor_Curve2d PCE1( E1, F );
BRepAdaptor_Curve2d PCE2( E2, F );
gp_Pnt2d P2d1, P2d2;
gp_Vec2d V1, V2, V1or, V2or;
PCE1.D1( aT1, P2d1, V1 );
PCE2.D1( aT2, P2d2, V2 );
V1or = V1; V2or = V2;
if (E1.Orientation() == TopAbs_REVERSED) V1or.Reverse();
if (E2.Orientation() == TopAbs_REVERSED) V2or.Reverse();
Standard_Real CrossProd = V2or ^ V1;
#ifdef OCCT_DEBUG
if (Abs(CrossProd) <= gp::Resolution())
std::cout<<std::endl<<"CrossProd = "<<CrossProd<<std::endl;
#endif
if (CrossProd > 0.)
OO1 = TopAbs_FORWARD;
CrossProd = V1or ^ V2;
if (CrossProd > 0.)
OO2 = TopAbs_FORWARD;
}
if (theOr1 != TopAbs_EXTERNAL)
OO1 = theOr1;
if (theOr2 != TopAbs_EXTERNAL)
OO2 = theOr2;
LV1.Append( aNewVertex.Oriented(OO1) );
LV2.Append( aNewVertex.Oriented(OO2) );
}
//----------------------------------
// Test at end.
@@ -755,7 +892,7 @@ static void RefEdgeInter(const TopoDS_Face& F,
while (j < i) {
P1 = BRep_Tool::Pnt(TopoDS::Vertex(it1LV1.Value()));
P2 = BRep_Tool::Pnt(TopoDS::Vertex(it2LV1.Value()));
if (P1.IsEqual(P2,10*Tol)) {
if (P1.IsEqual(P2, Tol)) {
LV1.Remove(it1LV1);
LV2.Remove(it1LV2);
if (AffichPurge) std::cout <<"Doubles removed in EdgeInter."<<std::endl;
@@ -775,6 +912,7 @@ static void RefEdgeInter(const TopoDS_Face& F,
////-----------------------------------------------------
if(LV1.Extent() > 1) {
//std::cout << "IFV - RefEdgeInter: remove vertex" << std::endl;
gp_Pnt Pref = BRep_Tool::Pnt(theVref);
Standard_Real dmin = RealLast();
TopoDS_Vertex Vmin;
for (it1LV1.Initialize(LV1); it1LV1.More(); it1LV1.Next()) {
@@ -794,10 +932,21 @@ static void RefEdgeInter(const TopoDS_Face& F,
}
}
}
TopTools_ListIteratorOfListOfShape itl (LV1);
for (; itl.More(); itl.Next())
{
TopoDS_Shape aNewVertex = itl.Value();
aNewVertex.Orientation(TopAbs_FORWARD);
if (theImageVV.HasImage (theVref))
theImageVV.Add (theVref.Oriented(TopAbs_FORWARD), aNewVertex);
else
theImageVV.Bind (theVref.Oriented(TopAbs_FORWARD), aNewVertex);
}
////-----------------------------------------------------
Standard_Real TolStore = BRep_Tool::Tolerance(E1) + BRep_Tool::Tolerance(E2);
TolStore = Max(TolStore, 10.*Tol);
TolStore = Max (TolStore, Tol);
Store (E1,E2,LV1,LV2,TolStore,AsDes, aDMVV);
}
}
@@ -1406,6 +1555,7 @@ void BRepOffset_Inter2d::Compute (const Handle(BRepAlgo_AsDes)& AsDes,
const TopoDS_Face& F,
const TopTools_IndexedMapOfShape& NewEdges,
const Standard_Real Tol,
const TopTools_DataMapOfShapeListOfShape& theEdgeIntEdges,
TopTools_IndexedDataMapOfShapeListOfShape& theDMVV)
{
#ifdef DRAW
@@ -1441,12 +1591,41 @@ void BRepOffset_Inter2d::Compute (const Handle(BRepAlgo_AsDes)& AsDes,
while (j < i && it2LE.More()) {
const TopoDS_Edge& E2 = TopoDS::Edge(it2LE.Value());
Standard_Boolean ToIntersect = Standard_True;
if (theEdgeIntEdges.IsBound(E1))
{
const TopTools_ListOfShape& aElist = theEdgeIntEdges(E1);
TopTools_ListIteratorOfListOfShape itedges (aElist);
for (; itedges.More(); itedges.Next())
if (E2.IsSame (itedges.Value()))
ToIntersect = Standard_False;
if (ToIntersect)
{
for (itedges.Initialize(aElist); itedges.More(); itedges.Next())
{
const TopoDS_Shape& anEdge = itedges.Value();
if (theEdgeIntEdges.IsBound(anEdge))
{
const TopTools_ListOfShape& aElist2 = theEdgeIntEdges(anEdge);
TopTools_ListIteratorOfListOfShape itedges2 (aElist2);
for (; itedges2.More(); itedges2.Next())
if (E2.IsSame (itedges2.Value()))
ToIntersect = Standard_False;
}
}
}
}
//--------------------------------------------------------------
// Intersections of New edges obtained by intersection
// between them and with edges of restrictions
//------------------------------------------------------
if ( (!EdgesOfFace.Contains(E1) || !EdgesOfFace.Contains(E2)) &&
(NewEdges.Contains(E1) || NewEdges.Contains(E2)) ) {
if (ToIntersect &&
(!EdgesOfFace.Contains(E1) || !EdgesOfFace.Contains(E2)) &&
(NewEdges.Contains(E1) || NewEdges.Contains(E2)) ) {
TopoDS_Shape aLocalShape = F.Oriented(TopAbs_FORWARD);
EdgeInter(TopoDS::Face(aLocalShape),BAsurf,E1,E2,AsDes,Tol,Standard_True, theDMVV);
// EdgeInter(TopoDS::Face(F.Oriented(TopAbs_FORWARD)),E1,E2,AsDes,Tol,Standard_True);
@@ -1467,11 +1646,14 @@ Standard_Boolean BRepOffset_Inter2d::ConnexIntByInt
BRepOffset_Offset& OFI,
TopTools_DataMapOfShapeShape& MES,
const TopTools_DataMapOfShapeShape& Build,
const Handle(BRepAlgo_AsDes)& theAsDes,
const Handle(BRepAlgo_AsDes)& AsDes2d,
const Standard_Real Offset,
const Standard_Real Tol,
const BRepOffset_Analyse& Analyse,
TopTools_IndexedMapOfShape& FacesWithVerts,
BRepAlgo_Image& theImageVV,
TopTools_DataMapOfShapeListOfShape& theEdgeIntEdges,
TopTools_IndexedDataMapOfShapeListOfShape& theDMVV)
{
@@ -1529,8 +1711,7 @@ Standard_Boolean BRepOffset_Inter2d::ConnexIntByInt
continue; // Protection from case when explorer does not contain edges.
CurE = FirstE = wexp.Current();
TopTools_IndexedMapOfShape Edges;
Standard_Boolean ToReverse1, ToReverse2;
ToReverse1 = IsOrientationChanged(Edges, CurE);
while (!end) {
wexp.Next();
if (wexp.More()) {
@@ -1541,10 +1722,7 @@ Standard_Boolean BRepOffset_Inter2d::ConnexIntByInt
}
if (CurE.IsSame(NextE)) continue;
ToReverse2 = IsOrientationChanged(Edges, NextE);
TopoDS_Vertex Vref = CommonVertex(CurE, NextE);
gp_Pnt Pref = BRep_Tool::Pnt(Vref);
CurE = Analyse.EdgeReplacement (FI, CurE);
NextE = Analyse.EdgeReplacement (FI, NextE);
@@ -1559,21 +1737,38 @@ Standard_Boolean BRepOffset_Inter2d::ConnexIntByInt
TopTools_ListOfShape LV1,LV2;
Standard_Boolean DoInter = 1;
TopoDS_Shape NE1,NE2;
TopTools_SequenceOfShape NE1seq, NE2seq;
TopAbs_Orientation anOr1 = TopAbs_EXTERNAL, anOr2 = TopAbs_EXTERNAL;
Standard_Integer aChoice = 0;
if (Build.IsBound(CurE) && Build.IsBound(NextE)) {
aChoice = 1;
NE1 = Build(CurE );
NE2 = Build(NextE);
GetEdgesOrientedInFace (NE1, FIO, theAsDes, NE1seq);
GetEdgesOrientedInFace (NE2, FIO, theAsDes, NE2seq);
anOr1 = TopAbs_REVERSED;
anOr2 = TopAbs_FORWARD;
}
else if (Build.IsBound(CurE) && MES.IsBound(NEO)) {
aChoice = 2;
NE1 = Build(CurE);
NE2 = MES (NEO);
NE2.Orientation (NextE.Orientation());
GetEdgesOrientedInFace (NE1, FIO, theAsDes, NE1seq);
NE2seq.Append (NE2);
anOr1 = TopAbs_REVERSED;
anOr2 = TopAbs_FORWARD;
}
else if (Build.IsBound(NextE) && MES.IsBound(CEO)) {
aChoice = 3;
NE1 = Build(NextE);
NE2 = MES(CEO);
Standard_Boolean Tmp = ToReverse1;
ToReverse1 = ToReverse2;
ToReverse2 = Tmp;
NE2.Orientation (CurE.Orientation());
GetEdgesOrientedInFace (NE1, FIO, theAsDes, NE1seq);
NE2seq.Append (NE2);
anOr1 = TopAbs_FORWARD;
anOr2 = TopAbs_REVERSED;
}
else {
DoInter = 0;
@@ -1583,23 +1778,43 @@ Standard_Boolean BRepOffset_Inter2d::ConnexIntByInt
// NE1,NE2 can be a compound of Edges.
//------------------------------------
Standard_Boolean bCoincide;
TopExp_Explorer Exp1, Exp2;
for (Exp1.Init(NE1, TopAbs_EDGE); Exp1.More(); Exp1.Next()) {
TopoDS_Edge aE1 = TopoDS::Edge(Exp1.Current());
for (Exp2.Init(NE2, TopAbs_EDGE); Exp2.More(); Exp2.Next()) {
TopoDS_Edge aE2 = TopoDS::Edge(Exp2.Current());
//Correct orientation of edges
if (ToReverse1)
aE1.Reverse();
if (ToReverse2)
aE2.Reverse();
//////////////////////////////
RefEdgeInter(FIO, BAsurf, aE1, aE2, AsDes2d,
Tol, Standard_True, Pref, theDMVV, bCoincide);
}
TopoDS_Edge aE1, aE2;
if (aChoice == 1 || aChoice == 2)
{
aE1 = TopoDS::Edge (NE1seq.Last());
aE2 = TopoDS::Edge (NE2seq.First());
}
else // aChoice == 3
{
aE1 = TopoDS::Edge (NE1seq.First());
aE2 = TopoDS::Edge (NE2seq.Last());
}
if (aE1.Orientation() == TopAbs_REVERSED)
anOr1 = TopAbs::Reverse(anOr1);
if (aE2.Orientation() == TopAbs_REVERSED)
anOr2 = TopAbs::Reverse(anOr2);
RefEdgeInter(FIO, BAsurf, aE1, aE2, anOr1, anOr2, AsDes2d,
Tol, Standard_True, Vref, theImageVV, theDMVV, bCoincide);
if (theEdgeIntEdges.IsBound(aE1))
theEdgeIntEdges(aE1).Append(aE2);
else
{
TopTools_ListOfShape aElist;
aElist.Append(aE2);
theEdgeIntEdges.Bind (aE1, aElist);
}
if (theEdgeIntEdges.IsBound(aE2))
theEdgeIntEdges(aE2).Append(aE1);
else
{
TopTools_ListOfShape aElist;
aElist.Append(aE1);
theEdgeIntEdges.Bind (aE2, aElist);
}
//
// check if some of the offset edges have been
// generated out of the common vertex
@@ -1622,7 +1837,6 @@ Standard_Boolean BRepOffset_Inter2d::ConnexIntByInt
}
}
CurE = wexp.Current();
ToReverse1 = ToReverse2;
}
}
return Standard_True;
@@ -1682,7 +1896,6 @@ void BRepOffset_Inter2d::ConnexIntByIntInVert
if (CurE.IsSame(NextE)) continue;
//
TopoDS_Vertex Vref = CommonVertex(CurE, NextE);
gp_Pnt Pref = BRep_Tool::Pnt(Vref);
if (!Build.IsBound(Vref)) {
CurE = NextE;
continue;
@@ -1697,6 +1910,7 @@ void BRepOffset_Inter2d::ConnexIntByIntInVert
TopoDS_Edge NEO = TopoDS::Edge(aLocalShape);
//
TopoDS_Shape NE1,NE2;
TopAbs_Orientation anOr1 = TopAbs_EXTERNAL, anOr2 = TopAbs_EXTERNAL;
if (Build.IsBound(CurE) && Build.IsBound(NextE)) {
NE1 = Build(CurE );
@@ -1729,8 +1943,9 @@ void BRepOffset_Inter2d::ConnexIntByIntInVert
// intersection with first edge
for (Exp1.Init(NE1, TopAbs_EDGE); Exp1.More(); Exp1.Next()) {
const TopoDS_Edge& aE1 = TopoDS::Edge(Exp1.Current());
RefEdgeInter(FIO, BAsurf, aE1, aE3, AsDes2d,
Tol, Standard_True, Pref, theDMVV, bCoincide);
BRepAlgo_Image anEmptyImage;
RefEdgeInter(FIO, BAsurf, aE1, aE3, anOr1, anOr2, AsDes2d,
Tol, Standard_True, Vref, anEmptyImage, theDMVV, bCoincide);
if (bCoincide) {
// in case of coincidence trim the edge E3 the same way as E1
Store(aE3, AsDes2d->Descendant(aE1), Tol, Standard_True, AsDes2d, theDMVV);
@@ -1740,8 +1955,9 @@ void BRepOffset_Inter2d::ConnexIntByIntInVert
// intersection with second edge
for (Exp1.Init(NE2, TopAbs_EDGE); Exp1.More(); Exp1.Next()) {
const TopoDS_Edge& aE2 = TopoDS::Edge(Exp1.Current());
RefEdgeInter(FIO, BAsurf, aE2, aE3, AsDes2d,
Tol, Standard_True, Pref, theDMVV, bCoincide);
BRepAlgo_Image anEmptyImage;
RefEdgeInter(FIO, BAsurf, aE2, aE3, anOr1, anOr2, AsDes2d,
Tol, Standard_True, Vref, anEmptyImage, theDMVV, bCoincide);
if (bCoincide) {
// in case of coincidence trim the edge E3 the same way as E2
Store(aE3, AsDes2d->Descendant(aE2), Tol, Standard_True, AsDes2d, theDMVV);
@@ -1759,8 +1975,9 @@ void BRepOffset_Inter2d::ConnexIntByIntInVert
for (Exp1.Next(); Exp1.More(); Exp1.Next()) {
const TopoDS_Edge& aE3Next = TopoDS::Edge(Exp1.Current());
if (aME.Contains(aE3Next)) {
RefEdgeInter(FIO, BAsurf, aE3Next, aE3, AsDes2d,
Tol, Standard_True, Pref, theDMVV, bCoincide);
BRepAlgo_Image anEmptyImage;
RefEdgeInter(FIO, BAsurf, aE3Next, aE3, anOr1, anOr2, AsDes2d,
Tol, Standard_True, Vref, anEmptyImage, theDMVV, bCoincide);
}
}
}
@@ -1795,7 +2012,8 @@ static void MakeChain(const TopoDS_Shape& theV,
//purpose :
//=======================================================================
Standard_Boolean BRepOffset_Inter2d::FuseVertices (const TopTools_IndexedDataMapOfShapeListOfShape& theDMVV,
const Handle(BRepAlgo_AsDes)& theAsDes)
const Handle(BRepAlgo_AsDes)& theAsDes,
BRepAlgo_Image& theImageVV)
{
BRep_Builder aBB;
TopTools_MapOfShape aMVDone;
@@ -1837,6 +2055,11 @@ Standard_Boolean BRepOffset_Inter2d::FuseVertices (const TopTools_IndexedDataMap
}
// and replace the vertex
theAsDes->Replace(aVOld, aVNew);
if (theImageVV.IsImage(aVOld))
{
const TopoDS_Vertex& aProVertex = TopoDS::Vertex (theImageVV.ImageFrom(aVOld));
theImageVV.Add (aProVertex, aVNew.Oriented(TopAbs_FORWARD));
}
}
}
return Standard_True;

View File

@@ -24,14 +24,17 @@
#include <TopTools_IndexedMapOfShape.hxx>
#include <Standard_Real.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
class BRepAlgo_AsDes;
class TopoDS_Face;
class BRepAlgo_Image;
class BRepOffset_Analyse;
class BRepOffset_Offset;
class TopoDS_Edge;
class TopoDS_Face;
//! Computes the intersections betwwen edges on a face
//! Computes the intersections between edges on a face
//! stores result is SD as AsDes from BRepOffset.
class BRepOffset_Inter2d
{
@@ -50,6 +53,7 @@ public:
const TopoDS_Face& F,
const TopTools_IndexedMapOfShape& NewEdges,
const Standard_Real Tol,
const TopTools_DataMapOfShapeListOfShape& theEdgeIntEdges,
TopTools_IndexedDataMapOfShapeListOfShape& theDMVV);
//! Computes the intersection between the offset edges of the <FI>.
@@ -58,15 +62,18 @@ public:
//! have to be fused using the FuseVertices method.
//! theDMVV contains the vertices that should be fused.
Standard_EXPORT static Standard_Boolean ConnexIntByInt (const TopoDS_Face& FI,
BRepOffset_Offset& OFI,
TopTools_DataMapOfShapeShape& MES,
const TopTools_DataMapOfShapeShape& Build,
const Handle(BRepAlgo_AsDes)& AsDes2d,
const Standard_Real Offset,
const Standard_Real Tol,
const BRepOffset_Analyse& Analyse,
TopTools_IndexedMapOfShape& FacesWithVerts,
TopTools_IndexedDataMapOfShapeListOfShape& theDMVV);
BRepOffset_Offset& OFI,
TopTools_DataMapOfShapeShape& MES,
const TopTools_DataMapOfShapeShape& Build,
const Handle(BRepAlgo_AsDes)& theAsDes,
const Handle(BRepAlgo_AsDes)& AsDes2d,
const Standard_Real Offset,
const Standard_Real Tol,
const BRepOffset_Analyse& Analyse,
TopTools_IndexedMapOfShape& FacesWithVerts,
BRepAlgo_Image& theImageVV,
TopTools_DataMapOfShapeListOfShape& theEdgeIntEdges,
TopTools_IndexedDataMapOfShapeListOfShape& theDMVV);
//! Computes the intersection between the offset edges generated
//! from vertices and stored into AsDes as descendants of the <FI>.
@@ -88,7 +95,9 @@ public:
//! and updates AsDes by replacing the old vertices
//! with the new ones.
Standard_EXPORT static Standard_Boolean FuseVertices (const TopTools_IndexedDataMapOfShapeListOfShape& theDMVV,
const Handle(BRepAlgo_AsDes)& theAsDes);
const Handle(BRepAlgo_AsDes)& theAsDes,
BRepAlgo_Image& theImageVV);
//! extents the edge
Standard_EXPORT static Standard_Boolean ExtentEdge (const TopoDS_Edge& E,
TopoDS_Edge& NE,

View File

@@ -169,6 +169,7 @@ void BRepOffset_Inter3d::FaceInter(const TopoDS_Face& F1,
{
TopTools_ListOfShape LInt1, LInt2;
TopoDS_Edge NullEdge;
TopoDS_Face NullFace;
if (F1.IsSame(F2)) return;
if (IsDone(F1,F2)) return;
@@ -221,11 +222,11 @@ void BRepOffset_Inter3d::FaceInter(const TopoDS_Face& F1,
if (BRepOffset_Tool::FindCommonShapes(TopoDS::Face(InitF1),
TopoDS::Face(InitF2),LE,LV)) {
if (!LE.IsEmpty()) {
BRepOffset_Tool::Inter3D (F1,F2,LInt1,LInt2,mySide,NullEdge);
BRepOffset_Tool::Inter3D (F1,F2,LInt1,LInt2,mySide,NullEdge,NullFace,NullFace);
}
}
else {
BRepOffset_Tool::Inter3D(F1,F2,LInt1,LInt2,mySide,NullEdge);
BRepOffset_Tool::Inter3D(F1,F2,LInt1,LInt2,mySide,NullEdge,NullFace,NullFace);
}
}
}
@@ -236,7 +237,7 @@ void BRepOffset_Inter3d::FaceInter(const TopoDS_Face& F1,
BRepOffset_Tool::PipeInter(F1,F2,LInt1,LInt2,mySide);
}
else {
BRepOffset_Tool::Inter3D (F1,F2,LInt1,LInt2,mySide,NullEdge);
BRepOffset_Tool::Inter3D (F1,F2,LInt1,LInt2,mySide,NullEdge,NullFace,NullFace);
}
}
Store (F1,F2,LInt1,LInt2);
@@ -259,6 +260,7 @@ void BRepOffset_Inter3d::ConnexIntByArc(const TopTools_ListOfShape& /*SetOfFaces
TopTools_ListOfShape LInt1,LInt2;
TopoDS_Face F1,F2;
TopoDS_Edge NullEdge;
TopoDS_Face NullFace;
//---------------------------------------------------------------------
// etape 1 : Intersection of faces // corresponding to the initial faces
@@ -273,10 +275,13 @@ void BRepOffset_Inter3d::ConnexIntByArc(const TopTools_ListOfShape& /*SetOfFaces
//-----------------------------------------------------------
const TopTools_ListOfShape& Anc = Analyse.Ancestors(E);
if (Anc.Extent() == 2) {
F1 = TopoDS::Face(InitOffsetFace.Image(Anc.First()).First());
F2 = TopoDS::Face(InitOffsetFace.Image(Anc.Last ()).First());
const TopoDS_Face& InitF1 = TopoDS::Face(Anc.First());
const TopoDS_Face& InitF2 = TopoDS::Face(Anc.Last());
F1 = TopoDS::Face(InitOffsetFace.Image(InitF1).First());
F2 = TopoDS::Face(InitOffsetFace.Image(InitF2).First());
if (!IsDone(F1,F2)) {
BRepOffset_Tool::Inter3D (F1,F2,LInt1,LInt2,mySide,E,Standard_True);
BRepOffset_Tool::Inter3D (F1,F2,LInt1,LInt2,mySide,E,InitF1,InitF2);
Store (F1,F2,LInt1,LInt2);
}
}
@@ -361,7 +366,7 @@ void BRepOffset_Inter3d::ConnexIntByArc(const TopTools_ListOfShape& /*SetOfFaces
if (!TangentFaces) {
F2 = TopoDS::Face(InitOffsetFace.Image(InitF2).First());
if (!IsDone(F1,F2)) {
BRepOffset_Tool::Inter3D (F1,F2,LInt1,LInt2,mySide,NullEdge);
BRepOffset_Tool::Inter3D (F1,F2,LInt1,LInt2,mySide,NullEdge,NullFace,NullFace);
Store (F1,F2,LInt1,LInt2);
}
}
@@ -371,7 +376,7 @@ void BRepOffset_Inter3d::ConnexIntByArc(const TopTools_ListOfShape& /*SetOfFaces
if (!TangentFaces) {
F2 = TopoDS::Face(InitOffsetFace.Image(InitF2).First());
if (!IsDone(F1,F2)) {
BRepOffset_Tool::Inter3D (F1,F2,LInt1,LInt2,mySide,NullEdge);
BRepOffset_Tool::Inter3D (F1,F2,LInt1,LInt2,mySide,NullEdge,NullFace,NullFace);
Store (F1,F2,LInt1,LInt2);
}
}
@@ -635,7 +640,7 @@ void BRepOffset_Inter3d::ConnexIntByInt
//
if (!IsDone(NF1,NF2)) {
TopTools_ListOfShape LInt1,LInt2;
BRepOffset_Tool::Inter3D (NF1,NF2,LInt1,LInt2,CurSide,E,bEdge);
BRepOffset_Tool::Inter3D (NF1,NF2,LInt1,LInt2,CurSide,E,F1,F2);
SetDone(NF1,NF2);
if (!LInt1.IsEmpty()) {
Store (NF1,NF2,LInt1,LInt2);
@@ -1034,7 +1039,7 @@ void BRepOffset_Inter3d::ContextIntByInt
TopTools_ListOfShape LInt1,LInt2;
TopTools_ListOfShape LOE;
LOE.Append(OE);
BRepOffset_Tool::Inter3D (WCF,NF,LInt1,LInt2,Side,E,bEdge);
BRepOffset_Tool::Inter3D (WCF,NF,LInt1,LInt2,Side,E,CF,F);
SetDone(NF,CF);
if (!LInt1.IsEmpty()) {
Store (CF,NF,LInt1,LInt2);
@@ -1086,6 +1091,7 @@ void BRepOffset_Inter3d::ContextIntByArc(const TopTools_IndexedMapOfShape& Conte
TopoDS_Edge OE;
BRep_Builder B;
TopoDS_Edge NullEdge;
TopoDS_Face NullFace;
Standard_Integer j;
for (j = 1; j <= ContextFaces.Extent(); j++) {
@@ -1255,7 +1261,7 @@ void BRepOffset_Inter3d::ContextIntByArc(const TopTools_IndexedMapOfShape& Conte
// If no trace try intersection.
//-------------------------------------------------------
if (LInt1.IsEmpty()) {
BRepOffset_Tool::Inter3D (CF,OF1,LInt1,LInt2,mySide,NullEdge);
BRepOffset_Tool::Inter3D (CF,OF1,LInt1,LInt2,mySide,NullEdge,NullFace,NullFace);
}
Store (CF,OF1,LInt1,LInt2);
}

View File

@@ -51,12 +51,14 @@ BRepOffset_MakeLoops::BRepOffset_MakeLoops()
void BRepOffset_MakeLoops::Build(const TopTools_ListOfShape& LF,
const Handle(BRepAlgo_AsDes)& AsDes,
BRepAlgo_Image& Image)
BRepAlgo_Image& Image,
BRepAlgo_Image& theImageVV)
{
TopTools_ListIteratorOfListOfShape it(LF);
TopTools_ListIteratorOfListOfShape itl,itLCE;
BRepAlgo_Loop Loops;
Loops.VerticesForSubstitute( myVerVerMap );
Loops.SetImageVV (theImageVV);
for (; it.More(); it.Next()) {
const TopoDS_Face& F = TopoDS::Face(it.Value());

View File

@@ -39,11 +39,20 @@ public:
Standard_EXPORT BRepOffset_MakeLoops();
Standard_EXPORT void Build (const TopTools_ListOfShape& LF, const Handle(BRepAlgo_AsDes)& AsDes, BRepAlgo_Image& Image);
Standard_EXPORT void Build (const TopTools_ListOfShape& LF,
const Handle(BRepAlgo_AsDes)& AsDes,
BRepAlgo_Image& Image,
BRepAlgo_Image& theImageVV);
Standard_EXPORT void BuildOnContext (const TopTools_ListOfShape& LContext, const BRepOffset_Analyse& Analyse, const Handle(BRepAlgo_AsDes)& AsDes, BRepAlgo_Image& Image, const Standard_Boolean InSide);
Standard_EXPORT void BuildOnContext (const TopTools_ListOfShape& LContext,
const BRepOffset_Analyse& Analyse,
const Handle(BRepAlgo_AsDes)& AsDes,
BRepAlgo_Image& Image,
const Standard_Boolean InSide);
Standard_EXPORT void BuildFaces (const TopTools_ListOfShape& LF, const Handle(BRepAlgo_AsDes)& AsDes, BRepAlgo_Image& Image);
Standard_EXPORT void BuildFaces (const TopTools_ListOfShape& LF,
const Handle(BRepAlgo_AsDes)& AsDes,
BRepAlgo_Image& Image);

View File

@@ -591,6 +591,7 @@ BRepOffset_MakeOffset::BRepOffset_MakeOffset(const TopoDS_Shape& S,
:
myOffset (Offset),
myTol (Tol),
myInitialShape (S),
myShape (S),
myMode (Mode),
myInter (Inter),
@@ -623,6 +624,7 @@ void BRepOffset_MakeOffset::Initialize(const TopoDS_Shape& S,
const Standard_Boolean RemoveIntEdges)
{
myOffset = Offset;
myInitialShape = S;
myShape = S;
myTol = Tol;
myMode = Mode;
@@ -650,9 +652,11 @@ void BRepOffset_MakeOffset::Clear()
myInitOffsetFace .Clear();
myInitOffsetEdge .Clear();
myImageOffset .Clear();
myImageVV .Clear();
myFaces .Clear();
myOriginalFaces .Clear();
myFaceOffset .Clear();
myEdgeIntEdges .Clear();
myAsDes ->Clear();
myDone = Standard_False;
myGenerated.Clear();
@@ -1256,7 +1260,7 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
{
const TopoDS_Face& NEF = TopoDS::Face(itLFE.Value());
Standard_Real aCurrFaceTol = BRep_Tool::Tolerance(NEF);
BRepOffset_Inter2d::Compute(AsDes, NEF, NewEdges, aCurrFaceTol, aDMVV);
BRepOffset_Inter2d::Compute(AsDes, NEF, NewEdges, aCurrFaceTol, myEdgeIntEdges, aDMVV);
}
//----------------------------------------------
// Intersections 2d on caps.
@@ -1266,10 +1270,10 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
{
const TopoDS_Face& Cork = TopoDS::Face(myFaces(i));
Standard_Real aCurrFaceTol = BRep_Tool::Tolerance(Cork);
BRepOffset_Inter2d::Compute(AsDes, Cork, NewEdges, aCurrFaceTol, aDMVV);
BRepOffset_Inter2d::Compute(AsDes, Cork, NewEdges, aCurrFaceTol, myEdgeIntEdges, aDMVV);
}
//
BRepOffset_Inter2d::FuseVertices(aDMVV, AsDes);
BRepOffset_Inter2d::FuseVertices(aDMVV, AsDes, myImageVV);
//-------------------------------
// Unwinding of extended Faces.
//-------------------------------
@@ -1286,7 +1290,7 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
}
}
else {
myMakeLoops.Build(LFE, AsDes, IMOE);
myMakeLoops.Build(LFE, AsDes, IMOE, myImageVV);
}
//
#ifdef OCCT_DEBUG
@@ -2526,10 +2530,10 @@ void BRepOffset_MakeOffset::Intersection2D(const TopTools_IndexedMapOfShape& Mod
Standard_Integer i;
for (i = 1; i <= Modif.Extent(); i++) {
const TopoDS_Face& F = TopoDS::Face(Modif(i));
BRepOffset_Inter2d::Compute(myAsDes,F,NewEdges,myTol, aDMVV);
BRepOffset_Inter2d::Compute(myAsDes, F, NewEdges, myTol, myEdgeIntEdges, aDMVV);
}
//
BRepOffset_Inter2d::FuseVertices(aDMVV, myAsDes);
BRepOffset_Inter2d::FuseVertices(aDMVV, myAsDes, myImageVV);
//
#ifdef OCCT_DEBUG
if (AffichInt2d) {
@@ -2569,7 +2573,7 @@ void BRepOffset_MakeOffset::MakeLoops(TopTools_IndexedMapOfShape& Modif)
BuildSplitsOfTrimmedFaces(LF, myAsDes, myImageOffset);
}
else {
myMakeLoops.Build(LF,myAsDes,myImageOffset);
myMakeLoops.Build(LF,myAsDes,myImageOffset,myImageVV);
}
//-----------------------------------------
@@ -3345,7 +3349,7 @@ const BRepAlgo_Image& BRepOffset_MakeOffset::OffsetEdgesFromShapes() const
const TopTools_IndexedMapOfShape& BRepOffset_MakeOffset::ClosingFaces () const
{
return myFaces;
return myOriginalFaces;
}
@@ -3998,8 +4002,8 @@ void BRepOffset_MakeOffset::IntersectEdges(const TopTools_ListOfShape& theFaces,
{
const TopoDS_Face& aF = TopoDS::Face (it.Value());
aTolF = BRep_Tool::Tolerance (aF);
if (!BRepOffset_Inter2d::ConnexIntByInt(aF, theMapSF(aF), theMES, theBuild, theAsDes2d,
myOffset, aTolF, myAnalyse, aMFV, aDMVV))
if (!BRepOffset_Inter2d::ConnexIntByInt(aF, theMapSF(aF), theMES, theBuild, theAsDes, theAsDes2d,
myOffset, aTolF, myAnalyse, aMFV, myImageVV, myEdgeIntEdges, aDMVV))
{
myError = BRepOffset_CannotExtentEdge;
return;
@@ -4015,7 +4019,7 @@ void BRepOffset_MakeOffset::IntersectEdges(const TopTools_ListOfShape& theFaces,
}
//
// fuse vertices on edges
if (!BRepOffset_Inter2d::FuseVertices(aDMVV, theAsDes2d))
if (!BRepOffset_Inter2d::FuseVertices(aDMVV, theAsDes2d, myImageVV))
{
myError = BRepOffset_CannotFuseVertices;
return;
@@ -4490,9 +4494,24 @@ const TopTools_ListOfShape& BRepOffset_MakeOffset::Generated (const TopoDS_Shape
Standard_FALLTHROUGH
case TopAbs_FACE:
{
if (myInitOffsetFace.HasImage (theS))
TopoDS_Shape aS = theS;
const TopoDS_Shape* aPlanface = myFacePlanfaceMap.Seek(aS);
if (aPlanface)
aS = TopoDS::Face(*aPlanface);
if (!myFaces.Contains (aS) &&
myInitOffsetFace.HasImage (aS))
{
myInitOffsetFace.LastImage (theS, myGenerated);
myInitOffsetFace.LastImage (aS, myGenerated);
if (!myFaces.IsEmpty())
{
// Reverse generated shapes in case of small solids.
// Useful only for faces without influence on others.
TopTools_ListIteratorOfListOfShape it(myGenerated);
for (; it.More(); it.Next())
it.Value().Reverse();
}
}
break;
}
@@ -4524,9 +4543,33 @@ const TopTools_ListOfShape& BRepOffset_MakeOffset::Generated (const TopoDS_Shape
//function : Modified
//purpose :
//=======================================================================
const TopTools_ListOfShape& BRepOffset_MakeOffset::Modified (const TopoDS_Shape&)
const TopTools_ListOfShape& BRepOffset_MakeOffset::Modified (const TopoDS_Shape& theShape)
{
myGenerated.Clear();
if (theShape.ShapeType() == TopAbs_FACE)
{
TopoDS_Shape aS = theShape;
const TopoDS_Shape* aPlanface = myFacePlanfaceMap.Seek(aS);
if (aPlanface)
aS = TopoDS::Face(*aPlanface);
if (myFaces.Contains (aS) &&
myInitOffsetFace.HasImage (aS))
{
myInitOffsetFace.LastImage (aS, myGenerated);
if (!myFaces.IsEmpty())
{
// Reverse generated shapes in case of small solids.
// Useful only for faces without influence on others.
TopTools_ListIteratorOfListOfShape it(myGenerated);
for (; it.More(); it.Next())
it.Value().Reverse();
}
}
}
return myGenerated;
}

View File

@@ -97,7 +97,7 @@ public:
const TopoDS_Shape& InitShape() const
{
return myShape;
return myInitialShape;
}
//! returns information about offset state.
@@ -231,6 +231,7 @@ private:
Standard_Real myOffset;
Standard_Real myTol;
TopoDS_Shape myInitialShape;
TopoDS_Shape myShape;
TopoDS_Compound myFaceComp;
BRepOffset_Mode myMode;
@@ -248,8 +249,10 @@ private:
BRepAlgo_Image myInitOffsetFace;
BRepAlgo_Image myInitOffsetEdge;
BRepAlgo_Image myImageOffset;
BRepAlgo_Image myImageVV;
TopTools_ListOfShape myWalls;
Handle(BRepAlgo_AsDes) myAsDes;
TopTools_DataMapOfShapeListOfShape myEdgeIntEdges;
Standard_Boolean myDone;
BRepOffset_Error myError;
BRepOffset_MakeLoops myMakeLoops;

View File

@@ -5678,7 +5678,9 @@ void IntersectFaces(const TopoDS_Shape& theFInv,
TopAbs_State aSide = TopAbs_OUT;
TopTools_ListOfShape aLInt1, aLInt2;
TopoDS_Edge aNullEdge;
BRepOffset_Tool::Inter3D(TopoDS::Face(theFi), TopoDS::Face(theFj), aLInt1, aLInt2, aSide, aNullEdge);
TopoDS_Face aNullFace;
BRepOffset_Tool::Inter3D(TopoDS::Face(theFi), TopoDS::Face(theFj), aLInt1, aLInt2, aSide,
aNullEdge, aNullFace, aNullFace);
//
if (aLInt1.IsEmpty()) {
return;

View File

@@ -1401,8 +1401,9 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
TopTools_ListOfShape& L1,
TopTools_ListOfShape& L2,
const TopAbs_State Side,
const TopoDS_Edge& RefEdge,
const Standard_Boolean IsRefEdgeDefined)
const TopoDS_Edge& RefEdge,
const TopoDS_Face& theRefFace1,
const TopoDS_Face& theRefFace2)
{
#ifdef DRAW
if (AffichInter) {
@@ -1445,7 +1446,7 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
aPF.Perform();
TopTools_IndexedMapOfShape TrueEdges;
if (IsRefEdgeDefined)
if (!RefEdge.IsNull())
CheckIntersFF( aPF.PDS(), RefEdge, TrueEdges );
Standard_Boolean addPCurve1 = 1;
@@ -1494,33 +1495,33 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
if (!BOPTools_AlgoTools2D::HasCurveOnSurface(anEdge, F1)) {
Handle(Geom2d_Curve) aC2d = aBC.Curve().FirstCurve2d();
if(!aC3DETrim.IsNull()) {
Handle(Geom2d_Curve) aC2dNew;
if(aC3DE->IsPeriodic()) {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(F1, f, l, aC2d, aC2dNew, aContext);
}
else {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(F1, aC3DETrim, aC2d, aC2dNew, aContext);
}
aC2d = aC2dNew;
}
BB.UpdateEdge(anEdge, aC2d, F1, aTolEdge);
Handle(Geom2d_Curve) aC2dNew;
if(aC3DE->IsPeriodic()) {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(F1, f, l, aC2d, aC2dNew, aContext);
}
else {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(F1, aC3DETrim, aC2d, aC2dNew, aContext);
}
aC2d = aC2dNew;
}
BB.UpdateEdge(anEdge, aC2d, F1, aTolEdge);
}
if (!BOPTools_AlgoTools2D::HasCurveOnSurface(anEdge, F2)) {
Handle(Geom2d_Curve) aC2d = aBC.Curve().SecondCurve2d();
if(!aC3DETrim.IsNull()) {
Handle(Geom2d_Curve) aC2dNew;
if(aC3DE->IsPeriodic()) {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(F2, f, l, aC2d, aC2dNew, aContext);
}
else {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(F2, aC3DETrim, aC2d, aC2dNew, aContext);
}
aC2d = aC2dNew;
}
BB.UpdateEdge(anEdge, aC2d, F2, aTolEdge);
Handle(Geom2d_Curve) aC2dNew;
if(aC3DE->IsPeriodic()) {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(F2, f, l, aC2d, aC2dNew, aContext);
}
else {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(F2, aC3DETrim, aC2d, aC2dNew, aContext);
}
aC2d = aC2dNew;
}
BB.UpdateEdge(anEdge, aC2d, F2, aTolEdge);
}
OrientSection (anEdge, F1, F2, O1, O2);
@@ -1563,6 +1564,84 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
else if (aSurf->IsKind(STANDARD_TYPE(Geom_ElementarySurface)))
isEl2 = Standard_True;
if (L1.Extent() > 1 && (!isEl1 || !isEl2) && !theRefFace1.IsNull())
{
//remove excess edges that are out of range
TopoDS_Vertex aV1, aV2;
TopExp::Vertices (RefEdge, aV1, aV2);
if (!aV1.IsSame(aV2)) //only if RefEdge is open
{
Handle(Geom_Surface) aRefSurf1 = BRep_Tool::Surface (theRefFace1);
Handle(Geom_Surface) aRefSurf2 = BRep_Tool::Surface (theRefFace2);
if (aRefSurf1->IsUClosed() || aRefSurf1->IsVClosed() ||
aRefSurf2->IsUClosed() || aRefSurf2->IsVClosed())
{
TopoDS_Edge MinAngleEdge;
Standard_Real MinAngle = Precision::Infinite();
BRepAdaptor_Curve aRefBAcurve (RefEdge);
gp_Pnt aRefPnt = aRefBAcurve.Value ((aRefBAcurve.FirstParameter() + aRefBAcurve.LastParameter())/2);
TopTools_ListIteratorOfListOfShape itl (L1);
for (; itl.More(); itl.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge (itl.Value());
BRepAdaptor_Curve aBAcurve (anEdge);
gp_Pnt aMidPntOnEdge = aBAcurve.Value ((aBAcurve.FirstParameter() + aBAcurve.LastParameter())/2);
gp_Vec RefToMid (aRefPnt, aMidPntOnEdge);
Extrema_ExtPC aProjector (aRefPnt, aBAcurve);
if (aProjector.IsDone())
{
Standard_Integer imin = 0;
Standard_Real MinSqDist = Precision::Infinite();
for (Standard_Integer ind = 1; ind <= aProjector.NbExt(); ind++)
{
Standard_Real aSqDist = aProjector.SquareDistance(ind);
if (aSqDist < MinSqDist)
{
MinSqDist = aSqDist;
imin = ind;
}
}
if (imin != 0)
{
gp_Pnt aProjectionOnEdge = aProjector.Point(imin).Value();
gp_Vec RefToProj (aRefPnt, aProjectionOnEdge);
Standard_Real anAngle = RefToProj.Angle(RefToMid);
if (anAngle < MinAngle)
{
MinAngle = anAngle;
MinAngleEdge = anEdge;
}
}
}
}
if (!MinAngleEdge.IsNull())
{
TopTools_ListIteratorOfListOfShape itlist1 (L1);
TopTools_ListIteratorOfListOfShape itlist2 (L2);
while (itlist1.More())
{
const TopoDS_Shape& anEdge = itlist1.Value();
if (anEdge.IsSame(MinAngleEdge))
{
itlist1.Next();
itlist2.Next();
}
else
{
L1.Remove(itlist1);
L2.Remove(itlist2);
}
}
}
} //if closed
} //if (!aV1.IsSame(aV2))
} //if (L1.Extent() > 1 && (!isEl1 || !isEl2) && !theRefFace1.IsNull())
if (L1.Extent() > 1 && (!isEl1 || !isEl2)) {
TopTools_SequenceOfShape eseq;
TopTools_SequenceOfShape EdgesForConcat;
@@ -1724,7 +1803,7 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
eseq.Append( aLocalEdgesForConcat(j) );
else
eseq.Append( AssembledEdge );
}
} //for (i = 1; i <= wseq.Length(); i++)
} //end of else (when TrueEdges is empty)
if (eseq.Length() < L1.Extent())
@@ -3115,23 +3194,12 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
}
else
{
if (theExtensionMode == 2)
{
Standard_Real FaceDU = UF2 - UF1;
Standard_Real FaceDV = VF2 - VF1;
UU1 = UF1 - 10*FaceDU;
UU2 = UF2 + 10*FaceDU;
VV1 = VF1 - 10*FaceDV;
VV2 = VF2 + 10*FaceDV;
}
else
{
Standard_Real aSize = theLenBeforeUfirst;
UU1 = UF1 - aSize;
UU2 = UF2 + aSize;
VV1 = VF1 - aSize;
VV2 = VF2 + aSize;
}
Standard_Real FaceDU = UF2 - UF1;
Standard_Real FaceDV = VF2 - VF1;
UU1 = UF1 - 10*FaceDU;
UU2 = UF2 + 10*FaceDU;
VV1 = VF1 - 10*FaceDV;
VV2 = VF2 + 10*FaceDV;
coeff = 1.;
}
@@ -3479,7 +3547,8 @@ void BRepOffset_Tool::ExtentFace (const TopoDS_Face& F,
if (ConstShapes.IsBound(E)) ToBuild.UnBind(E);
if (ToBuild.IsBound(E)) {
EnLargeFace(TopoDS::Face(ToBuild(E)),StopFace,Standard_False);
BRepOffset_Tool::Inter3D (EF,StopFace,LInt1,LInt2,Side,E,Standard_True);
TopoDS_Face NullFace;
BRepOffset_Tool::Inter3D (EF,StopFace,LInt1,LInt2,Side,E,NullFace,NullFace);
// No intersection, it may happen for example for a chosen (non-offseted) planar face and
// its neighbour offseted cylindrical face, if the offset is directed so that
// the radius of the cylinder becomes smaller.

View File

@@ -87,9 +87,10 @@ public:
const TopoDS_Face& F2,
TopTools_ListOfShape& LInt1,
TopTools_ListOfShape& LInt2,
const TopAbs_State Side,
const TopoDS_Edge& RefEdge,
const Standard_Boolean IsRefEdgeDefined = Standard_False);
const TopAbs_State Side,
const TopoDS_Edge& RefEdge,
const TopoDS_Face& RefFace1,
const TopoDS_Face& RefFace2);
//! Find if the edges <Edges> of the face <F2> are on
//! the face <F1>.

View File

@@ -1780,10 +1780,12 @@ void BiTgte_Blend::ComputeCenters()
}
}
}
TopTools_DataMapOfShapeListOfShape anEmptyMap;
BRepOffset_Inter2d::Compute(myAsDes,
CurOF,
myEdges,
myTol,
anEmptyMap,
aDMVV);
}
}
@@ -1813,20 +1815,23 @@ void BiTgte_Blend::ComputeCenters()
myAsDes->Add(CurOF,CurOE);
}
TopTools_DataMapOfShapeListOfShape anEmptyMap;
BRepOffset_Inter2d::Compute(myAsDes,
CurOF,
myEdges,
myTol,
anEmptyMap,
aDMVV);
}
//
// fuse vertices on edges stored in AsDes
BRepOffset_Inter2d::FuseVertices(aDMVV, myAsDes);
BRepAlgo_Image anEmptyImage;
BRepOffset_Inter2d::FuseVertices(aDMVV, myAsDes, anEmptyImage);
// ------------
// unwinding
// ------------
BRepOffset_MakeLoops MakeLoops;
MakeLoops.Build( LOF, myAsDes, myImageOffset );
MakeLoops.Build (LOF, myAsDes, myImageOffset, anEmptyImage);
// ------------------------------------------------------------
// It is possible to unwind edges at least one ancestor which of

View File

@@ -208,12 +208,13 @@ Standard_Integer Extrema_FuncExtCS::GetStateNumber()
std::cout <<"F(1)= "<<Sol(1)<<" F(2)= "<<Sol(2)<<" F(3)= "<<Sol(3)<<std::endl;
#endif
//comparison of solution with previous solutions
Standard_Real tol2d = Precision::PConfusion() * Precision::PConfusion();
Standard_Real tol2d = Precision::SquarePConfusion();
Standard_Integer i = 1, nbSol = mySqDist.Length();
for( ; i <= nbSol; i++)
{
Standard_Real aT = myPoint1(i).Parameter();
if( (myt - aT) * (myt - aT) <= tol2d )
aT -= myt; aT *= aT;
if( aT <= tol2d )
break;
}
if (i <= nbSol)

View File

@@ -38,6 +38,8 @@
#include <TColgp_Array1OfPnt.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <ElCLib.hxx>
#include <Extrema_GenLocateExtPS.hxx>
const Standard_Real MaxParamVal = 1.0e+10;
const Standard_Real aBorderDivisor = 1.0e+4;
@@ -331,8 +333,8 @@ void Extrema_GenExtCS::Perform (const Adaptor3d_Curve& C,
// Find min approximation
math_FunctionSetRoot anA(myF, Tol);
anA.Perform(myF, TUV, TUVinf, TUVsup);
myDone = Standard_True;
}
//=======================================================================
//function : GlobMinGenCS
@@ -447,6 +449,7 @@ void Extrema_GenExtCS::GlobMinConicS(const Adaptor3d_Curve& theC,
anUVsup(i) = theTUVsup(i + 1);
}
//
//
math_PSOParticlesPool aParticles(theNbParticles, aNbVar);
math_Vector aMinUV(1, aNbVar);
@@ -517,10 +520,103 @@ void Extrema_GenExtCS::GlobMinConicS(const Adaptor3d_Curve& theC,
aCT = ElCLib::InPeriod(aCT, theTUVinf(1), theTUVinf(1) + 2. * M_PI);
}
}
theTUV(1) = aCT;
theTUV(2) = anUV(1);
theTUV(3) = anUV(2);
Standard_Boolean isBadSol = Standard_False;
gp_Vec aDU, aDV, aDT;
gp_Pnt aPOnS, aPOnC;
myS->D1(anUV(1), anUV(2), aPOnS, aDU, aDV);
theC.D1(aCT, aPOnC, aDT);
Standard_Real aSqDist = aPOnC.SquareDistance(aPOnS);
if (aSqDist <= Precision::SquareConfusion())
return;
gp_Vec aN = aDU.Crossed(aDV);
if (aN.SquareMagnitude() < Precision::SquareConfusion())
return;
gp_Vec PcPs(aPOnC, aPOnS);
Standard_Real anAngMin = M_PI_2 - M_PI_2 / 10.;
Standard_Real anAngMax = M_PI_2 + M_PI_2 / 10.;
Standard_Real anAngN = PcPs.Angle(aN);
if (anAngN >= anAngMin && anAngN <= anAngMax)
{
// PcPs is perpendicular to surface normal, it means that
// aPOnC can be on surface, but far from aPOnS
isBadSol = Standard_True;
Standard_Integer iu, iv;
for (iu = -1; iu <= 1; ++iu)
{
Standard_Real u = anUV(1) + iu * aStepSU;
u = Max(anUVinf(1), u);
u = Min(anUVsup(1), u);
for (iv = -1; iv <= 1; ++iv)
{
Standard_Real v = anUV(2) + iv * aStepSV;
v = Max(anUVinf(2), v);
v = Min(anUVsup(2), v);
myS->D1(u, v, aPOnS, aDU, aDV);
if (aPOnC.SquareDistance(aPOnS) < Precision::SquareConfusion())
{
isBadSol = Standard_False;
break;
}
aN = aDU.Crossed(aDV);
if (aN.SquareMagnitude() < Precision::SquareConfusion())
{
isBadSol = Standard_False;
break;
}
PcPs.SetXYZ(aPOnS.XYZ() - aPOnC.XYZ());
anAngN = PcPs.Angle(aN);
if (anAngN < anAngMin || anAngN > anAngMax)
{
isBadSol = Standard_False;
break;
}
}
if (!isBadSol)
{
break;
}
}
}
if (isBadSol)
{
//Try to precise solution with help of Extrema PS
math_Vector aF(1, 3);
aF(1) = PcPs.Dot(aDT);
aF(2) = PcPs.Dot(aDU);
aF(3) = PcPs.Dot(aDV);
Standard_Real aFF = aF.Norm2();
Extrema_GenLocateExtPS anExtPS(*myS, mytol2, mytol2);
anExtPS.Perform(aPOnC, anUV(1), anUV(2), Standard_False);
if (anExtPS.IsDone())
{
const Extrema_POnSurf& aPmin = anExtPS.Point();
aPmin.Parameter(anUV(1), anUV(2));
math_Vector aTUV = theTUV;
aTUV(2) = anUV(1);
aTUV(3) = anUV(2);
myF.Value(aTUV, aF);
Standard_Real aFF1 = aF.Norm2();
if (anExtPS.SquareDistance() < aSqDist && aFF1 <= 1.1 * aFF)
{
theTUV(2) = aTUV(2);
theTUV(3) = aTUV(3);
}
}
}
}
//=======================================================================
//function : GlobMinCQuadric

View File

@@ -57,10 +57,6 @@ public:
const IMeshData::IFacePtr& theDFace,
const TopAbs_Orientation theOrientation) const = 0;
//! Returns an array of pcurves indices for the specified discrete face.
Standard_EXPORT virtual const IMeshData::ListOfInteger& GetPCurves (
const IMeshData::IFacePtr& theDFace) const = 0;
//! Returns pcurve with the given index.
Standard_EXPORT virtual const IMeshData::IPCurveHandle& GetPCurve (
const Standard_Integer theIndex) const = 0;

View File

@@ -526,8 +526,6 @@
#include <RWStepVisual_RWPresentationStyleByContext.hxx>
#include <RWStepVisual_RWPresentationView.hxx>
#include <RWStepVisual_RWPresentedItemRepresentation.hxx>
#include <RWStepVisual_RWRepositionedTessellatedGeometricSet.hxx>
#include <RWStepVisual_RWRepositionedTessellatedItem.hxx>
#include <RWStepVisual_RWStyledItem.hxx>
#include <RWStepVisual_RWSurfaceSideStyle.hxx>
#include <RWStepVisual_RWSurfaceStyleBoundary.hxx>
@@ -1084,8 +1082,6 @@
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepVisual_PresentationView.hxx>
#include <StepVisual_PresentedItemRepresentation.hxx>
#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
#include <StepVisual_RepositionedTessellatedItem.hxx>
#include <StepVisual_StyledItem.hxx>
#include <StepVisual_SurfaceSideStyle.hxx>
#include <StepVisual_SurfaceStyleBoundary.hxx>
@@ -5197,13 +5193,6 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN,
tool.Share(anent, iter);
}
break;
case 802:
{
DeclareAndCast(StepVisual_RepositionedTessellatedGeometricSet, anEnt, ent);
RWStepVisual_RWRepositionedTessellatedGeometricSet aTool;
aTool.Share(anEnt, iter);
break;
}
default : break;
}
}
@@ -7228,12 +7217,6 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid
case 723:
ent = new StepVisual_SurfaceStyleRenderingWithProperties;
break;
case 802:
ent = new StepVisual_RepositionedTessellatedGeometricSet;
break;
case 803:
ent = new StepVisual_RepositionedTessellatedItem;
break;
default:
return Standard_False;
}
@@ -7836,8 +7819,7 @@ Standard_Integer RWStepAP214_GeneralModule::CategoryNumber
case 721:
case 722:
case 723: return catdr;
case 802: return cataux;
case 803: return cataux;
default : break;
}
return 0;

View File

@@ -258,8 +258,6 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
#include <StepVisual_PresentationStyleAssignment.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepVisual_PresentationView.hxx>
#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
#include <StepVisual_RepositionedTessellatedItem.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_ProductCategory.hxx>
#include <StepBasic_ProductContext.hxx>
@@ -656,8 +654,6 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule)
#include <RWStepVisual_RWPresentationStyleAssignment.hxx>
#include <RWStepVisual_RWPresentationStyleByContext.hxx>
#include <RWStepVisual_RWPresentationView.hxx>
#include <RWStepVisual_RWRepositionedTessellatedGeometricSet.hxx>
#include <RWStepVisual_RWRepositionedTessellatedItem.hxx>
#include <RWStepBasic_RWProduct.hxx>
#include <RWStepBasic_RWProductCategory.hxx>
#include <RWStepBasic_RWProductContext.hxx>
@@ -2051,8 +2047,6 @@ static TCollection_AsciiString Reco_AnnotationPlane("ANNOTATION_PLANE");
static TCollection_AsciiString Reco_TessellatedAnnotationOccurrence("TESSELLATED_ANNOTATION_OCCURRENCE");
static TCollection_AsciiString Reco_TessellatedGeometricSet("TESSELLATED_GEOMETRIC_SET");
static TCollection_AsciiString Reco_TessellatedCurveSet("TESSELLATED_CURVE_SET");
static TCollection_AsciiString Reco_TessellatedItem("TESSELLATED_ITEM");
static TCollection_AsciiString Reco_RepositionedTessellatedItem("REPOSITIONED_TESSELLATED_ITEM");
static TCollection_AsciiString Reco_CoordinatesList("COORDINATES_LIST");
static TCollection_AsciiString Reco_ConstructiveGeometryRepresentation("CONSTRUCTIVE_GEOMETRY_REPRESENTATION");
static TCollection_AsciiString Reco_ConstructiveGeometryRepresentationRelationship("CONSTRUCTIVE_GEOMETRY_REPRESENTATION_RELATIONSHIP");
@@ -2727,7 +2721,6 @@ RWStepAP214_ReadWriteModule::RWStepAP214_ReadWriteModule ()
typenums.Bind (Reco_SurfaceStyleReflectanceAmbient, 721);
typenums.Bind (Reco_SurfaceStyleRendering, 722);
typenums.Bind (Reco_SurfaceStyleRenderingWithProperties, 723);
typenums.Bind (Reco_RepositionedTessellatedItem, 803);
// SHORT NAMES
// NB : la liste est celle de AP203
@@ -3496,22 +3489,13 @@ Standard_Integer RWStepAP214_ReadWriteModule::CaseStep
types(5).IsEqual(StepType(624))))) {
return 705;
}
else if ((types(1).IsEqual(StepType(4))) &&
if ((types(1).IsEqual(StepType(4))) &&
(types(2).IsEqual(StepType(7))) &&
(types(3).IsEqual(StepType(144))) &&
(types(4).IsEqual(StepType(247))) &&
(types(5).IsEqual(StepType(270))))
{
(types(5).IsEqual(StepType(270)))) {
return 719;
}
else if ((types(1).IsEqual(StepType(144))) &&
(types(2).IsEqual(StepType(803))) &&
(types(3).IsEqual(StepType(247))) &&
(types(4).IsEqual(StepType(709))) &&
(types(5).IsEqual(StepType(708))))
{
return 802;
}
}
else if (NbComp == 4) {
if ((types(1).IsEqual(StepType(161))) &&
@@ -4581,7 +4565,6 @@ const TCollection_AsciiString& RWStepAP214_ReadWriteModule::StepType
case 704: return Reco_AnnotationPlane;
case 707 : return Reco_TessellatedAnnotationOccurrence;
case 708 : return Reco_TessellatedItem;
case 709 : return Reco_TessellatedGeometricSet;
case 710 : return Reco_TessellatedCurveSet;
@@ -4598,7 +4581,6 @@ const TCollection_AsciiString& RWStepAP214_ReadWriteModule::StepType
case 722 : return Reco_SurfaceStyleRendering;
case 723 : return Reco_SurfaceStyleRenderingWithProperties;
case 803: return Reco_RepositionedTessellatedItem;
default : return PasReco;
}
}
@@ -4882,6 +4864,7 @@ Standard_Boolean RWStepAP214_ReadWriteModule::ComplexType(const Standard_Integer
types.Append (StepType(625));
types.Append (StepType(677));
break;
default : return Standard_False;
case 698:
types.Append (StepType(671));
types.Append (StepType(470));
@@ -4919,14 +4902,6 @@ Standard_Boolean RWStepAP214_ReadWriteModule::ComplexType(const Standard_Integer
types.Append(StepType(247));
types.Append(StepType(270));
break;
case 802:
types.Append(StepType(144));
types.Append(StepType(803));
types.Append(StepType(247));
types.Append(StepType(709));
types.Append(StepType(708));
break;
default: return Standard_False;
}
return Standard_True;
}
@@ -9533,20 +9508,6 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN,
tool.ReadStep(data, num, ach, anent);
}
break;
case 802:
{
DeclareAndCast(StepVisual_RepositionedTessellatedGeometricSet, anEnt, ent);
RWStepVisual_RWRepositionedTessellatedGeometricSet aTool;
aTool.ReadStep(data, num, ach, anEnt);
break;
}
case 803:
{
DeclareAndCast(StepVisual_RepositionedTessellatedItem, anEnt, ent);
RWStepVisual_RWRepositionedTessellatedItem aTool;
aTool.ReadStep(data, num, ach, anEnt);
break;
}
default:
ach->AddFail("Type Mismatch when reading - Entity");
@@ -14431,21 +14392,6 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN,
tool.WriteStep(SW, anent);
}
break;
break;
case 802:
{
DeclareAndCast(StepVisual_RepositionedTessellatedGeometricSet, anEnt, ent);
RWStepVisual_RWRepositionedTessellatedGeometricSet aTool;
aTool.WriteStep(SW, anEnt);
break;
}
case 803:
{
DeclareAndCast(StepVisual_RepositionedTessellatedItem, anEnt, ent);
RWStepVisual_RWRepositionedTessellatedItem aTool;
aTool.WriteStep(SW, anEnt);
break;
}
default:
return;
}

View File

@@ -106,10 +106,6 @@ RWStepVisual_RWPresentationView.cxx
RWStepVisual_RWPresentationView.hxx
RWStepVisual_RWPresentedItemRepresentation.cxx
RWStepVisual_RWPresentedItemRepresentation.hxx
RWStepVisual_RWRepositionedTessellatedGeometricSet.cxx
RWStepVisual_RWRepositionedTessellatedGeometricSet.hxx
RWStepVisual_RWRepositionedTessellatedItem.cxx
RWStepVisual_RWRepositionedTessellatedItem.hxx
RWStepVisual_RWStyledItem.cxx
RWStepVisual_RWStyledItem.hxx
RWStepVisual_RWSurfaceSideStyle.cxx

View File

@@ -1,99 +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.
#include <RWStepVisual_RWRepositionedTessellatedGeometricSet.hxx>
#include <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepRepr_RepresentationItem.hxx>
#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
#include <StepVisual_PresentationStyleAssignment.hxx>
#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
//=======================================================================
//function : ReadStep
//purpose :
//=======================================================================
void RWStepVisual_RWRepositionedTessellatedGeometricSet::ReadStep
(const Handle(StepData_StepReaderData)& theData,
const Standard_Integer theNum,
Handle(Interface_Check)& theAch,
const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt) const
{
Standard_Integer aNum = 0;
theData->NamedForComplex("REPOSITIONED_TESSELLATED_ITEM", theNum, aNum, theAch);
if (!theData->CheckNbParams(aNum, 1, theAch, "location"))
return;
Handle(StepGeom_Axis2Placement3d) aLocation;
theData->ReadEntity(aNum,1,"location",theAch,STANDARD_TYPE(StepGeom_Axis2Placement3d), aLocation);
theData->NamedForComplex("REPRESENTATION_ITEM", theNum, aNum, theAch);
if (!theData->CheckNbParams(aNum, 1, theAch, "name"))
return;
Handle(TCollection_HAsciiString) aName;
theData->ReadString (aNum, 1, "name", theAch, aName);
theData->NamedForComplex("TESSELLATED_GEOMETRIC_SET", theNum, aNum, theAch);
NCollection_Handle<StepVisual_Array1OfTessellatedItem> anItems;
Standard_Integer aNSub2;
if (theData->ReadSubList (aNum,1,"items",theAch,aNSub2)) {
Standard_Integer aNb2 = theData->NbParams(aNSub2);
anItems = new StepVisual_Array1OfTessellatedItem(1, aNb2);
for (Standard_Integer i2 = 1; i2 <= aNb2; i2 ++) {
Handle(StepVisual_TessellatedItem) anItem;
if (theData->ReadEntity (aNSub2,i2,"item",theAch,STANDARD_TYPE(StepVisual_TessellatedItem), anItem))
anItems->SetValue(i2,anItem);
}
}
theEnt->Init(aName, anItems, aLocation);
}
//=======================================================================
//function : WriteStep
//purpose :
//=======================================================================
void RWStepVisual_RWRepositionedTessellatedGeometricSet::WriteStep
(StepData_StepWriter& theSW,
const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt) const
{
theSW.StartEntity("GEOMETRIC_REPRESENTATION_ITEM");
theSW.StartEntity("REPOSITIONED_TESSELLATED_ITEM");
theSW.Send(theEnt->Location());
theSW.StartEntity("REPRESENTATION_ITEM");
theSW.Send(theEnt->Name());
theSW.StartEntity("TESSELLATED_GEOMETRIC_SET");
theSW.OpenSub();
for(StepVisual_Array1OfTessellatedItem::Iterator anIter(*theEnt->Items());
anIter.More(); anIter.Next())
{
theSW.Send(anIter.Value());
}
theSW.CloseSub();
theSW.StartEntity("TESSELLATED_ITEM");
}
//=======================================================================
//function : Share
//purpose :
//=======================================================================
void RWStepVisual_RWRepositionedTessellatedGeometricSet::Share(const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt,
Interface_EntityIterator& theIter) const
{
// Own field : children
for (Standard_Integer i = 1; i <= theEnt->Items()->Length(); i++)
theIter.AddItem(theEnt->Items()->Value(i));
theIter.AddItem(theEnt->Location());
}

View File

@@ -1,50 +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 _RWStepVisual_RWRepositionedTessellatedGeometricSet_HeaderFile
#define _RWStepVisual_RWRepositionedTessellatedGeometricSet_HeaderFile
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
class StepData_StepReaderData;
class Interface_Check;
class StepVisual_RepositionedTessellatedGeometricSet;
class StepData_StepWriter;
class Interface_EntityIterator;
//! Read & Write tool for complex RepositionedTessellatedGeometricSet
class RWStepVisual_RWRepositionedTessellatedGeometricSet
{
public:
DEFINE_STANDARD_ALLOC
//! Empty constructor
RWStepVisual_RWRepositionedTessellatedGeometricSet() {};
//! Reads RepositionedTessellatedGeometricSet
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& theData,
const Standard_Integer theNum,
Handle(Interface_Check)& theAch,
const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt) const;
//! Writes RepositionedTessellatedGeometricSet
Standard_EXPORT void WriteStep (StepData_StepWriter& theSW,
const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt) const;
//! Fills data for graph (shared items)
Standard_EXPORT void Share (const Handle(StepVisual_RepositionedTessellatedGeometricSet)& theEnt,
Interface_EntityIterator& theIter) const;
};
#endif // _RWStepVisual_RWRepositionedTessellatedGeometricSet_HeaderFile

View File

@@ -1,58 +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.
#include <RWStepVisual_RWRepositionedTessellatedItem.hxx>
#include <Interface_Check.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepVisual_RepositionedTessellatedItem.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
//=======================================================================
//function : ReadStep
//purpose :
//=======================================================================
void RWStepVisual_RWRepositionedTessellatedItem::ReadStep
(const Handle(StepData_StepReaderData)& theData,
const Standard_Integer theNum,
Handle(Interface_Check)& theAch,
const Handle(StepVisual_RepositionedTessellatedItem)& theEnt) const
{
// --- Number of Parameter Control ---
if (!theData->CheckNbParams(theNum,2,theAch,"tessellated_item"))
return;
// --- inherited field : name ---
Handle(TCollection_HAsciiString) aName;
theData->ReadString (theNum,1,"name",theAch,aName);
// --- inherited field : location ---
Handle(StepGeom_Axis2Placement3d) aLocation;
theData->ReadEntity(theNum,2,"location", theAch, STANDARD_TYPE(StepGeom_Axis2Placement3d),aLocation);
//--- Initialisation of the read entity ---
theEnt->Init(aName, aLocation);
}
//=======================================================================
//function : WriteStep
//purpose :
//=======================================================================
void RWStepVisual_RWRepositionedTessellatedItem::WriteStep
(StepData_StepWriter& theSW,
const Handle(StepVisual_RepositionedTessellatedItem)& theEnt) const
{
// --- inherited field name ---
theSW.Send(theEnt->Name());
theSW.Send(theEnt->Location());
}

View File

@@ -1,46 +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 _RWStepVisual_RWRepositionedTessellatedItem_HeaderFile
#define _RWStepVisual_RWRepositionedTessellatedItem_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
class StepData_StepReaderData;
class Interface_Check;
class StepVisual_RepositionedTessellatedItem;
class StepData_StepWriter;
//! Read & Write tool for RepositionedTessellatedItem
class RWStepVisual_RWRepositionedTessellatedItem
{
public:
DEFINE_STANDARD_ALLOC
//! Empty constructor
RWStepVisual_RWRepositionedTessellatedItem() {};
//! Reads RepositionedTessellatedItem
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& theData,
const Standard_Integer theNum,
Handle(Interface_Check)& theAch,
const Handle(StepVisual_RepositionedTessellatedItem)& theEnt) const;
//! Writes RepositionedTessellatedItem
Standard_EXPORT void WriteStep (StepData_StepWriter& theSW,
const Handle(StepVisual_RepositionedTessellatedItem)& theEnt) const;
};
#endif // _RWStepVisual_RWRepositionedTessellatedItem_HeaderFile

View File

@@ -16,11 +16,8 @@
#include <STEPCAFControl_Reader.hxx>
#include <BRep_Builder.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <Geom_Axis2Placement.hxx>
#include <Geom_CartesianPoint.hxx>
#include <Geom_Line.hxx>
#include <Geom_Plane.hxx>
#include <Interface_EntityIterator.hxx>
#include <Interface_InterfaceModel.hxx>
@@ -67,7 +64,6 @@
#include <STEPControl_Reader.hxx>
#include <StepGeom_GeometricRepresentationItem.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepGeom_Curve.hxx>
#include <StepGeom_Direction.hxx>
#include <StepDimTol_AngularityTolerance.hxx>
#include <StepDimTol_CircularRunoutTolerance.hxx>
@@ -207,7 +203,6 @@
#include <StepVisual_PlanarBox.hxx>
#include <StepVisual_PresentationLayerAssignment.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
#include <StepVisual_StyleContextSelect.hxx>
#include <StepVisual_StyledItem.hxx>
#include <StepVisual_ViewVolume.hxx>
@@ -757,6 +752,7 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
// Update assembly compounds
STool->UpdateAssemblies();
return Standard_True;
}
@@ -1854,25 +1850,6 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
Handle(StepVisual_TessellatedGeometricSet) aTessSet = Handle(StepVisual_TessellatedGeometricSet)::DownCast(aTessItem);
if (aTessSet.IsNull())
continue;
gp_Trsf aTransf;
if (aTessSet->IsKind(STANDARD_TYPE(StepVisual_RepositionedTessellatedGeometricSet)))
{
Handle(StepVisual_RepositionedTessellatedGeometricSet) aRTGS =
Handle(StepVisual_RepositionedTessellatedGeometricSet)::DownCast(aTessSet);
Handle(Geom_Axis2Placement) aLocation = StepToGeom::MakeAxis2Placement(aRTGS->Location());
if (!aLocation.IsNull())
{
const gp_Ax3 anAx3Orig = gp::XOY();
const gp_Ax3 anAx3Targ(aLocation->Ax2());
if (anAx3Targ.Location().SquareDistance(anAx3Orig.Location()) >= Precision::SquareConfusion() ||
!anAx3Targ.Direction().IsEqual(anAx3Orig.Direction(), Precision::Angular()) ||
!anAx3Targ.XDirection().IsEqual(anAx3Orig.XDirection(), Precision::Angular()) ||
!anAx3Targ.YDirection().IsEqual(anAx3Orig.YDirection(), Precision::Angular()))
{
aTransf.SetTransformation(anAx3Targ, anAx3Orig);
}
}
}
NCollection_Handle<StepVisual_Array1OfTessellatedItem> aListItems = aTessSet->Items();
Standard_Integer nb = aListItems.IsNull() ? 0 : aListItems->Length();
Handle(StepVisual_TessellatedCurveSet) aTessCurve;
@@ -1918,7 +1895,7 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
}
aB.Add(aComp, aCurW);
}
anAnnotationShape = aComp.Moved(aTransf);
anAnnotationShape = aComp;
}
if (!anAnnotationShape.IsNull())
{
@@ -2046,7 +2023,12 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
{
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
aBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
aPtext = gp_Pnt((aXmin + aXmax) * 0.5, (aYmin + aYmax) * 0.5, (aZmin + aZmax) * 0.5);
if (isHasPlane && !aBox.IsOut(aPlaneAxes.Location())) {
aPtext = aPlaneAxes.Location();
}
else {
aPtext = gp_Pnt((aXmin + aXmax) * 0.5, (aYmin + aYmax) * 0.5, (aZmin + aZmax) * 0.5);
}
}
else {
aPtext = aPlaneAxes.Location();
@@ -2074,46 +2056,6 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
return;
}
//=======================================================================
//function : computePMIReferensePosition
//purpose : compute position of shape contains in the shapeAspect
//=======================================================================
Standard_Boolean computePMIReferensePosition(const Handle(StepRepr_ShapeAspect)& theReference,
const Interface_Graph& theGraph,
gp_Pnt& thePosition)
{
if (theReference.IsNull())
return Standard_False;
Handle(StepAP242_GeometricItemSpecificUsage) aGISU = NULL;
for (Interface_EntityIterator anIt = theGraph.Sharings(theReference); aGISU.IsNull() && anIt.More(); anIt.Next())
{
aGISU = Handle(StepAP242_GeometricItemSpecificUsage)::DownCast(anIt.Value());
}
if (aGISU.IsNull() || aGISU->NbIdentifiedItem() == 0)
return Standard_False;
const Handle(StepRepr_RepresentationItem)& anItem = aGISU->IdentifiedItem()->Value(1);
if (anItem->IsKind(STANDARD_TYPE(StepGeom_CartesianPoint)))
{
Handle(StepGeom_CartesianPoint) aPoint = Handle(StepGeom_CartesianPoint)::DownCast(anItem);
thePosition.SetX(aPoint->CoordinatesValue(1));
thePosition.SetY(aPoint->CoordinatesValue(2));
thePosition.SetZ(aPoint->CoordinatesValue(3));
return Standard_True;
}
else if (anItem->IsKind(STANDARD_TYPE(StepGeom_Axis2Placement3d)))
{
Handle(StepGeom_Axis2Placement3d) anA2P3D = Handle(StepGeom_Axis2Placement3d)::DownCast(anItem);
if (!anA2P3D->Location().IsNull())
{
thePosition.SetX(anA2P3D->Location()->CoordinatesValue(1));
thePosition.SetY(anA2P3D->Location()->CoordinatesValue(2));
thePosition.SetZ(anA2P3D->Location()->CoordinatesValue(3));
return Standard_True;
}
}
return Standard_False;
}
//=======================================================================
//function : readConnectionPoints
//purpose : read connection points for given dimension
@@ -2146,32 +2088,82 @@ void readConnectionPoints(const Handle(XSControl_TransferReader)& theTR,
aFact = UnitsMethods::LengthFactor();
}
if (theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalSize)))
{
if (theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalSize))) {
// retrieve derived geometry
Handle(StepShape_DimensionalSize) aDim = Handle(StepShape_DimensionalSize)::DownCast(theGDT);
gp_Pnt aPnt;
if (computePMIReferensePosition(aDim->AppliesTo(), aGraph, aPnt))
{
// set connection point to object
aPnt.SetXYZ(aPnt.XYZ() * aFact);
theDimObject->SetPoint(aPnt);
Handle(StepRepr_DerivedShapeAspect) aDSA = Handle(StepRepr_DerivedShapeAspect)::DownCast(aDim->AppliesTo());
if (aDSA.IsNull())
return;
Handle(StepAP242_GeometricItemSpecificUsage) aGISU = NULL;
for (Interface_EntityIterator anIt = aGraph.Sharings(aDSA); aGISU.IsNull() && anIt.More(); anIt.Next()) {
aGISU = Handle(StepAP242_GeometricItemSpecificUsage)::DownCast(anIt.Value());
}
if (aGISU.IsNull() || aGISU->NbIdentifiedItem() == 0)
return;
Handle(StepGeom_CartesianPoint) aPoint = Handle(StepGeom_CartesianPoint)::DownCast(aGISU->IdentifiedItem()->Value(1));
if (aPoint.IsNull()) {
// try Axis2Placement3d.location instead of CartesianPoint
Handle(StepGeom_Axis2Placement3d) anA2P3D =
Handle(StepGeom_Axis2Placement3d)::DownCast(aGISU->IdentifiedItem()->Value(1));
if (anA2P3D.IsNull())
return;
aPoint = anA2P3D->Location();
}
// set connection point to object
gp_Pnt aPnt(aPoint->CoordinatesValue(1) * aFact, aPoint->CoordinatesValue(2) * aFact, aPoint->CoordinatesValue(3) * aFact);
theDimObject->SetPoint(aPnt);
}
else if (theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalLocation)))
{
else if (theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalLocation))) {
// retrieve derived geometry
Handle(StepShape_DimensionalLocation) aDim = Handle(StepShape_DimensionalLocation)::DownCast(theGDT);
gp_Pnt aPnt;
if (computePMIReferensePosition(aDim->RelatingShapeAspect(), aGraph, aPnt))
{
// set connection point to object
aPnt.SetXYZ(aPnt.XYZ() * aFact);
theDimObject->SetPoint(aPnt);
Handle(StepRepr_DerivedShapeAspect) aDSA1 = Handle(StepRepr_DerivedShapeAspect)::DownCast(aDim->RelatingShapeAspect());
Handle(StepRepr_DerivedShapeAspect) aDSA2 = Handle(StepRepr_DerivedShapeAspect)::DownCast(aDim->RelatedShapeAspect());
if (aDSA1.IsNull() && aDSA2.IsNull())
return;
Handle(StepAP242_GeometricItemSpecificUsage) aGISU1 = NULL;
Handle(StepAP242_GeometricItemSpecificUsage) aGISU2 = NULL;
if (!aDSA1.IsNull()) {
for (Interface_EntityIterator anIt = aGraph.Sharings(aDSA1); aGISU1.IsNull() && anIt.More(); anIt.Next()) {
aGISU1 = Handle(StepAP242_GeometricItemSpecificUsage)::DownCast(anIt.Value());
}
}
if (computePMIReferensePosition(aDim->RelatedShapeAspect(), aGraph, aPnt))
{
// set connection point to object
aPnt.SetXYZ(aPnt.XYZ() * aFact);
theDimObject->SetPoint2(aPnt);
if (!aDSA2.IsNull()) {
for (Interface_EntityIterator anIt = aGraph.Sharings(aDSA2); aGISU2.IsNull() && anIt.More(); anIt.Next()) {
aGISU2 = Handle(StepAP242_GeometricItemSpecificUsage)::DownCast(anIt.Value());
}
}
// first point
if (!aGISU1.IsNull() && aGISU1->NbIdentifiedItem() > 0) {
Handle(StepGeom_CartesianPoint) aPoint = Handle(StepGeom_CartesianPoint)::DownCast(aGISU1->IdentifiedItem()->Value(1));
if (aPoint.IsNull()) {
// try Axis2Placement3d.location instead of CartesianPoint
Handle(StepGeom_Axis2Placement3d) anA2P3D =
Handle(StepGeom_Axis2Placement3d)::DownCast(aGISU1->IdentifiedItem()->Value(1));
if (!anA2P3D.IsNull())
aPoint = anA2P3D->Location();
}
if (!aPoint.IsNull()) {
// set connection point to object
gp_Pnt aPnt(aPoint->CoordinatesValue(1) * aFact, aPoint->CoordinatesValue(2) * aFact, aPoint->CoordinatesValue(3) * aFact);
theDimObject->SetPoint(aPnt);
}
}
// second point
if (!aGISU2.IsNull() && aGISU2->NbIdentifiedItem() > 0) {
Handle(StepGeom_CartesianPoint) aPoint = Handle(StepGeom_CartesianPoint)::DownCast(aGISU2->IdentifiedItem()->Value(1));
if (aPoint.IsNull()) {
// try Axis2Placement3d.location instead of CartesianPoint
Handle(StepGeom_Axis2Placement3d) anA2P3D =
Handle(StepGeom_Axis2Placement3d)::DownCast(aGISU2->IdentifiedItem()->Value(1));
if (!anA2P3D.IsNull())
aPoint = anA2P3D->Location();
}
if (!aPoint.IsNull()) {
// set connection point to object
gp_Pnt aPnt(aPoint->CoordinatesValue(1) * aFact, aPoint->CoordinatesValue(2) * aFact, aPoint->CoordinatesValue(3) * aFact);
theDimObject->SetPoint2(aPnt);
}
}
}
}
@@ -2785,9 +2777,8 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Tra
NCollection_Sequence<Handle(Standard_Transient)> aSeqRI1, aSeqRI2;
// Collect all Shape_Aspect entities
for (Interface_EntityIterator anIter = aGraph.Shareds(theEnt);
anIter.More(); anIter.Next())
{
Interface_EntityIterator anIter = aGraph.Shareds(theEnt);
for (anIter.Start(); anIter.More(); anIter.Next()) {
Handle(Standard_Transient) anAtr = anIter.Value();
NCollection_Sequence<Handle(StepRepr_ShapeAspect)> aSAs;
if (anAtr->IsKind(STANDARD_TYPE(StepRepr_ProductDefinitionShape)))
@@ -3076,15 +3067,65 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Tra
TDF_LabelSequence aShLS1, aShLS2;
// Collect shapes
for (NCollection_Sequence<Handle(Standard_Transient)>::Iterator anIter(aSeqRI1);
anIter.More(); anIter.Next())
for (Standard_Integer i = aSeqRI1.Lower(); i <= aSeqRI1.Upper();i++)
{
findReferenceGeometry(anIter.Value(), aSTool, aShLS1);
Standard_Integer anIndex = FindShapeIndexForDGT(aSeqRI1.Value(i), theWS);
TopoDS_Shape aSh;
if (anIndex > 0) {
Handle(Transfer_Binder) aBinder = aTP->MapItem(anIndex);
aSh = TransferBRep::ShapeResult(aBinder);
}
if (!aSh.IsNull())
{
TDF_Label aShL;
aSTool->Search(aSh, aShL, Standard_True, Standard_True, Standard_True);
if (aShL.IsNull() && aSh.ShapeType() == TopAbs_WIRE)
{
TopExp_Explorer ex(aSh, TopAbs_EDGE, TopAbs_SHAPE);
while (ex.More())
{
TDF_Label edgeL;
aSTool->Search(ex.Current(), edgeL, Standard_True, Standard_True, Standard_True);
if (!edgeL.IsNull())
aShLS1.Append(edgeL);
ex.Next();
}
}
if (!aShL.IsNull())
aShLS1.Append(aShL);
}
}
for (NCollection_Sequence<Handle(Standard_Transient)>::Iterator anIter(aSeqRI2);
anIter.More(); anIter.Next())
if (!aSeqRI2.IsEmpty())
{
findReferenceGeometry(anIter.Value(), aSTool, aShLS2);
//for dimensional location
for (Standard_Integer i = aSeqRI2.Lower(); i <= aSeqRI2.Upper();i++)
{
Standard_Integer anIndex = FindShapeIndexForDGT(aSeqRI2.Value(i), theWS);
TopoDS_Shape aSh;
if (anIndex > 0) {
Handle(Transfer_Binder) aBinder = aTP->MapItem(anIndex);
aSh = TransferBRep::ShapeResult(aBinder);
}
if (!aSh.IsNull())
{
TDF_Label aShL;
aSTool->Search(aSh, aShL, Standard_True, Standard_True, Standard_True);
if (aShL.IsNull() && aSh.ShapeType() == TopAbs_WIRE)
{
TopExp_Explorer ex(aSh, TopAbs_EDGE, TopAbs_SHAPE);
while (ex.More())
{
TDF_Label edgeL;
aSTool->Search(ex.Current(), edgeL, Standard_True, Standard_True, Standard_True);
if (!edgeL.IsNull())
aShLS2.Append(edgeL);
ex.Next();
}
}
if (!aShL.IsNull())
aShLS2.Append(aShL);
}
}
}
if (!aShLS1.IsEmpty())
@@ -3145,182 +3186,6 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Tra
return aGDTL;
}
//=======================================================================
//function : findReferenceGeometry
//purpose :
//=======================================================================
Standard_Boolean STEPCAFControl_Reader::findReferenceGeometry(const Handle(Standard_Transient)& theShapeStart,
const Handle(XCAFDoc_ShapeTool)& theShTool,
TDF_LabelSequence& theShLabelSeq)
{
const Handle(XSControl_TransferReader)& aTR = myReader.WS()->TransferReader();
const Handle(Transfer_TransientProcess)& aTP = aTR->TransientProcess();
TopoDS_Shape aSh = TransferBRep::ShapeResult(aTP, theShapeStart);
if (!aSh.IsNull())
{
TDF_Label aShL;
theShTool->Search(aSh, aShL, Standard_True, Standard_True, Standard_True);
if (aShL.IsNull() && aSh.ShapeType() == TopAbs_WIRE)
{
for (TopExp_Explorer anExp(aSh, TopAbs_EDGE, TopAbs_SHAPE);
anExp.More(); anExp.Next())
{
TDF_Label anEdgeL;
theShTool->Search(anExp.Current(), anEdgeL, Standard_True, Standard_True, Standard_True);
if (!anEdgeL.IsNull())
{
theShLabelSeq.Append(anEdgeL);
}
}
}
if (!aShL.IsNull())
{
theShLabelSeq.Append(aShL);
return Standard_True;
}
}
TDF_Label aFindResultL;
if (myGDTMap.Find(theShapeStart, aFindResultL))
{
theShLabelSeq.Append(aFindResultL);
return Standard_True;
}
const Handle(StepGeom_GeometricRepresentationItem)& aGeomItem =
Handle(StepGeom_GeometricRepresentationItem)::DownCast(theShapeStart);
if (aGeomItem.IsNull())
{
return Standard_False;
}
if (theShapeStart->IsKind(STANDARD_TYPE(StepGeom_Curve)))
{
const Handle(StepGeom_Curve)& aStepCurve = Handle(StepGeom_Curve)::DownCast(theShapeStart);
Handle(Geom_Curve) aCurve = StepToGeom::MakeCurve(aStepCurve);
if (aCurve.IsNull())
{
return Standard_False;
}
BRepBuilderAPI_MakeEdge aMaker;
if (aCurve->IsKind(STANDARD_TYPE(Geom_Line)))
{
const Standard_Real aScale = UnitsMethods::LengthFactor();
aMaker.Init(aCurve, 0, 1. * aScale);
}
else
{
aMaker.Init(aCurve);
}
if (aMaker.IsDone())
{
aSh = aMaker.Shape();
}
}
else if (theShapeStart->IsKind(STANDARD_TYPE(StepGeom_Surface)))
{
const Handle(StepGeom_Surface)& aStepSurface = Handle(StepGeom_Surface)::DownCast(theShapeStart);
Handle(Geom_Surface) aSurface = StepToGeom::MakeSurface(aStepSurface);
if (aSurface.IsNull())
{
return Standard_False;
}
BRepBuilderAPI_MakeFace aMaker;
if (aSurface->IsKind(STANDARD_TYPE(Geom_Plane)))
{
const Standard_Real aScale = UnitsMethods::LengthFactor();
aMaker.Init(aSurface, 0., 1. * aScale, 0., 1. * aScale, Precision::Confusion());
}
else
{
aMaker.Init(aSurface, Standard_True, Precision::Confusion());
}
if (aMaker.IsDone())
{
aSh = aMaker.Shape();
}
}
if (aSh.IsNull())
{
return Standard_False;
}
if (mySupplementalLabel.IsNull())
{
mySupplementalLabel = theShTool->NewShape();
TDataStd_Name::Set(mySupplementalLabel, "Supplemental Geometry");
TDataStd_UAttribute::Set(mySupplementalLabel, XCAFDoc::SupplementalContainerGUID());
}
TDF_Label aSupGeomLabel = theShTool->AddComponent(mySupplementalLabel, aSh);
if (aSupGeomLabel.IsNull())
{
return Standard_False;
}
TDataStd_UAttribute::Set(aSupGeomLabel, XCAFDoc::SupplementalGeometryGUID());
if (!aGeomItem->Name().IsNull())
{
TDataStd_Name::Set(aSupGeomLabel, aGeomItem->Name()->String());
TDF_Label aReferredShapeL;
theShTool->GetReferredShape(aSupGeomLabel, aReferredShapeL);
TDataStd_Name::Set(aReferredShapeL, aGeomItem->Name()->String());
TDataStd_UAttribute::Set(aReferredShapeL, XCAFDoc::SupplementalGeometryGUID());
}
TDF_Label aRefL;
const Interface_Graph& aGraph = aTP->Graph();
for (Interface_EntityIterator anIter(aGraph.Sharings(theShapeStart));
anIter.More() && aRefL.IsNull(); anIter.Next())
{
Handle(StepAP242_GeometricItemSpecificUsage) aPGISU =
Handle(StepAP242_GeometricItemSpecificUsage)::DownCast(anIter.Value());
if (aPGISU.IsNull())
{
continue;
}
Handle(StepRepr_ShapeAspect) aShAspect = aPGISU->Definition().ShapeAspect();
if (aShAspect.IsNull())
{
continue;
}
Handle(StepRepr_ProductDefinitionShape) aRefPDS = aShAspect->OfShape();
if (aRefPDS.IsNull())
{
continue;
}
TopoDS_Shape aRefSh = TransferBRep::ShapeResult(aTP, aRefPDS->Definition().Value());
theShTool->Search(aRefSh, aRefL, Standard_True, Standard_True, Standard_False);
}
if (aRefL.IsNull())
{
TDF_LabelSequence aFreeShapes;
theShTool->GetFreeShapes(aFreeShapes);
for(TDF_LabelSequence::Iterator anIter(aFreeShapes); anIter.More() && aRefL.IsNull(); anIter.Next())
{
const TDF_Label aLabel = anIter.Value();
Handle(TDataStd_UAttribute) aSupGeomAttr;
if (aLabel.FindAttribute(XCAFDoc::SupplementalContainerGUID(), aSupGeomAttr))
{
continue;
}
TopoDS_Shape aTmpShape = theShTool->GetShape(aLabel);
if (!aTmpShape.IsNull())
{
aRefL = aLabel;
}
}
}
if (aRefL.IsNull())
{
return Standard_False;
}
// set reference
Handle(TDataStd_TreeNode) aMainNode = TDataStd_TreeNode::Set(aRefL, XCAFDoc::SupplementalRefGUID());
Handle(TDataStd_TreeNode) aRefNode = TDataStd_TreeNode::Set(aSupGeomLabel, XCAFDoc::SupplementalRefGUID());
aRefNode->Remove(); // abv: fix against bug in TreeNode::Append()
aMainNode->Append(aRefNode);
myGDTMap.Bind(theShapeStart, aSupGeomLabel);
theShLabelSeq.Append(aSupGeomLabel);
return Standard_True;
}
//=======================================================================
//function : convertAngleValue
//purpose : auxilary
@@ -4646,16 +4511,9 @@ void collectRepresentationItems(const Interface_Graph& theGraph,
const Handle(StepShape_ShapeRepresentation)& theRepresentation,
NCollection_Sequence<Handle(StepRepr_RepresentationItem)>& theItems)
{
for (StepRepr_HArray1OfRepresentationItem::Iterator anIter(theRepresentation->Items()->Array1());
anIter.More(); anIter.Next())
{
const Handle(StepRepr_RepresentationItem)& anReprItem = anIter.Value();
if (anReprItem.IsNull())
{
continue;
}
theItems.Append(anReprItem);
}
Handle(StepRepr_HArray1OfRepresentationItem) aReprItems = theRepresentation->Items();
for (Standard_Integer itemIt = aReprItems->Lower(); itemIt <= aReprItems->Upper(); itemIt++)
theItems.Append(aReprItems->Value(itemIt));
Interface_EntityIterator entIt = theGraph.TypedSharings(theRepresentation, STANDARD_TYPE(StepRepr_RepresentationRelationship));
for (entIt.Start(); entIt.More(); entIt.Next())

View File

@@ -291,18 +291,9 @@ private:
const Handle(TDocStd_Document)& theDoc,
const Handle(XSControl_WorkSession)& theWS);
//! Finds reference geometry or create supplemental geometry label
//! @param[in] theShapeStart step entity to get reference
//! @param[in] theShTool tool to work with shape labels
//! @param[out] theShLabelSeq container to put reference label
//! @return TRUE if a reference is found or supplemental geometry is added
Standard_Boolean findReferenceGeometry(const Handle(Standard_Transient)& theShapeStart,
const Handle(XCAFDoc_ShapeTool)& theShTool,
TDF_LabelSequence& theShLabelSeq);
STEPControl_Reader myReader;
NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)> myFiles;
TDF_Label mySupplementalLabel;
Standard_Boolean myColorMode;
Standard_Boolean myNameMode;
Standard_Boolean myLayerMode;

View File

@@ -23,8 +23,6 @@
#include <STEPCAFControl_Writer.hxx>
#include <BRep_Builder.hxx>
#include <GeomToStep_MakeSurface.hxx>
#include <GeomToStep_MakeCurve.hxx>
#include <GeomToStep_MakeAxis2Placement3d.hxx>
#include <GeomToStep_MakeCartesianPoint.hxx>
#include <HeaderSection_FileSchema.hxx>
@@ -117,7 +115,6 @@
#include <StepRepr_CompositeShapeAspect.hxx>
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
#include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
#include <StepGeom_Curve.hxx>
#include <StepRepr_DerivedShapeAspect.hxx>
#include <StepRepr_DescriptiveRepresentationItem.hxx>
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
@@ -201,7 +198,6 @@
#include <TDF_LabelSequence.hxx>
#include <TDF_Tool.hxx>
#include <TDocStd_Document.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
@@ -530,12 +526,6 @@ Standard_Boolean STEPCAFControl_Writer::Transfer (STEPControl_Writer &writer,
TDF_Label L = labels.Value(i);
if ( myLabels.IsBound ( L ) ) continue; // already processed
Handle(TDataStd_UAttribute) aSupGeomAttr;
if (L.FindAttribute(XCAFDoc::SupplementalContainerGUID(), aSupGeomAttr))
{
continue;
}
TopoDS_Shape shape = XCAFDoc_ShapeTool::GetShape ( L );
if ( shape.IsNull() ) continue;
@@ -2429,110 +2419,6 @@ Handle(StepRepr_ShapeAspect) STEPCAFControl_Writer::WriteShapeAspect (const Hand
return aSA;
}
//=======================================================================
//function : WriteSupplementalGeometry
//purpose :
//=======================================================================
Handle(StepRepr_ShapeAspect) WriteSupplementalGeometry(const Handle(XSControl_WorkSession)& WS,
const Handle(StepRepr_ConstructiveGeometryRepresentation)& theCGRepr,
const TDF_Label& theLabel,
const TopoDS_Shape& theShape,
Handle(StepRepr_RepresentationContext)& theRC,
Handle(StepAP242_GeometricItemSpecificUsage)& theGISU,
NCollection_Vector<Handle(StepGeom_GeometricRepresentationItem)>& theGeomItems)
{
Handle(StepRepr_ShapeAspect) aResSA;
// Get working data
const Handle(Interface_InterfaceModel)& aModel = WS->Model();
const Handle(XSControl_TransferWriter)& aTW = WS->TransferWriter();
const Handle(Transfer_FinderProcess)& aFP = aTW->FinderProcess();
const Handle(Interface_HGraph) aHGraph = WS->HGraph();
if (aHGraph.IsNull())
{
return aResSA;
}
Interface_Graph aGraph = aHGraph->Graph();
// Shape_Aspect
Handle(TCollection_HAsciiString) aName = new TCollection_HAsciiString();
Handle(TDataStd_Name) aNameAttr;
if (theLabel.FindAttribute(TDataStd_Name::GetID(), aNameAttr))
{
aName = new TCollection_HAsciiString(TCollection_AsciiString(aNameAttr->Get()));
}
Handle(TCollection_HAsciiString) aDescription = new TCollection_HAsciiString();
Handle(TDataStd_TreeNode) aRefNode;
if (!theLabel.FindAttribute(XCAFDoc::SupplementalRefGUID(), aRefNode)
|| aRefNode->Father().IsNull() || aRefNode->Father()->Label().IsNull())
{
return aResSA;
}
TopoDS_Shape aMainShape = XCAFDoc_ShapeTool::GetShape(aRefNode->Father()->Label());
TopLoc_Location aLoc;
TColStd_SequenceOfTransient aSeqRI;
FindEntities(aFP, aMainShape, aLoc, aSeqRI);
if (aSeqRI.Length() <= 0)
{
aFP->Messenger()->SendInfo() << "Warning: Cannot find RI for " << aMainShape.TShape()->DynamicType()->Name() << std::endl;
return aResSA;
}
Handle(StepRepr_ProductDefinitionShape) aPDS;
Handle(StepRepr_RepresentationContext) aRC;
Handle(Standard_Transient) anEnt = aSeqRI.Value(1);
aPDS = FindPDS(aGraph, anEnt, aRC);
if (aPDS.IsNull())
return aResSA;
theRC = aRC;
Handle(StepGeom_GeometricRepresentationItem) anIdentifiedItem;
if (theShape.ShapeType() == TopAbs_FACE)
{
const TopoDS_Face& aFace = TopoDS::Face(theShape);
const Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace);
GeomToStep_MakeSurface aMaker(aSurf);
if (aMaker.IsDone())
{
anIdentifiedItem = aMaker.Value();
}
}
else if (theShape.ShapeType() == TopAbs_EDGE)
{
const TopoDS_Edge& anEdge = TopoDS::Edge(theShape);
Standard_Real aTmpFirst, aTmpLast;
const Handle(Geom_Curve) aCurv = BRep_Tool::Curve(anEdge, aTmpFirst, aTmpLast);
GeomToStep_MakeCurve aMaker(aCurv);
if (aMaker.IsDone())
{
anIdentifiedItem = aMaker.Value();
}
}
if (anIdentifiedItem.IsNull())
{
return aResSA;
}
aResSA = new StepRepr_ShapeAspect();
aResSA->Init(aName, aDescription, aPDS, StepData_LTrue);
// Geometric_Item_Specific_Usage
Handle(StepAP242_GeometricItemSpecificUsage) aGISU = new StepAP242_GeometricItemSpecificUsage();
StepAP242_ItemIdentifiedRepresentationUsageDefinition aDefinition;
aDefinition.SetValue(aResSA);
Handle(StepRepr_HArray1OfRepresentationItem) anReprItems = new StepRepr_HArray1OfRepresentationItem(1, 1);
anIdentifiedItem->SetName(aName);
theGISU = aGISU;
anReprItems->SetValue(1, anIdentifiedItem);
theGeomItems.Append(anIdentifiedItem);
// Set entities to model
aGISU->Init(aName, aDescription, aDefinition, theCGRepr, anReprItems);
aModel->AddWithRefs(aResSA);
aModel->AddWithRefs(aGISU);
return aResSA;
}
//=======================================================================
//function : WritePresentation
//purpose : auxiliary (write annotation plane and presentation)
@@ -3072,14 +2958,14 @@ static void WriteDerivedGeometry (const Handle(XSControl_WorkSession) &WS,
const Handle(StepRepr_ConstructiveGeometryRepresentation) theRepr,
Handle(StepRepr_ShapeAspect)& theFirstSA,
Handle(StepRepr_ShapeAspect)& theSecondSA,
NCollection_Vector<Handle(StepGeom_GeometricRepresentationItem)>& theGeoms)
NCollection_Vector<Handle(StepGeom_CartesianPoint)>& thePnts)
{
const Handle(Interface_InterfaceModel) &aModel = WS->Model();
// First point
if (theObject->HasPoint()) {
GeomToStep_MakeCartesianPoint aPointMaker(theObject->GetPoint());
Handle(StepGeom_CartesianPoint) aPoint = aPointMaker.Value();
theGeoms.Append(aPoint);
thePnts.Append(aPoint);
Handle(StepRepr_DerivedShapeAspect) aDSA = new StepRepr_DerivedShapeAspect();
aDSA->Init(new TCollection_HAsciiString(), new TCollection_HAsciiString(), theFirstSA->OfShape(), StepData_LFalse);
Handle(StepAP242_GeometricItemSpecificUsage) aGISU = new StepAP242_GeometricItemSpecificUsage();
@@ -3099,7 +2985,7 @@ static void WriteDerivedGeometry (const Handle(XSControl_WorkSession) &WS,
if (theObject->HasPoint2()) {
GeomToStep_MakeCartesianPoint aPointMaker(theObject->GetPoint2());
Handle(StepGeom_CartesianPoint) aPoint = aPointMaker.Value();
theGeoms.Append(aPoint);
thePnts.Append(aPoint);
Handle(StepRepr_DerivedShapeAspect) aDSA = new StepRepr_DerivedShapeAspect();
aDSA->Init(new TCollection_HAsciiString(), new TCollection_HAsciiString(), theFirstSA->OfShape(), StepData_LFalse);
Handle(StepAP242_GeometricItemSpecificUsage) aGISU = new StepAP242_GeometricItemSpecificUsage();
@@ -3370,46 +3256,20 @@ void STEPCAFControl_Writer::WriteGeomTolerance (const Handle(XSControl_WorkSessi
aLMWU->Init(aValueMember, aUnit);
Model->AddWithRefs(aLMWU);
// Auxiliary entities for derived geometry
Handle(StepRepr_ConstructiveGeometryRepresentation) aCGRepr =
new StepRepr_ConstructiveGeometryRepresentation();
Handle(StepRepr_ConstructiveGeometryRepresentationRelationship) aCGReprRel =
new StepRepr_ConstructiveGeometryRepresentationRelationship();
NCollection_Vector<Handle(StepGeom_GeometricRepresentationItem)> aConnectionGeometry;
// Geometric_Tolerance target
Handle(StepRepr_ShapeAspect) aMainSA;
Handle(StepRepr_RepresentationContext) dummyRC;
Handle(StepAP242_GeometricItemSpecificUsage) dummyGISU;
if (theShapeSeqL.Length() == 1) {
const TDF_Label& aShLabel = theShapeSeqL.Value(1);
Handle(TDataStd_UAttribute) aSupAttr;
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aShLabel);
if (aShLabel.FindAttribute(XCAFDoc::SupplementalGeometryGUID(), aSupAttr))
{
aMainSA = WriteSupplementalGeometry(WS, aCGRepr, aShLabel, aShape, dummyRC, dummyGISU, aConnectionGeometry);
}
else
{
aMainSA = WriteShapeAspect(WS, theGeomTolL, aShape, dummyRC, dummyGISU);
}
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(theShapeSeqL.Value(1));
aMainSA = WriteShapeAspect(WS, theGeomTolL, aShape, dummyRC, dummyGISU);
Model->AddWithRefs(aMainSA);
}
else {
Handle(StepRepr_CompositeShapeAspect) aCSA;
for (Standard_Integer i = 1; i <= theShapeSeqL.Length(); i++) {
const TDF_Label& aShLabel = theShapeSeqL.Value(i);
Handle(TDataStd_UAttribute) aSupAttr;
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aShLabel);
Handle(StepRepr_ShapeAspect) aSA;
if (aShLabel.FindAttribute(XCAFDoc::SupplementalGeometryGUID(), aSupAttr))
{
aSA = WriteSupplementalGeometry(WS, aCGRepr, aShLabel, aShape, dummyRC, dummyGISU, aConnectionGeometry);
}
else
{
aSA = WriteShapeAspect(WS, theGeomTolL, aShape, dummyRC, dummyGISU);
}
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(theShapeSeqL.Value(i));
Handle(StepRepr_ShapeAspect) aSA = WriteShapeAspect(WS, theGeomTolL, aShape, dummyRC, dummyGISU);
if (aSA.IsNull())
continue;
if (aCSA.IsNull()) {
@@ -3423,17 +3283,6 @@ void STEPCAFControl_Writer::WriteGeomTolerance (const Handle(XSControl_WorkSessi
}
aMainSA = aCSA;
}
// Write Derived geometry
if (aConnectionGeometry.Length() > 0)
{
Handle(StepRepr_HArray1OfRepresentationItem) anItems = new StepRepr_HArray1OfRepresentationItem(1, aConnectionGeometry.Length());
for (Standard_Integer i = 0; i < aConnectionGeometry.Length(); i++)
anItems->SetValue(i + 1, aConnectionGeometry(i));
aCGRepr->Init(new TCollection_HAsciiString(), anItems, dummyRC);
aCGReprRel->Init(new TCollection_HAsciiString(), new TCollection_HAsciiString(), dummyGISU->UsedRepresentation(), aCGRepr);
Model->AddWithRefs(aCGReprRel);
}
StepDimTol_GeometricToleranceTarget aGTTarget;
aGTTarget.SetValue(aMainSA);
@@ -3964,7 +3813,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
new StepRepr_ConstructiveGeometryRepresentation();
Handle(StepRepr_ConstructiveGeometryRepresentationRelationship) aCGReprRel =
new StepRepr_ConstructiveGeometryRepresentationRelationship();
NCollection_Vector<Handle(StepGeom_GeometricRepresentationItem)> aConnectionGeometry;
NCollection_Vector<Handle(StepGeom_CartesianPoint)> aConnectionPnts;
Handle(StepRepr_RepresentationContext) dummyRC;
Handle(StepAP242_GeometricItemSpecificUsage) dummyGISU;
for (Standard_Integer i = 1; i <= aDGTLabels.Length(); i++) {
@@ -3991,36 +3840,16 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
// Write links with shapes
Handle(StepRepr_ShapeAspect) aFirstSA, aSecondSA;
if (aFirstShapeL.Length() == 1) {
const TDF_Label& aShLabel = aFirstShapeL.Value(1);
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aShLabel);
Handle(TDataStd_UAttribute) aSupAttr;
if (aShLabel.FindAttribute(XCAFDoc::SupplementalGeometryGUID(), aSupAttr))
{
aFirstSA = WriteSupplementalGeometry(WS,aCGRepr, aShLabel, aShape, dummyRC, dummyGISU,aConnectionGeometry);
}
else
{
aFirstSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
}
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aFirstShapeL.Value(1));
aFirstSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
if (aRC.IsNull() && !dummyRC.IsNull())
aRC = dummyRC;
}
else if (aFirstShapeL.Length() > 1) {
Handle(StepRepr_CompositeShapeAspect) aCSA;
for (Standard_Integer shIt = 1; shIt <= aFirstShapeL.Length(); shIt++)
{
const TDF_Label& aShLabel = aFirstShapeL.Value(shIt);
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aShLabel);
Handle(TDataStd_UAttribute) aSupAttr;
Handle(StepRepr_ShapeAspect) aSA;
if (aShLabel.FindAttribute(XCAFDoc::SupplementalGeometryGUID(), aSupAttr))
{
aSA = WriteSupplementalGeometry(WS, aCGRepr, aShLabel, aShape, dummyRC, dummyGISU, aConnectionGeometry);
}
else
{
aSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
}
for (Standard_Integer shIt = 1; shIt <= aFirstShapeL.Length(); shIt++) {
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aFirstShapeL.Value(shIt));
Handle(StepRepr_ShapeAspect) aSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
if (aSA.IsNull())
continue;
if (aCSA.IsNull()) {
@@ -4037,35 +3866,16 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
aFirstSA = aCSA;
}
if (aSecondShapeL.Length() == 1) {
const TDF_Label& aShLabel = aSecondShapeL.Value(1);
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aShLabel);
Handle(TDataStd_UAttribute) aSupAttr;
if (aShLabel.FindAttribute(XCAFDoc::SupplementalGeometryGUID(), aSupAttr))
{
aSecondSA = WriteSupplementalGeometry(WS, aCGRepr, aShLabel, aShape, dummyRC, dummyGISU, aConnectionGeometry);
}
else
{
aSecondSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
}
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aSecondShapeL.Value(1));
aSecondSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
if (aRC.IsNull() && !dummyRC.IsNull())
aRC = dummyRC;
}
else if (aSecondShapeL.Length() > 1) {
Handle(StepRepr_CompositeShapeAspect) aCSA;
for (Standard_Integer shIt = 1; shIt <= aSecondShapeL.Length(); shIt++) {
const TDF_Label& aShLabel = aSecondShapeL.Value(shIt);
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aShLabel);
Handle(TDataStd_UAttribute) aSupAttr;
Handle(StepRepr_ShapeAspect) aSA;
if (aShLabel.FindAttribute(XCAFDoc::SupplementalGeometryGUID(), aSupAttr))
{
aSA = WriteSupplementalGeometry(WS, aCGRepr, aShLabel, aShape, dummyRC, dummyGISU, aConnectionGeometry);
}
else
{
aSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
}
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(aSecondShapeL.Value(shIt));
Handle(StepRepr_ShapeAspect) aSA = WriteShapeAspect(WS, aDimensionL, aShape, dummyRC, dummyGISU);
if (aCSA.IsNull() && !aSA.IsNull())
{
aCSA = new StepRepr_CompositeShapeAspect();
@@ -4092,7 +3902,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
// Write dimensions
StepShape_DimensionalCharacteristic aDimension;
if (anObject->HasPoint() || anObject->HasPoint2())
WriteDerivedGeometry(WS, anObject, aCGRepr, aFirstSA, aSecondSA, aConnectionGeometry);
WriteDerivedGeometry(WS, anObject, aCGRepr, aFirstSA, aSecondSA, aConnectionPnts);
XCAFDimTolObjects_DimensionType aDimType = anObject->GetType();
if (STEPCAFControl_GDTProperty::IsDimensionalLocation(aDimType)) {
// Dimensional_Location
@@ -4162,10 +3972,10 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
anObject->GetPlane(), anObject->GetPointTextAttach(), aDimension.Value());
}
// Write Derived geometry
if (aConnectionGeometry.Length() > 0) {
Handle(StepRepr_HArray1OfRepresentationItem) anItems = new StepRepr_HArray1OfRepresentationItem(1, aConnectionGeometry.Length());
for (Standard_Integer i = 0; i < aConnectionGeometry.Length(); i++)
anItems->SetValue(i + 1, aConnectionGeometry(i));
if (aConnectionPnts.Length() > 0) {
Handle(StepRepr_HArray1OfRepresentationItem) anItems = new StepRepr_HArray1OfRepresentationItem(1, aConnectionPnts.Length());
for (Standard_Integer i = 0; i < aConnectionPnts.Length(); i++)
anItems->SetValue(i + 1, aConnectionPnts(i));
aCGRepr->Init(new TCollection_HAsciiString(), anItems, dummyRC);
aCGReprRel->Init(new TCollection_HAsciiString(), new TCollection_HAsciiString(), dummyGISU->UsedRepresentation(), aCGRepr);
aModel->AddWithRefs(aCGReprRel);

View File

@@ -17,7 +17,6 @@
//gka,abv 14.04.99 S4136: maintain unit context, precision and maxtolerance values
#include <BRep_Builder.hxx>
#include <BRepBuilderAPI_Copy.hxx>
#include <BRepCheck_Shell.hxx>
#include <BRepCheck_Status.hxx>
#include <Geom_Axis2Placement.hxx>
@@ -33,7 +32,6 @@
#include <Message_ProgressScope.hxx>
#include <OSD_Timer.hxx>
#include <Precision.hxx>
#include <ShapeProcess_ShapeContext.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <Standard_Transient.hxx>
@@ -306,10 +304,7 @@ Handle(Transfer_Binder) STEPControl_ActorRead::Transfer
}
// [END] Get version of preprocessor (to detect I-Deas case) (ssv; 23.11.2010)
Standard_Boolean aTrsfUse = (Interface_Static::IVal("read.step.root.transformation") == 0);
auto aResult = TransferShape(start, TP, Standard_True, aTrsfUse, theProgress);
if (Interface_Static::IVal("read.step.parallel.healing") == 0)
PostHealing(TP);
return aResult;
return TransferShape(start, TP, Standard_True, aTrsfUse, theProgress);
}
@@ -1444,18 +1439,13 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
mappedShape = myShapeBuilder.Value();
// Apply ShapeFix (on manifold shapes only. Non-manifold topology is processed separately: ssv; 13.11.2010)
if (isManifold) {
if (Interface_Static::IVal("read.step.parallel.healing") != 0)
{
Handle(Standard_Transient) info;
mappedShape =
XSAlgo::AlgoContainer()->ProcessShape(mappedShape, myPrecision, myMaxTol,
"read.step.resource.name",
"read.step.sequence", info,
aPS.Next());
XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
}
else
myShapesToHeal.Add(mappedShape);
Handle(Standard_Transient) info;
mappedShape =
XSAlgo::AlgoContainer()->ProcessShape( mappedShape, myPrecision, myMaxTol,
"read.step.resource.name",
"read.step.sequence", info,
aPS.Next());
XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
}
}
found = !mappedShape.IsNull();
@@ -2006,68 +1996,3 @@ void STEPControl_ActorRead::computeIDEASClosings(const TopoDS_Compound& comp,
shellClosingsMap.Add(shellA, closingShells);
}
}
//=======================================================================
// Method : PostHealing
// Purpose : postprocess shape healing
//=======================================================================
Standard_EXPORT void STEPControl_ActorRead::PostHealing(const Handle(Transfer_TransientProcess)& TP)
{
NCollection_Array1<Handle(ShapeProcess_ShapeContext)> aInfos(1, myShapesToHeal.Size());
NCollection_Array1<TopTools_DataMapOfShapeShape> aOrigToCopyMapArr(1, myShapesToHeal.Size());
NCollection_Array1<TopTools_DataMapOfShapeShape> aCopyToOrigMapArr(1, myShapesToHeal.Size());
#pragma omp parallel for
for (int i = 1; i <= myShapesToHeal.Size(); i++)
{
TopoDS_Shape anOrig = myShapesToHeal.FindKey(i);
BRepBuilderAPI_Copy aCurCopy(anOrig, true, true);
TopoDS_Shape aCopy = aCurCopy.Shape();
// Collect all the modified shapes in Copy() for futher update of binders not to lost attached attributes
for (int aTypeIt = anOrig.ShapeType() + 1; aTypeIt <= TopAbs_VERTEX; aTypeIt++)
{
for (TopExp_Explorer anExp(anOrig, (TopAbs_ShapeEnum)aTypeIt); anExp.More(); anExp.Next())
{
const TopoDS_Shape& aSx = anExp.Current();
const TopoDS_Shape& aModifShape = aCurCopy.ModifiedShape(aSx);
aOrigToCopyMapArr.ChangeValue(i).Bind(aSx, aModifShape);
aCopyToOrigMapArr.ChangeValue(i).Bind(aModifShape, aSx);
}
}
Handle(Standard_Transient) anInfo;
aCopy = XSAlgo::AlgoContainer()->ProcessShape(aCopy, myPrecision, myMaxTol,
"read.step.resource.name",
"read.step.sequence", aInfos[i],
Message_ProgressRange());
*(Handle(TopoDS_TShape)&)anOrig.TShape() = *aCopy.TShape();
}
// Update Shape context for correct attributes attaching
Handle(ShapeProcess_ShapeContext) aFullContext = new ShapeProcess_ShapeContext(TopoDS_Shape(), "", "");
TopTools_DataMapOfShapeShape& aHealedMap = (TopTools_DataMapOfShapeShape&)aFullContext->Map();
// Copy maps to the common binders map
for (int i = 1; i <= aOrigToCopyMapArr.Size(); i++)
{
const auto& aForwMap = aOrigToCopyMapArr.Value(i);
const auto& aRevMap = aCopyToOrigMapArr.Value(i);
Handle(ShapeProcess_ShapeContext) aContext = aInfos.Value(i);
for (TopTools_DataMapOfShapeShape::Iterator aMapIt(aForwMap); aMapIt.More(); aMapIt.Next())
{
aHealedMap.Bind(aMapIt.Key(), aMapIt.Value());
}
for (TopTools_DataMapOfShapeShape::Iterator anIter(aContext->Map()); anIter.More(); anIter.Next())
{
TopoDS_Shape aShape;
if (aRevMap.Find(anIter.Key(), aShape))
{
aHealedMap.Bind(aShape, anIter.Value());
}
}
}
XSAlgo::AlgoContainer()->MergeTransferInfo(TP, aFullContext);
CleanShapesToHeal();
}

View File

@@ -28,7 +28,6 @@
#include <TopTools_ListOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <Message_ProgressRange.hxx>
#include <NCollection_IndexedMap.hxx>
class StepRepr_Representation;
class Standard_Transient;
@@ -99,14 +98,8 @@ public:
//! REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION
Standard_EXPORT Standard_Boolean ComputeSRRWT (const Handle(StepRepr_RepresentationRelationship)& SRR, const Handle(Transfer_TransientProcess)& TP, gp_Trsf& Trsf);
//! Heals the collected during transferring shapes
Standard_EXPORT void PostHealing(const Handle(Transfer_TransientProcess)& TP);
//! Cleans collected for post healing shapes.
inline void CleanShapesToHeal()
{
myShapesToHeal.Clear();
}
DEFINE_STANDARD_RTTIEXT(STEPControl_ActorRead,Transfer_ActorOfTransientProcess)
@@ -192,7 +185,8 @@ private:
Standard_Real myPrecision;
Standard_Real myMaxTol;
Handle(StepRepr_Representation) mySRContext;
NCollection_IndexedMap<TopoDS_Shape> myShapesToHeal;
};

View File

@@ -217,12 +217,6 @@ STEPControl_Controller::STEPControl_Controller ()
Interface_Static::Init("step", "read.step.root.transformation", '&', "eval OFF");
Interface_Static::SetCVal("read.step.root.transformation", "ON");
Interface_Static::Init("step", "read.step.parallel.healing", 'e', "");
Interface_Static::Init("step", "read.step.parallel.healing", '&', "enum 0");
Interface_Static::Init("step", "read.step.parallel.healing", '&', "eval ON");
Interface_Static::Init("step", "read.step.parallel.healing", '&', "eval OFF");
Interface_Static::SetCVal("read.step.parallel.healing", "ON");
// STEP file encoding for names translation
// Note: the numbers should be consistent with Resource_FormatType enumeration
Interface_Static::Init("step", "read.step.codepage", 'e', "");

View File

@@ -1,4 +1,7 @@
// Copyright (c) 1999-2023 OPEN CASCADE SAS
// Created on: 2005-03-15
// Created by: Peter KURNEV
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -11,173 +14,301 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard.hxx>
#include <Standard_OutOfMemory.hxx>
#include <Standard.hxx>
#include <Standard_MMgrOpt.hxx>
#include <Standard_MMgrRaw.hxx>
#include <Standard_MMgrTBBalloc.hxx>
#include <Standard_Assert.hxx>
#include <stdlib.h>
#if(defined(_WIN32) || defined(__WIN32__))
#include <windows.h>
#include <malloc.h>
#include <locale.h>
#include <windows.h>
#include <malloc.h>
#include <locale.h>
#endif
#if defined(_MSC_VER) || defined(__ANDROID__) || defined(__QNX__)
#include <malloc.h>
#include <malloc.h>
#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && (defined(__i386) || defined(__x86_64)))
#include <mm_malloc.h>
#include <mm_malloc.h>
#else
extern "C" int posix_memalign(void** thePtr, size_t theAlign, size_t theSize);
extern "C" int posix_memalign (void** thePtr, size_t theAlign, size_t theSize);
#endif
#ifdef OCCT_MMGT_OPT_JEMALLOC
#define JEMALLOC_NO_DEMANGLE
#include <jemalloc.h>
#endif // OCCT_MMGT_OPT_JEMALLOC
// paralleling with Intel TBB
#ifdef HAVE_TBB
#include <tbb/scalable_allocator.h>
#else
#ifdef OCCT_MMGT_OPT_TBB
#undef OCCT_MMGT_OPT_TBB
#endif
#define scalable_malloc malloc
#define scalable_calloc calloc
#define scalable_realloc realloc
#define scalable_free free
// There is no support for environment variables in UWP
// OSD_Environment could not be used here because of cyclic dependency
#ifdef OCCT_UWP
#define getenv(x) NULL
#endif
// Available macros definition
// - OCCT_MMGT_OPT_TBB, using tbb::scalable_allocator
// - OCCT_MMGT_OPT_NATIVE, using native calloc, free
// - OCCT_MMGT_OPT_JEMALLOC, using external jecalloc, jefree
#ifndef OCCT_MMGT_OPT_DEFAULT
#define OCCT_MMGT_OPT_DEFAULT 0
#endif
//=======================================================================
//class : Standard_MMgrFactory
//purpose : Container for pointer to memory manager;
// used to construct appropriate memory manager according
// to environment settings, and to ensure destruction upon exit
//=======================================================================
class Standard_MMgrFactory
{
public:
static Standard_MMgrRoot* GetMMgr();
~Standard_MMgrFactory();
private:
Standard_MMgrFactory();
Standard_MMgrFactory (const Standard_MMgrFactory&);
Standard_MMgrFactory& operator= (const Standard_MMgrFactory&);
private:
Standard_MMgrRoot* myFMMgr;
};
//=======================================================================
//function : Standard_MMgrFactory
//purpose : Check environment variables and create appropriate memory manager
//=======================================================================
Standard_MMgrFactory::Standard_MMgrFactory()
: myFMMgr (NULL)
{
/*#if defined(_MSC_VER) && (_MSC_VER > 1400)
// Turn ON thread-safe C locale globally to avoid side effects by setlocale() calls between threads.
// After this call all following _configthreadlocale() will be ignored assuming
// Notice that this is MSVCRT feature - on POSIX systems xlocale API (uselocale instead of setlocale)
// should be used explicitly to ensure thread-safety!
// This is not well documented call because _ENABLE_PER_THREAD_LOCALE_GLOBAL flag is defined but not implemented for some reason.
// -1 will set global locale flag to force _ENABLE_PER_THREAD_LOCALE_GLOBAL + _ENABLE_PER_THREAD_LOCALE_NEW behaviour
// although there NO way to turn it off again and following calls will have no effect (locale will be changed only for current thread).
_configthreadlocale (-1);
#endif*/
// Check basic assumption.
// If assertion happens, then OCCT should be corrected for compatibility with such CPU architecture.
Standard_STATIC_ASSERT(sizeof(Standard_Utf8Char) == 1);
Standard_STATIC_ASSERT(sizeof(short) == 2);
Standard_STATIC_ASSERT(sizeof(Standard_Utf16Char) == 2);
Standard_STATIC_ASSERT(sizeof(Standard_Utf32Char) == 4);
#ifdef _WIN32
Standard_STATIC_ASSERT(sizeof(Standard_WideChar) == sizeof(Standard_Utf16Char));
#endif
char* aVar;
aVar = getenv ("MMGT_OPT");
Standard_Integer anAllocId = (aVar ? atoi (aVar): OCCT_MMGT_OPT_DEFAULT);
#if defined(HAVE_TBB) && defined(_M_IX86)
if (anAllocId == 2)
{
// CR25396: Check if SSE2 instructions are supported on 32-bit x86 processor on Windows platform,
// if not then use MMgrRaw instead of MMgrTBBalloc.
// It is to avoid runtime crash when running on a CPU
// that supports SSE but does not support SSE2 (some modifications of AMD Sempron).
static const DWORD _SSE2_FEATURE_BIT(0x04000000);
DWORD volatile dwFeature;
_asm
{
push eax
push ebx
push ecx
push edx
// get the CPU feature bits
mov eax, 1
cpuid
mov dwFeature, edx
pop edx
pop ecx
pop ebx
pop eax
}
if ((dwFeature & _SSE2_FEATURE_BIT) == 0)
anAllocId = 0;
}
#endif
aVar = getenv ("MMGT_CLEAR");
Standard_Boolean toClear = (aVar ? (atoi (aVar) != 0) : Standard_True);
// on Windows (actual for XP and 2000) activate low fragmentation heap
// for CRT heap in order to get best performance.
// Environment variable MMGT_LFH can be used to switch off this action (if set to 0)
#if defined(_MSC_VER)
aVar = getenv ("MMGT_LFH");
if ( aVar == NULL || atoi (aVar) != 0 )
{
ULONG aHeapInfo = 2;
HANDLE aCRTHeap = (HANDLE)_get_heap_handle();
HeapSetInformation (aCRTHeap, HeapCompatibilityInformation, &aHeapInfo, sizeof(aHeapInfo));
}
#endif
switch (anAllocId)
{
case 1: // OCCT optimized memory allocator
{
aVar = getenv ("MMGT_MMAP");
Standard_Boolean bMMap = (aVar ? (atoi (aVar) != 0) : Standard_True);
aVar = getenv ("MMGT_CELLSIZE");
Standard_Integer aCellSize = (aVar ? atoi (aVar) : 200);
aVar = getenv ("MMGT_NBPAGES");
Standard_Integer aNbPages = (aVar ? atoi (aVar) : 1000);
aVar = getenv ("MMGT_THRESHOLD");
Standard_Integer aThreshold = (aVar ? atoi (aVar) : 40000);
myFMMgr = new Standard_MMgrOpt (toClear, bMMap, aCellSize, aNbPages, aThreshold);
break;
}
case 2: // TBB memory allocator
myFMMgr = new Standard_MMgrTBBalloc (toClear);
break;
case 0:
default: // system default memory allocator
myFMMgr = new Standard_MMgrRaw (toClear);
}
}
//=======================================================================
//function : ~Standard_MMgrFactory
//purpose :
//=======================================================================
Standard_MMgrFactory::~Standard_MMgrFactory()
{
if ( myFMMgr )
myFMMgr->Purge(Standard_True);
}
//=======================================================================
// function: GetMMgr
//
// This static function has a purpose to wrap static holder for memory
// manager instance.
//
// Wrapping holder inside a function is needed to ensure that it will
// be initialized not later than the first call to memory manager (that
// would be impossible to guarantee if holder was static variable on
// global or file scope, because memory manager may be called from
// constructors of other static objects).
//
// Note that at the same time we could not guarantee that the holder
// object is destroyed after last call to memory manager, since that
// last call may be from static Handle() object which has been initialized
// dynamically during program execution rather than in its constructor.
//
// Therefore holder currently does not call destructor of the memory manager
// but only its method Purge() with Standard_True.
//
// To free the memory completely, we probably could use compiler-specific
// pragmas (such as '#pragma fini' on SUN Solaris and '#pragma init_seg' on
// WNT MSVC++) to put destructing function in code segment that is called
// after destructors of other (even static) objects. However, this is not
// done by the moment since it is compiler-dependent and there is no guarantee
// thatsome other object calling memory manager is not placed also in that segment...
//
// Note that C runtime function atexit() could not help in this problem
// since its behaviour is the same as for destructors of static objects
// (see ISO 14882:1998 "Programming languages -- C++" 3.6.3)
//
// The correct approach to deal with the problem would be to have memory manager
// to properly control its memory allocation and caching free blocks so
// as to release all memory as soon as it is returned to it, and probably
// even delete itself if all memory it manages has been released and
// last call to method Purge() was with True.
//
// Note that one possible method to control memory allocations could
// be counting calls to Allocate() and Free()...
//
//=======================================================================
Standard_MMgrRoot* Standard_MMgrFactory::GetMMgr()
{
static Standard_MMgrFactory aFactory;
return aFactory.myFMMgr;
}
//=======================================================================
//function : Allocate
//purpose :
//purpose :
//=======================================================================
Standard_Address Standard::Allocate(const Standard_Size theSize)
Standard_Address Standard::Allocate(const Standard_Size size)
{
#if defined OCCT_MMGT_OPT_JEMALLOC
Standard_Address aPtr = je_calloc(theSize, sizeof(char));
if (!aPtr)
throw Standard_OutOfMemory("Standard_MMgrRaw::Allocate(): malloc failed");
return aPtr;
#elif defined OCCT_MMGT_OPT_TBB
Standard_Address aPtr = scalable_calloc(theSize, sizeof(char));
if (!aPtr)
throw Standard_OutOfMemory("Standard_MMgrRaw::Allocate(): malloc failed");
return aPtr;
#else
Standard_Address aPtr = calloc(theSize, sizeof(char));
if (!aPtr)
throw Standard_OutOfMemory("Standard_MMgrRaw::Allocate(): malloc failed");
return aPtr;
#endif
return Standard_MMgrFactory::GetMMgr()->Allocate(size);
}
//=======================================================================
//function : Free
//purpose :
//purpose :
//=======================================================================
void Standard::Free(Standard_Address theStorage)
void Standard::Free (Standard_Address theStorage)
{
#if defined OCCT_MMGT_OPT_JEMALLOC
je_free(theStorage);
#elif defined OCCT_MMGT_OPT_TBB
scalable_free(theStorage);
#else
free(theStorage);
#endif
Standard_MMgrFactory::GetMMgr()->Free(theStorage);
}
//=======================================================================
//function : Reallocate
//purpose :
//purpose :
//=======================================================================
Standard_Address Standard::Reallocate(Standard_Address theStorage,
const Standard_Size theSize)
Standard_Address Standard::Reallocate (Standard_Address theStorage,
const Standard_Size theSize)
{
// Note that it is not possible to ensure that additional memory
// allocated by realloc will be cleared (so as to satisfy myClear mode);
// in order to do that we would need using memset..
#if defined OCCT_MMGT_OPT_JEMALLOC
Standard_Address aNewStorage = (Standard_Address)je_realloc(theStorage, theSize);
if (!aNewStorage)
throw Standard_OutOfMemory("Standard_MMgrRaw::Reallocate(): realloc failed");
return aNewStorage;
#elif defined OCCT_MMGT_OPT_TBB
Standard_Address aNewStorage = (Standard_Address)scalable_realloc(theStorage, theSize);
if (!aNewStorage)
throw Standard_OutOfMemory("Standard_MMgrRaw::Reallocate(): realloc failed");
return aNewStorage;
#else
Standard_Address aNewStorage = (Standard_Address)realloc(theStorage, theSize);
if (!aNewStorage)
throw Standard_OutOfMemory("Standard_MMgrRaw::Reallocate(): realloc failed");
return aNewStorage;
#endif
return Standard_MMgrFactory::GetMMgr()->Reallocate (theStorage, theSize);
}
//=======================================================================
//function : Purge
//purpose :
//purpose :
//=======================================================================
Standard_Integer Standard::Purge()
{
return true;
return Standard_MMgrFactory::GetMMgr()->Purge();
}
//=======================================================================
//function : AllocateAligned
//purpose :
//=======================================================================
Standard_Address Standard::AllocateAligned(const Standard_Size theSize,
const Standard_Size theAlign)
Standard_Address Standard::AllocateAligned (const Standard_Size theSize,
const Standard_Size theAlign)
{
#ifdef OCCT_MMGT_OPT_JEMALLOC
return je_aligned_alloc(theAlign, theSize);
#elif defined OCCT_MMGT_OPT_TBB
return scalable_aligned_malloc(theSize, theAlign);
#else
#if defined(_MSC_VER)
return _aligned_malloc(theSize, theAlign);
return _aligned_malloc (theSize, theAlign);
#elif defined(__ANDROID__) || defined(__QNX__)
return memalign(theAlign, theSize);
return memalign (theAlign, theSize);
#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && (defined(__i386) || defined(__x86_64)))
return _mm_malloc(theSize, theAlign);
return _mm_malloc (theSize, theAlign);
#else
void* aPtr;
if (posix_memalign(&aPtr, theAlign, theSize))
if (posix_memalign (&aPtr, theAlign, theSize))
{
return NULL;
}
return aPtr;
#endif
#endif
}
//=======================================================================
//function : FreeAligned
//purpose :
//=======================================================================
void Standard::FreeAligned(Standard_Address thePtrAligned)
void Standard::FreeAligned (Standard_Address thePtrAligned)
{
#ifdef OCCT_MMGT_OPT_JEMALLOC
return je_free(thePtrAligned);
#elif defined OCCT_MMGT_OPT_TBB
return scalable_aligned_free(thePtrAligned);
#else
#if defined(_MSC_VER)
_aligned_free(thePtrAligned);
_aligned_free (thePtrAligned);
#elif defined(__ANDROID__) || defined(__QNX__)
free(thePtrAligned);
free (thePtrAligned);
#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && (defined(__i386) || defined(__x86_64)))
_mm_free(thePtrAligned);
_mm_free (thePtrAligned);
#else
free(thePtrAligned);
#endif
free (thePtrAligned);
#endif
}

View File

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

View File

@@ -738,8 +738,6 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI
#include <StepVisual_TessellatedItem.hxx>
#include <StepVisual_TessellatedGeometricSet.hxx>
#include <StepVisual_TessellatedCurveSet.hxx>
#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
#include <StepVisual_RepositionedTessellatedItem.hxx>
#include <StepVisual_CoordinatesList.hxx>
#include <StepRepr_CharacterizedRepresentation.hxx>
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
@@ -758,7 +756,7 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI
#include <StepVisual_SurfaceStyleRenderingWithProperties.hxx>
static int THE_StepAP214_Protocol_init = 0;
static Interface_DataMapOfTransientInteger types(803);
static Interface_DataMapOfTransientInteger types(800);
//=======================================================================
//function : StepAP214_Protocol
@@ -1470,8 +1468,6 @@ StepAP214_Protocol::StepAP214_Protocol ()
types.Bind (STANDARD_TYPE(StepVisual_SurfaceStyleReflectanceAmbient), 721);
types.Bind (STANDARD_TYPE(StepVisual_SurfaceStyleRendering), 722);
types.Bind (STANDARD_TYPE(StepVisual_SurfaceStyleRenderingWithProperties), 723);
types.Bind(STANDARD_TYPE(StepVisual_RepositionedTessellatedGeometricSet), 802);
types.Bind(STANDARD_TYPE(StepVisual_RepositionedTessellatedItem), 803);
}

View File

@@ -197,10 +197,6 @@ StepVisual_PresentedItemRepresentation.cxx
StepVisual_PresentedItemRepresentation.hxx
StepVisual_RenderingPropertiesSelect.cxx
StepVisual_RenderingPropertiesSelect.hxx
StepVisual_RepositionedTessellatedGeometricSet.hxx
StepVisual_RepositionedTessellatedGeometricSet.cxx
StepVisual_RepositionedTessellatedItem.hxx
StepVisual_RepositionedTessellatedItem.cxx
StepVisual_ShadingSurfaceMethod.hxx
StepVisual_StyleContextSelect.cxx
StepVisual_StyleContextSelect.hxx

View File

@@ -1,30 +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.
#include <StepVisual_RepositionedTessellatedGeometricSet.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
IMPLEMENT_STANDARD_RTTIEXT(StepVisual_RepositionedTessellatedGeometricSet, StepVisual_TessellatedGeometricSet)
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void StepVisual_RepositionedTessellatedGeometricSet::Init(const Handle(TCollection_HAsciiString)& theName,
const NCollection_Handle<StepVisual_Array1OfTessellatedItem>& theItems,
const Handle(StepGeom_Axis2Placement3d)& theLocation)
{
StepVisual_TessellatedGeometricSet::Init(theName, theItems);
myLocation = theLocation;
}

View File

@@ -1,50 +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 _StepVisual_RepositionedTessellatedGeometricSet_HeaderFile
#define _StepVisual_RepositionedTessellatedGeometricSet_HeaderFile
#include <StepVisual_TessellatedGeometricSet.hxx>
class StepGeom_Axis2Placement3d;
DEFINE_STANDARD_HANDLE(StepVisual_RepositionedTessellatedGeometricSet, StepVisual_TessellatedGeometricSet)
//! Representation of complex STEP entity RepositionedTessellatedGeometricSet
class StepVisual_RepositionedTessellatedGeometricSet : public StepVisual_TessellatedGeometricSet
{
public:
DEFINE_STANDARD_ALLOC
DEFINE_STANDARD_RTTIEXT(StepVisual_RepositionedTessellatedGeometricSet, StepVisual_TessellatedGeometricSet)
//! Default constructor
StepVisual_RepositionedTessellatedGeometricSet() {};
//! Initialize all fields (own and inherited)
Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& theName,
const NCollection_Handle<StepVisual_Array1OfTessellatedItem>& theItems,
const Handle(StepGeom_Axis2Placement3d)& theLocation);
//! Returns location
Handle(StepGeom_Axis2Placement3d) Location() const { return myLocation; }
//! Sets location
void SetLocation(const Handle(StepGeom_Axis2Placement3d)& theLocation) { myLocation = theLocation; }
private:
Handle(StepGeom_Axis2Placement3d) myLocation;
};
#endif // StepVisual_RepositionedTessellatedGeometricSet_HeaderFile

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.
#include <StepVisual_RepositionedTessellatedItem.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
IMPLEMENT_STANDARD_RTTIEXT(StepVisual_RepositionedTessellatedItem, StepVisual_TessellatedItem)
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void StepVisual_RepositionedTessellatedItem::Init(const Handle(TCollection_HAsciiString)& theName,
const Handle(StepGeom_Axis2Placement3d)& theLocation)
{
StepVisual_TessellatedItem::Init(theName);
myLocation = theLocation;
}

View File

@@ -1,49 +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 _StepVisual_RepositionedTessellatedItem_HeaderFile
#define _StepVisual_RepositionedTessellatedItem_HeaderFile
#include <StepVisual_TessellatedItem.hxx>
class StepGeom_Axis2Placement3d;
DEFINE_STANDARD_HANDLE(StepVisual_RepositionedTessellatedItem, StepVisual_TessellatedItem)
//! Representation of STEP entity RepositionedTessellatedItem
class StepVisual_RepositionedTessellatedItem : public StepVisual_TessellatedItem
{
public:
DEFINE_STANDARD_RTTIEXT(StepVisual_RepositionedTessellatedItem, StepVisual_TessellatedItem)
DEFINE_STANDARD_ALLOC
//! Default constructor
StepVisual_RepositionedTessellatedItem() {};
//! Initialize all fields (own and inherited)
Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& theName,
const Handle(StepGeom_Axis2Placement3d)& theLocation);
//! Returns location
Handle(StepGeom_Axis2Placement3d) Location() const { return myLocation; }
//! Sets location
void SetLocation(const Handle(StepGeom_Axis2Placement3d)& theLocation) { myLocation = theLocation; }
private:
Handle(StepGeom_Axis2Placement3d) myLocation;
};
#endif // StepVisual_RepositionedTessellatedItem_HeaderFile

View File

@@ -1,12 +1,3 @@
project(TKernel)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
# Set desired Memory Manager
if ("${USE_MMGR_TYPE}" STREQUAL "TBB")
target_compile_definitions("TKernel" PRIVATE "OCCT_MMGT_OPT_TBB")
elseif ("${USE_MMGR_TYPE}" STREQUAL "JEMALLOC")
target_compile_definitions("TKernel" PRIVATE "OCCT_MMGT_OPT_JEMALLOC")
else ()
message (STATUS "Info: Used native memory manager")
endif()

View File

@@ -7,4 +7,3 @@ CSF_dl
CSF_wsock32
CSF_psapi
CSF_androidlog
CSF_MMGR

View File

@@ -968,7 +968,7 @@ void V3d_View::SetTwist(const Standard_Real angle)
const gp_Dir aReferencePlane (aCamera->Direction().Reversed());
if (!screenAxis (aReferencePlane, gp::DZ(), myXscreenAxis, myYscreenAxis, myZscreenAxis)
&& !screenAxis (aReferencePlane, gp::DY(), myXscreenAxis, myYscreenAxis, myZscreenAxis)
&& !screenAxis (aReferencePlane, gp::DX(), myXscreenAxis, myYscreenAxis, myZscreenAxis))
&& !screenAxis (aReferencePlane, gp::DZ(), myXscreenAxis, myYscreenAxis, myZscreenAxis))
{
throw V3d_BadValue ("V3d_ViewSetTwist, alignment of Eye,At,Up,");
}

View File

@@ -43,35 +43,6 @@ const Standard_GUID& XCAFDoc::AssemblyGUID ()
return ID;
}
//=======================================================================
//function : SupplementalContainerGUID
//purpose :
//=======================================================================
const Standard_GUID& XCAFDoc::SupplementalContainerGUID()
{
static const Standard_GUID ID("da071945-9557-41b4-9e44-19e649f98b54");
return ID;
}
//=======================================================================
//function : SupplementalRefGUID
//purpose :
//=======================================================================
const Standard_GUID& XCAFDoc::SupplementalRefGUID()
{
static const Standard_GUID ID("85a1b8d7-0936-4e8b-a953-a8bd7731411a");
return ID;
}
//=======================================================================
//function : SupplementalGeometryGUID
//purpose :
//=======================================================================
const Standard_GUID& XCAFDoc::SupplementalGeometryGUID()
{
static const Standard_GUID ID("e17cce33-1aa2-4b7f-9060-6e469a7954a9");
return ID;
}
//=======================================================================
//function : ExternRefGUID

View File

@@ -72,15 +72,6 @@ public:
//! Returns GUID for TreeNode representing assembly link
Standard_EXPORT static const Standard_GUID& ShapeRefGUID();
//! Returns GUID for TreeNode representing compound of supplemental geometry
Standard_EXPORT static const Standard_GUID& SupplementalContainerGUID();
//! Returns GUID for TreeNode representing reference for supplemental geometry
Standard_EXPORT static const Standard_GUID& SupplementalRefGUID();
//! Returns GUID for TreeNode representing supplemental geometry
Standard_EXPORT static const Standard_GUID& SupplementalGeometryGUID();
//! Return GUIDs for TreeNode representing specified types of colors
Standard_EXPORT static const Standard_GUID& ColorRefGUID (const XCAFDoc_ColorType type);

View File

@@ -13,8 +13,6 @@
#include <XCAFDoc_DimTolTool.hxx>
#include <Bnd_Box.hxx>
#include <BRepBndLib.hxx>
#include <Precision.hxx>
#include <Standard_GUID.hxx>
#include <Standard_Type.hxx>
@@ -619,51 +617,6 @@ Standard_Boolean XCAFDoc_DimTolTool::GetRefDatumLabel(const TDF_Label& theShapeL
return Standard_True;
}
//=======================================================================
//function : GetNumberOfPlaces
//purpose :
//=======================================================================
Standard_Integer XCAFDoc_DimTolTool::GetNumberOfPlaces(const TDF_Label& theLabel)
{
TDF_LabelSequence aFirstShapes, aSecondShapes;
GetRefShapeLabel(theLabel, aFirstShapes, aSecondShapes);
NCollection_Sequence<Bnd_Box> aBoxes;
for (Standard_Integer anI = 1; anI <= aFirstShapes.Size(); anI++)
{
Bnd_Box aBox;
BRepBndLib::Add(ShapeTool()->GetShape(aFirstShapes(anI)), aBox, Standard_True);
aBoxes.Append(aBox);
}
// Fill bounded boxes of number of places - this will exclude duplications
NCollection_Sequence<Bnd_Box> aPlaces;
for (Standard_Integer anI = 1; anI <= aBoxes.Size(); anI++)
{
Standard_Boolean toAddPlace = Standard_True;
Standard_Integer aBoxesIndex = 1;
for (Standard_Integer aJ = 1; aJ <= aPlaces.Size(); aJ++)
{
if (!aPlaces(aJ).IsOut(aBoxes(anI)))
{
toAddPlace = Standard_False;
aBoxesIndex = aJ;
break;
}
}
if (toAddPlace)
{
aPlaces.Append(aBoxes(anI));
}
else
{
aPlaces.ChangeValue(aBoxesIndex).Add(aBoxes(anI));
}
}
return aPlaces.Size();
}
//=======================================================================
//function : GetDimTol
//purpose :

View File

@@ -232,10 +232,6 @@ public:
Standard_EXPORT Standard_Boolean GetRefDatumLabel (const TDF_Label& theShapeL,
TDF_LabelSequence& theDatum) const;
//! @param theLabel [in] geometrical tolerance TDF label.
//! @return Number Of Places corresponding to the Geometrical Tolerance or Dimensional Tolerance TDF label.
Standard_EXPORT Standard_Integer GetNumberOfPlaces (const TDF_Label& theLabel);
//! Returns true if the given GDT is marked as locked.
Standard_EXPORT Standard_Boolean IsLocked(const TDF_Label& theViewL) const;

View File

@@ -1,4 +1,8 @@
puts "TODO OCC25925 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
puts "TODO OCC25925 ALL: Error: The command cannot be built"
puts "TODO OCC25925 ALL: Faulty OCC5805 : result is not Closed shape"
puts "TODO OCC25925 ALL: TEST INCOMPLETE"
puts "TODO OCC25925 ALL: Tcl Exception: Error : command \\\"nbshapes result\\\" gives an empty result"
puts "============"
puts "OCC5805"
@@ -32,7 +36,7 @@ if [catch { thrusections s ${issolid} ${isruled} UpCover BottomCover } catch_res
set distance -0.001
catch { OFFSETSHAPE $distance {s_2} $calcul $type }
# Bad result
# Null result
checkprops result -s 358.795
@@ -48,6 +52,6 @@ if {$index == -1} {
}
checkshape result
checknbshapes result -t -wire 5 -face 5 -shell 2 -solid 1
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,6 +1,6 @@
puts "TODO OCC23068 ALL: Error : is WRONG because number of"
puts "TODO OCC23068 ALL: Error : The area of result shape is"
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "TODO OCC25925 ALL: Error: The command cannot be built"
puts "TODO OCC25925 ALL: TEST INCOMPLETE"
puts "TODO OCC25925 ALL: Tcl Exception: Error : command \\\"nbshapes result\\\" gives an empty result"
puts "============"
puts "OCC5805"
@@ -36,9 +36,7 @@ set distance -0.001
catch { OFFSETSHAPE $distance {} $calcul $type }
# Null result
checkprops result -s 495.635
checkshape result
checknbshapes result -vertex 2 -edge 3 -wire 3 -face 3 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 13
@@ -54,5 +52,4 @@ if {$index == -1} {
}
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,4 +1,6 @@
puts "TODO OCC25925 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "TODO OCC25925 ALL: Faulty OCC5805 : result is not Closed shape"
puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
puts "TODO OCC25925 ALL: Error: The command cannot be built"
puts "============"
puts "OCC5805"
@@ -32,11 +34,10 @@ if [catch { thrusections s ${issolid} ${isruled} UpCover BottomCover } catch_res
set distance -0.001
catch { OFFSETSHAPE $distance {s_2} $calcul $type }
# Bad result
# Null result
checkprops result -s 495.635
checkshape result
set index [lsearch [whatis s] Closed]
if {$index == -1} {
@@ -50,5 +51,4 @@ if {$index == -1} {
}
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,43 @@
puts "======================================================================"
puts "OCC31735: BRepOffset_MakeOffset works slowly and produces wrong result"
puts "======================================================================"
puts ""
setfillhistory 1
restore [locate_data_file bug31735_1.brep] a
offsetparameter 1e-7 c i
offsetload a 0.02
offsetperform result
checkshape result
checknbshapes result -t -wire 28 -face 28 -shell 1 -solid 1
set tolres [checkmaxtol result]
if { ${tolres} > 0.001001} {
puts "Error: bad tolerance of result"
}
savehistory hh
explode a f
generated gf hh a_2
checkprops gf -s 0.582567
explode a_2 e
generated ge hh a_2_3
checkprops ge -l 0.440027
explode a_2_3
generated gv hh a_2_3_1
axo
donly a_2 a_2_3 a_2_3_1 result gf ge gv
fit
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
puts "TEST COMPLETED"

View File

@@ -0,0 +1,41 @@
puts "======================================================================"
puts "OCC31735: BRepOffset_MakeOffset works slowly and produces wrong result"
puts "======================================================================"
puts ""
setfillhistory 1
restore [locate_data_file bug31735_1.brep] a
explode a f
offsetparameter 1e-7 c i
offsetload a -0.02 a_1 a_2 a_3 a_4 a_10 a_11 a_12 a_15
offsetperform result
checknbshapes result -t -wire 49 -face 49 -shell 1 -solid 1
set tolres [checkmaxtol result]
if { ${tolres} > 0.001001} {
puts "Error: bad tolerance of result"
}
savehistory hh
generated gf6 hh a_6
checkprops gf6 -s 0.255127
modified mf2 hh a_2
checkprops mf2 -s 0.0270215
if {[regexp "Not deleted" [isdeleted hh a_1]]} {
puts "Error: History information is wrong"
}
axo
donly result gf6 mf2
fit
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
puts "TEST COMPLETED"

View File

@@ -0,0 +1,15 @@
puts "============================================"
puts "OCC31845: BRepOffsetAPI_MakeThickSolid fails"
puts "============================================"
puts ""
restore [locate_data_file bug31845_1.brep] a
offsetparameter 1e-7 c i
offsetload a 0.2
offsetperform result
checkshape result
checkprops result -s 271.847
checknbshapes result -t -edge 12 -wire 6 -face 6 -shell 1 -solid 1
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,15 @@
puts "============================================"
puts "OCC31845: BRepOffsetAPI_MakeThickSolid fails"
puts "============================================"
puts ""
restore [locate_data_file bug31845_1.brep] a
offsetparameter 1e-7 c i
offsetload a -0.2
offsetperform result
checkshape result
checkprops result -s 210.825
checknbshapes result -t -edge 12 -wire 6 -face 6 -shell 1 -solid 1
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,16 @@
puts "============================================"
puts "OCC31845: BRepOffsetAPI_MakeThickSolid fails"
puts "============================================"
puts ""
restore [locate_data_file bug31845_1.brep] a
explode a f
offsetparameter 1e-7 p i
offsetload a 0.2 a_5 a_6
offsetperform result
checkshape result
checkprops result -s 423.33
checknbshapes result -t -edge 24 -wire 12 -face 10 -shell 1 -solid 1
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,17 @@
puts "============================================"
puts "OCC31845: BRepOffsetAPI_MakeThickSolid fails"
puts "============================================"
puts ""
restore [locate_data_file bug31845_1.brep] a
explode a f
offsetparameter 1e-7 p i
offsetload a -0.2 a_5 a_6
offsetperform result
checkshape result
checkprops result -s 388.879
checknbshapes result -t -edge 24 -wire 12 -face 10 -shell 1 -solid 1
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,14 @@
puts "TODO OCC31845 All: ERROR. offsetperform operation not done."
puts "============================================"
puts "OCC31845: BRepOffsetAPI_MakeThickSolid fails"
puts "============================================"
puts ""
restore [locate_data_file bug31845_f.brep] a
explode a f
offsetparameter 1e-7 p i
offsetload a 0.001 a_4 a_5
offsetperform result

View File

@@ -0,0 +1,16 @@
puts "TODO OCC31845 All: ERROR: null result"
puts "============================================"
puts "OCC31845: BRepOffsetAPI_MakeThickSolid fails"
puts "============================================"
puts ""
restore [locate_data_file bug31845_h.brep] a
offsetparameter 1e-7 p i
offsetload a -0.01
offsetperform result
if {[llength [whatis result]] < 4} {
puts "ERROR: null result"
}

View File

@@ -0,0 +1,13 @@
puts "TODO OCC31845 All: ERROR. offsetperform operation not done."
puts "============================================"
puts "OCC31845: BRepOffsetAPI_MakeThickSolid fails"
puts "============================================"
puts ""
restore [locate_data_file bug31845_h.brep] a
explode a f
offsetparameter 1e-7 p i
offsetload a 0.001 a_3 a_4
offsetperform result

View File

@@ -0,0 +1,46 @@
puts "======================================================="
puts "0031912: Modeling Algorithms - Boolean Cut can't build resulting shape"
puts "======================================================="
puts ""
pload DATAEXCHANGE
stepread [locate_data_file bug31912_s.stp] s *
stepread [locate_data_file bug31912_b.stp] b *
bclearobjects
bcleartools
baddobjects s_1
baddtools b_1
bfillds
bbop r0 0
bbop r1 1
bbop r2 2
bbop r3 3
bbop r4 4
bbuild rgf
foreach r {r0 r1 r2 r3 r4 rgf} {
checkshape $r
}
checknbshapes r0 -wire 6 -face 6 -shell 1 -solid 1 -t
checkprops r0 -s 279207 -v 5.32814e+06
checknbshapes r1 -wire 12 -face 12 -shell 1 -solid 1 -t
checkprops r1 -s 4.93771e+06 -v 1.56185e+08
checknbshapes r2 -wire 8 -face 8 -shell 1 -solid 1 -t
checkprops r2 -s 4.37427e+06 -v 1.34873e+08
checknbshapes r3 -wire 6 -face 6 -shell 1 -solid 1 -t
checkprops r3 -s 571214 -v 1.59844e+07
checkprops r4 -l 3810.09
checksection r4 -r 4
checknbshapes rgf -wire 16 -face 16 -shell 3 -solid 3 -t
checkprops rgf -s 5.22469e+06 -v 1.56185e+08
checkview -display rgf -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,15 @@
puts "========="
puts "0032058: Modeling Data - Extrema curve-surface gives wrong result for planar surface of revolunion and circle"
puts "========="
puts ""
restore [locate_data_file bug32058_c] c
restore [locate_data_file bug32058_s] s
extrema c s
checklength ext_1 -l 2.3437142008433856e-13
smallview
fit
checkview -screenshot -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,17 +0,0 @@
puts "======="
puts "0032731: Data Exchange, Step Import - Incorrect PMI text location"
puts "======="
pload OCAF
catch {Close D}
# Read file
ReadStep D [locate_data_file bug32731_A5E46910589A.stp]
#Checking
XGetShape repr0 D 0:1:4:106:15
checkgravitycenter repr0 -l -109.847 153.679 0 1e-7
XGetShape repr1 D 0:1:4:56:15
checkgravitycenter repr1 -l -68.7 123.272 -18.5624 1e-7

View File

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

View File

@@ -1,3 +1,5 @@
puts "TODO OCC26030 ALL: Error : The offset cannot be built"
puts "========"
puts "OCC26288"
puts "========"

View File

View File

@@ -1,7 +1,6 @@
puts "TODO OCC24156 MacOS: An exception was caught"
puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "TODO OCC23068 ALL: Error : The area of face result_3 of the resulting shape is negative."
puts "TODO OCC23068 ALL: Error: bsection of the result and s is not equal to zero."
ellipse w1 0 0 0 15 10
mkedge w1 w1 0 pi/2

View File

@@ -1,5 +1,4 @@
puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape"
puts "TODO OCC27414 ALL: the resulting shape is negative"
restore [locate_data_file bug26917_dom-8092.new_with_faces.brep] c

View File

@@ -1,5 +1,4 @@
puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape"
puts "TODO OCC27414 ALL: the resulting shape is negative"
restore [locate_data_file bug26917_dom-8092.new_trim2_with_faces.brep] c

View File

@@ -1,5 +1,4 @@
puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape"
puts "TODO OCC27414 ALL: the resulting shape is negative"
restore [locate_data_file bug26917_dom-8092.new_trim4_with_faces.brep] c