1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Compare commits

...

13 Commits

Author SHA1 Message Date
inv
d2abb6d844 Update version up to 7.6.1 2022-02-01 15:05:58 +03:00
jgv
e697b85307 0032747: Modeling Algorithms - Exact HLR algorithm gives wrong result
Modify the method IntWalk_IWalking::TestArretCadre: correct the value of scalar product of two vectors according to the tolerances in U and V.
2022-01-31 18:26:58 +03:00
emv
9967602647 0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode "Complete" join type "Intersection"
Add more faces for intersection in rebuilding process basing on the connection of the splits of offset faces (special treatment for the artificially invalid faces).
When rebuilding faces add vertices common for faces for trimming the new intersection edges.

Adjust existing and create new test cases.
2022-01-31 18:23:59 +03:00
kgv
e1a92d9ef0 0032484: Configuration, CMake fails to find EGL and GLES2 include directory on iOS platform
Fixed configuration errors and compilation errors on iOS target due to unexpected EGL usage (non-existing on iOS).
2022-01-31 18:21:49 +03:00
atychini
730b9ecc2d 0032748: Data Exchange, Step Import - xstep.cascade.unit doesn't work [regression since OCCT 7.6.0]
Added new condition in STEPControl_ActorRead::Transfer: if StepData_StepModel is not an initialized Unit - we set unit to this step model
2022-01-31 16:06:08 +03:00
Dzmitry Razmyslovich
336e2cdeda 0032784: BinXCAF fails to load documents containing the shapes with scaled/mirrored location
A flag not to raise an exception is used on reading of an XCAF document. If such a shape with scaling transformation is stored in the document, it should be read.
2022-01-19 10:34:30 +03:00
vro
e5021ff47f 0032757: Application Framework, scaling transformation - loading of an OCAF XML document fails
A flag not to raise an exception is used on reading of an OCAF document. If such a shape with scaling transformation is stored in the document, it should be read.

Modified files:
XmlMNaming\XmlMNaming_NamedShapeDriver.cxx: not checking of the type of transformation for a read shape
2022-01-18 17:49:03 +03:00
Dzmitry Razmyslovich
9735948819 0031087: Configuration - make FreeType dependency optional [part 2] 2021-11-25 20:52:26 +03:00
kgv
660a8938a3 0032652: Visualization - Select3D_SensitiveCylinder returns wrong 3D point on transformed shape
SelectMgr_RectangularFrustum::OverlapsCylinder() - added missing 3D point transformation.
StdSelect_BRepSelectionTool::ComputeSensitive() - fixed cylinder height computation on TopoDS_Shape with scale transformation.
SelectMgr_AxisIntersector::OverlapsCylinder(),::OverlapsSphere() - added missing computations of surface normal.
2021-11-19 10:13:36 +03:00
dipts
642ddd1253 0032661: Coding - Forward class declaration in ProjLib collides with typeref
Removed redundant forward declarations from ProjLib.hxx.
2021-11-19 10:13:12 +03:00
Xu Zhongxing
03fc07c28b 0032649: Bug in BRepLib::EnsureNormalConsistency()
Fix a typo in variable name.
2021-11-19 10:12:42 +03:00
kgv
2e84f455db 0032654: Data Exchange - fix misprint in RWGltf_TriangulationReader::readDracoBuffer()
Added missing break.
Fixes reading of glTF files with Normal attributes preceding Position
(and eliminates redundant / erroneous copy when Position attributes precede Normal).
2021-11-19 10:12:36 +03:00
kgv
2d7f390051 Update version up to 7.6.1dev. 2021-11-19 10:11:21 +03:00
69 changed files with 1025 additions and 291 deletions

View File

@@ -661,8 +661,10 @@ endif()
if (CAN_USE_GLES2)
if (USE_GLES2)
add_definitions (-DHAVE_GLES2_EXT)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
if (NOT IOS)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
endif()
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2")

View File

@@ -2423,7 +2423,7 @@ Standard_Boolean BRepLib::
gp_Vec3f aNorm1f, aNorm2f;
aPT1->Normal (aFNodF1, aNorm1f);
aPT1->Normal (aFNodF2, aNorm2f);
aPT2->Normal (aFNodF2, aNorm2f);
const gp_XYZ aNorm1 (aNorm1f.x(), aNorm1f.y(), aNorm1f.z());
const gp_XYZ aNorm2 (aNorm2f.x(), aNorm2f.y(), aNorm2f.z());
const Standard_Real aDot = aNorm1 * aNorm2;

View File

@@ -52,6 +52,7 @@
#include <BOPAlgo_PaveFiller.hxx>
#include <BOPAlgo_Section.hxx>
#include <BOPAlgo_Splitter.hxx>
#include <BOPAlgo_BOP.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
@@ -107,6 +108,19 @@ namespace {
{
BRep_Builder().Add (theSOut, theS);
}
static void AddToContainer (const TopoDS_Shape& theKey,
const TopoDS_Shape& theValue,
TopTools_DataMapOfShapeListOfShape& theMap)
{
if (TopTools_ListOfShape* pList = theMap.ChangeSeek (theKey))
{
pList->Append (theValue);
}
else
{
theMap.Bound (theKey, TopTools_ListOfShape())->Append (theValue);
}
}
//=======================================================================
//function : TakeModified
@@ -617,7 +631,9 @@ private: //! @name Intersection and post-treatment of edges
//! Filtering the invalid edges according to currently invalid faces
void FilterInvalidEdges (const BRepOffset_DataMapOfShapeIndexedMapOfShape& theDMFMIE,
const TopTools_IndexedMapOfShape& theMERemoved);
const TopTools_IndexedMapOfShape& theMERemoved,
const TopTools_IndexedMapOfShape& theMEInside,
TopTools_MapOfShape& theMEUseInRebuild);
private: //! @name Checking faces
@@ -766,6 +782,7 @@ private: //! @name Checking faces
const TopTools_MapOfShape& theVertsToAvoid,
const TopTools_MapOfShape& theNewVertsToAvoid,
const TopTools_MapOfShape& theMECheckExt,
const TopTools_DataMapOfShapeListOfShape* theSSInterfs,
TopTools_MapOfShape& theMVBounds,
TopTools_DataMapOfShapeListOfShape& theEImages);
@@ -877,16 +894,18 @@ private:
TopTools_IndexedMapOfShape myEdgesToAvoid; //!< Splits of edges to be avoided when building splits of faces
TopTools_MapOfShape myLastInvEdges; //!< Edges marked invalid on the current step and to be avoided on the next step
TopTools_MapOfShape myModifiedEdges; //!< Edges to be used for building splits
TopTools_IndexedMapOfShape myInsideEdges; //!< Edges located fully inside solids built from the splits of offset faces
TopTools_IndexedDataMapOfShapeListOfShape myInvalidFaces; //!< Invalid faces - splits of offset faces consisting of invalid edges
TopTools_DataMapOfShapeShape myArtInvalidFaces; //!< Artificially invalid faces - valid faces intentionally marked invalid
//! to be rebuilt on the future steps in the situations when invalid edges
//! are present, but invalid faces not
BRepOffset_DataMapOfShapeIndexedMapOfShape myArtInvalidFaces; //!< Artificially invalid faces - valid faces intentionally marked invalid
//! to be rebuilt on the future steps in the situations when invalid edges
//! are present, but invalid faces not
TopTools_DataMapOfShapeInteger myAlreadyInvFaces; //!< Count number of the same face being marked invalid to avoid infinite
//! rebuilding of the same face
TopTools_DataMapOfShapeListOfShape myFNewHoles; //!< Images of the hole faces of the original face
TopTools_DataMapOfShapeListOfShape mySSInterfs; //!< Intersection information, used to collect intersection pairs during rebuild
TopTools_DataMapOfShapeListOfShape mySSInterfsArt; //!< Intersection information, used to collect intersection pairs during rebuild
NCollection_DataMap <TopoDS_Shape,
BRepOffset_DataMapOfShapeMapOfShape,
TopTools_ShapeMapHasher> myIntersectionPairs; //!< All possible intersection pairs, used to avoid some of the intersections
@@ -1004,6 +1023,7 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfExtendedFaces (const Message_Prog
myInvalidEdges.Clear();
myInvertedEdges.Clear();
mySSInterfs.Clear();
mySSInterfsArt.Clear();
myIntersectionPairs.Clear();
mySolids.Nullify();
myFacesToRebuild.Clear();
@@ -1299,9 +1319,8 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
//
if (bArtificialCase)
{
TopTools_IndexedMapOfShape aMEInv;
// make the face invalid
myArtInvalidFaces.Bind (aF, aCE);
TopTools_IndexedMapOfShape aMEInv;
//
*pLFIm = aLFImages;
TopTools_ListIteratorOfListOfShape aItLFIm (aLFImages);
@@ -1324,6 +1343,7 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
}
}
//
myArtInvalidFaces.Bind (aF, aMEInv);
aDMFMIE.Bind (aF, aMEInv);
aLFDone.Append (aF);
//
@@ -1519,9 +1539,8 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
RemoveInvalidSplitsFromValid (aDMFMVIE);
//
// remove inside faces
TopTools_IndexedMapOfShape aMEInside;
RemoveInsideFaces (anInvertedFaces, aMFToCheckInt, aMFInvInHole, aFHoles,
aMERemoved, aMEInside, aPSOuter.Next (5.));
aMERemoved, myInsideEdges, aPSOuter.Next (5.));
//
// make compound of valid splits
TopoDS_Compound aCFIm;
@@ -1546,7 +1565,7 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
FilterEdgesImages (aCFIm);
//
// filter invalid faces
FilterInvalidFaces (aDMEF, aMEInside);
FilterInvalidFaces (aDMEF, aMERemoved.Extent() ? myInsideEdges : aMERemoved);
aNb = myInvalidFaces.Extent();
if (!aNb)
{
@@ -1572,7 +1591,10 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
#endif
//
// filter invalid edges
FilterInvalidEdges (aDMFMIE, aMERemoved);
TopTools_MapOfShape aMEUseInRebuild;
FilterInvalidEdges (aDMFMIE, aMERemoved,
aMERemoved.Extent() ? myInsideEdges : aMERemoved,
aMEUseInRebuild);
//
// Check additionally validity of edges originated from vertices.
CheckEdgesCreatedByVertex();
@@ -1594,8 +1616,11 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
for (i = 1; i <= aNb; ++i)
{
const TopoDS_Shape& aE = myInvalidEdges (i);
myEdgesToAvoid.Add (aE);
myLastInvEdges.Add (aE);
if (!aMEUseInRebuild.Contains(aE))
{
myEdgesToAvoid.Add (aE);
}
}
//
aNb = myInvalidFaces.Extent();
@@ -1793,11 +1818,10 @@ Standard_Boolean BRepOffset_BuildOffsetFaces::CheckIfArtificial (const TopoDS_Sh
{
const TopoDS_Edge& aE = TopoDS::Edge (aItLE.Value());
//
if (myOEImages.IsBound (aE))
if (const TopTools_ListOfShape* pLEIm = myOEImages.Seek (aE))
{
Standard_Boolean bChecked = Standard_False;
const TopTools_ListOfShape& aLEIm = myOEImages.Find (aE);
TopTools_ListIteratorOfListOfShape aItLEIm (aLEIm);
TopTools_ListIteratorOfListOfShape aItLEIm (*pLEIm);
for (; aItLEIm.More(); aItLEIm.Next())
{
const TopoDS_Edge& aEIm = TopoDS::Edge (aItLEIm.Value());
@@ -4165,6 +4189,7 @@ void BRepOffset_BuildOffsetFaces::RemoveInsideFaces (const TopTools_ListOfShape&
RemoveInvalidSplits (aMFToRem, aMV, theMERemoved);
//
// Get inside faces from the removed ones comparing them with boundary edges
theMEInside.Clear();
aNb = theMERemoved.Extent();
for (i = 1; i <= aNb; ++i)
{
@@ -4189,6 +4214,28 @@ void BRepOffset_BuildOffsetFaces::RemoveInsideFaces (const TopTools_ListOfShape&
void BRepOffset_BuildOffsetFaces::ShapesConnections (const TopTools_DataMapOfShapeShape& theDMFOr,
BOPAlgo_Builder& theBuilder)
{
// Make connexity blocks from invalid edges to use the whole block
// to which the edge is connected instead of the single edge.
TopoDS_Compound aCEInv;
BRep_Builder().MakeCompound(aCEInv);
for (Standard_Integer i = 1; i <= myInvalidEdges.Extent(); ++i)
{
AddToContainer (myInvalidEdges(i), aCEInv);
}
TopTools_ListOfShape aLCB;
BOPTools_AlgoTools::MakeConnexityBlocks (aCEInv, TopAbs_VERTEX, TopAbs_EDGE, aLCB);
// Binding from the edge to the block
TopTools_DataMapOfShapeShape aECBMap;
for (TopTools_ListOfShape::Iterator itCB(aLCB); itCB.More(); itCB.Next())
{
for (TopoDS_Iterator itE(itCB.Value()); itE.More(); itE.Next())
{
aECBMap.Bind(itE.Value(), itCB.Value());
}
}
// update invalid edges with images and keep connection to original edge
TopTools_DataMapOfShapeListOfShape aDMEOr;
Standard_Integer aNb = myInvalidEdges.Extent();
@@ -4206,13 +4253,7 @@ void BRepOffset_BuildOffsetFaces::ShapesConnections (const TopTools_DataMapOfSha
for (; aItLEIm.More(); aItLEIm.Next())
{
const TopoDS_Shape& aEIm = aItLEIm.Value();
//
TopTools_ListOfShape* pLEOr = aDMEOr.ChangeSeek (aEIm);
if (!pLEOr)
{
pLEOr = aDMEOr.Bound (aEIm, TopTools_ListOfShape());
}
AppendToList (*pLEOr, aEInv);
AddToContainer (aEIm, aEInv, aDMEOr);
}
}
//
@@ -4365,6 +4406,121 @@ void BRepOffset_BuildOffsetFaces::ShapesConnections (const TopTools_DataMapOfSha
AppendToList (*pLF, aFOp);
}
}
// Treatment for the artificial case - check if one of the faces is artificially invalid
for (Standard_Integer iF = 0; iF < 2; ++iF)
{
const TopoDS_Shape& aFArt = !iF ? *pF1 : *pF2;
const TopoDS_Shape& aFOpposite = !iF ? *pF2 : *pF1;
if (!myArtInvalidFaces.IsBound (aFArt))
continue;
if (myInvalidFaces.Contains (aFOpposite) && !myArtInvalidFaces.IsBound (aFOpposite))
continue;
// Collect own invalid edges of the face and the invalid edges connected to those
// own invalid edges to be avoided in the check for intersection.
TopTools_IndexedMapOfShape aMEAvoid;
if (const TopTools_IndexedMapOfShape* pFEInv = myArtInvalidFaces.Seek (aFOpposite))
{
for (Standard_Integer iE = 1; iE <= pFEInv->Extent(); ++iE)
{
if (const TopoDS_Shape* pCB = aECBMap.Seek (pFEInv->FindKey(iE)))
{
TopExp::MapShapes (*pCB, TopAbs_EDGE, aMEAvoid);
}
}
}
else if (const TopTools_ListOfShape* pLFIm = myOFImages.Seek (aFOpposite))
{
for (TopTools_ListOfShape::Iterator itLFIm (*pLFIm); itLFIm.More(); itLFIm.Next())
{
for (TopExp_Explorer expE (itLFIm.Value(), TopAbs_EDGE); expE.More(); expE.Next())
{
if (const TopoDS_Shape* pCB = aECBMap.Seek (expE.Current()))
{
TopExp::MapShapes (*pCB, TopAbs_EDGE, aMEAvoid);
}
}
}
}
const TopoDS_Shape& aFArtIm = !iF ? aFIm1 : aFIm2;
const TopoDS_Shape& aFOppositeIm = !iF ? aFIm2 : aFIm1;
// Check if there are any intersections between edges of artificially
// invalid face and opposite face
const Standard_Integer nFOp = pDS->Index (aFOppositeIm);
for (TopExp_Explorer expE (aFArtIm, TopAbs_EDGE); expE.More(); expE.Next())
{
const TopoDS_Shape& aE = expE.Current();
if (!myInvalidEdges.Contains (aE) || myInvertedEdges.Contains (aE) || aMEAvoid.Contains (aE))
{
continue;
}
const Standard_Integer nE = pDS->Index (aE);
if (nE < 0)
{
continue;
}
if (!pDS->HasInterf(nE, nFOp))
{
continue;
}
TopTools_ListOfShape aLV;
const BOPDS_VectorOfInterfEF& aEFs = pDS->InterfEF();
for (Standard_Integer iEF = 0; iEF < aEFs.Size(); ++iEF)
{
const BOPDS_InterfEF& aEF = aEFs (iEF);
if (aEF.Contains (nE) && aEF.Contains(nFOp))
{
if (aEF.CommonPart().Type() == TopAbs_VERTEX)
aLV.Append (pDS->Shape (aEF.IndexNew()));
}
}
if (aLV.IsEmpty())
{
continue;
}
// Make sure that there is an opposite intersection exists, i.e. some of the edges
// of the opposite face intersect the artificially invalid face.
const Standard_Integer nFArt = pDS->Index (aFArtIm);
TopExp_Explorer expEOp (aFOppositeIm, TopAbs_EDGE);
for (; expEOp.More(); expEOp.Next())
{
const TopoDS_Shape& aEOp = expEOp.Current();
const Standard_Integer nEOp = pDS->Index (aEOp);
if (pDS->HasInterf(nEOp, nFArt))
{
break;
}
}
if (!expEOp.More())
{
continue;
}
// Intersection is present - add connection between offset faces.
AddToContainer (aFArt, aFOpposite, mySSInterfsArt);
// Add connection between edge and opposite face
AddToContainer (aE, aFOpposite, mySSInterfsArt);
// Along with the opposite face, save the intersection vertices to
// be used for trimming the intersection edge in the rebuilding process
for (TopTools_ListOfShape::Iterator itLV (aLV); itLV.More(); itLV.Next())
{
// Add connection to intersection vertex
AddToContainer (aE, itLV.Value(), mySSInterfsArt);
}
}
}
}
}
@@ -4960,7 +5116,9 @@ void BRepOffset_BuildOffsetFaces::CheckEdgesCreatedByVertex()
//purpose : Filtering the invalid edges according to currently invalid faces
//=======================================================================
void BRepOffset_BuildOffsetFaces::FilterInvalidEdges (const BRepOffset_DataMapOfShapeIndexedMapOfShape& theDMFMIE,
const TopTools_IndexedMapOfShape& theMERemoved)
const TopTools_IndexedMapOfShape& theMERemoved,
const TopTools_IndexedMapOfShape& theMEInside,
TopTools_MapOfShape& theMEUseInRebuild)
{
TopoDS_Compound aCEInv;
TopTools_IndexedMapOfShape aMEInv;
@@ -5023,14 +5181,16 @@ void BRepOffset_BuildOffsetFaces::FilterInvalidEdges (const BRepOffset_DataMapOf
const TopoDS_Shape& aF = myInvalidFaces.FindKey (i);
if (myArtInvalidFaces.IsBound (aF))
{
const TopTools_IndexedMapOfShape& aMIE = theDMFMIE.Find (aF);
const Standard_Integer aNbIE = aMIE.Extent();
for (Standard_Integer iE = 1; iE <= aNbIE; ++iE)
if (const TopTools_IndexedMapOfShape* aMIE = theDMFMIE.Seek (aF))
{
const TopoDS_Shape& aE = aMIE (iE);
if (aMEInv.Contains (aE) && !aMEInvToAvoid.Contains (aE))
const Standard_Integer aNbIE = aMIE->Extent();
for (Standard_Integer iE = 1; iE <= aNbIE; ++iE)
{
aReallyInvEdges.Add (aE);
const TopoDS_Shape& aE = aMIE->FindKey (iE);
if (aMEInv.Contains (aE) && !aMEInvToAvoid.Contains (aE))
{
aReallyInvEdges.Add (aE);
}
}
}
}
@@ -5053,8 +5213,46 @@ void BRepOffset_BuildOffsetFaces::FilterInvalidEdges (const BRepOffset_DataMapOf
}
}
}
//
myInvalidEdges = aReallyInvEdges;
// Check if any of the currently invalid edges may be used for
// rebuilding splits of invalid faces.
// For that the edge should be inside and not connected to invalid
// boundary edges of the same origin.
aNb = myInvalidEdges.Extent();
for (i = 1; i <= aNb; ++i)
{
const TopoDS_Shape& aE = myInvalidEdges (i);
if (!theMEInside.Contains (aE) || !myValidEdges.Contains (aE))
{
continue;
}
const TopTools_ListOfShape* pEOrigins = myOEOrigins.Seek (aE);
if (!pEOrigins)
{
theMEUseInRebuild.Add (aE);
continue;
}
Standard_Boolean bHasInvOutside = Standard_False;
for (TopTools_ListOfShape::Iterator itEOr (*pEOrigins); !bHasInvOutside && itEOr.More(); itEOr.Next())
{
if (const TopTools_ListOfShape* pEIms = myOEImages.Seek (itEOr.Value()))
{
for (TopTools_ListOfShape::Iterator itEIms (*pEIms); !bHasInvOutside && itEIms.More(); itEIms.Next())
{
bHasInvOutside = myInvalidEdges.Contains (itEIms.Value()) && !theMEInside.Contains (itEIms.Value());
}
}
}
if (!bHasInvOutside)
{
theMEUseInRebuild.Add (aE);
}
}
}
//=======================================================================
@@ -5116,7 +5314,7 @@ void BRepOffset_BuildOffsetFaces::FindFacesToRebuild()
aDMFLV.Bind (aF, aLVAvoid);
}
//
const TopTools_ListOfShape* pLF = mySSInterfs.Seek (aF);
const TopTools_ListOfShape* pLF = !myArtInvalidFaces.IsBound(aF) ? mySSInterfs.Seek (aF) : mySSInterfsArt.Seek(aF);
if (pLF)
{
TopTools_ListIteratorOfListOfShape aItLFE (*pLF);
@@ -5275,7 +5473,7 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
TopTools_DataMapOfShapeShape aDMFImF;
TopoDS_Compound aCFArt;
BRep_Builder().MakeCompound (aCFArt);
TopTools_DataMapIteratorOfDataMapOfShapeShape aItM (myArtInvalidFaces);
BRepOffset_DataMapOfShapeIndexedMapOfShape::Iterator aItM (myArtInvalidFaces);
for (; aItM.More(); aItM.Next())
{
const TopoDS_Shape& aF = aItM.Key();
@@ -5597,9 +5795,13 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
continue;
}
//
const TopTools_ListOfShape& aLFImi = myOFImages.FindFromKey (aFi);
const TopTools_ListOfShape* aLFImi = myOFImages.Seek (aFi);
if (!aLFImi)
continue;
//
TopTools_ListOfShape& aLFEi = aFLE.ChangeFromKey (aFi);
TopTools_ListOfShape* aLFEi = aFLE.ChangeSeek (aFi);
if (!aLFEi)
continue;
//
TopTools_ListOfShape& aLFDone = aMDone.ChangeFind (aFi);
//
@@ -5618,20 +5820,42 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
if (pInterFi && !pInterFi->Contains (aFj))
continue;
const TopTools_ListOfShape& aLFImj = myOFImages.FindFromKey (aFj);
const TopTools_ListOfShape* aLFImj = myOFImages.Seek(aFj);
if (!aLFImj)
continue;
//
TopTools_ListOfShape& aLFEj = aFLE.ChangeFromKey (aFj);
TopTools_ListOfShape* aLFEj = aFLE.ChangeSeek (aFj);
if (!aLFEj)
continue;
//
// if there are some common edges between faces
// we should use these edges and do not intersect again.
TopTools_ListOfShape aLEC;
FindCommonParts (aLFImi, aLFImj, aLEC);
FindCommonParts (*aLFImi, *aLFImj, aLEC);
//
if (aLEC.Extent())
{
// no need to intersect if we have common edges between faces
Standard_Boolean bForceUse = aMFIntExt.Contains (aFi) || aMFIntExt.Contains (aFj);
ProcessCommonEdges (aLEC, aME, aMEInfETrim, aMAllInvs, bForceUse, aMECV, aMECheckExt, aDMEETrim, aLFEi, aLFEj, aMEToInt);
ProcessCommonEdges (aLEC, aME, aMEInfETrim, aMAllInvs, bForceUse, aMECV, aMECheckExt, aDMEETrim, *aLFEi, *aLFEj, aMEToInt);
// Add common vertices not belonging to the common edges for trimming the intersection edges
TopTools_IndexedMapOfShape aMVOnCE;
for (TopTools_ListOfShape::Iterator itE (aLEC); itE.More(); itE.Next())
{
TopExp::MapShapes (itE.Value(), TopAbs_VERTEX, aMVOnCE);
}
TopTools_ListOfShape aLEV;
FindCommonParts (*aLFImi, *aLFImj, aLEV, TopAbs_VERTEX);
for (TopTools_ListOfShape::Iterator itV (aLEV); itV.More(); itV.Next())
{
if (!aMVOnCE.Contains (itV.Value()))
{
aMECV.Add (itV.Value());
}
}
continue;
}
//
@@ -5657,7 +5881,7 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
{
// use intersection line obtained on the previous steps
// plus, find new origins for these lines
UpdateIntersectedFaces (aFInv, aFi, aFj, aLFInv, aLFImi, aLFImj, aLFEi, aLFEj, aMEToInt);
UpdateIntersectedFaces (aFInv, aFi, aFj, aLFInv, *aLFImi, *aLFImj, *aLFEi, *aLFEj, aMEToInt);
continue;
}
//
@@ -5669,13 +5893,14 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
aLFDone.Append (aFj);
aMDone.ChangeFind (aFj).Append (aFi);
//
IntersectFaces (aFInv, aFi, aFj, aLFInv, aLFImi, aLFImj, aLFEi, aLFEj, aMECV, aMEToInt);
IntersectFaces (aFInv, aFi, aFj, aLFInv, *aLFImi, *aLFImj, *aLFEi, *aLFEj, aMECV, aMEToInt);
}
}
//
// intersect and trim edges for this chain
IntersectAndTrimEdges (aMFInt, aMEToInt, aDMEETrim, aME, aMECV,
aMVInv, aMVRInv, aMECheckExt, aMVBounds, aEImages);
aMVInv, aMVRInv, aMECheckExt, bArtificial ? &mySSInterfsArt : 0,
aMVBounds, aEImages);
//
Standard_Integer iE, aNbEToInt = aMEToInt.Extent();
for (iE = 1; iE <= aNbEToInt; ++iE)
@@ -5956,12 +6181,8 @@ void BRepOffset_BuildOffsetFaces::FindFacesForIntersection (const TopoDS_Shape&
}
}
//
if (theArtCase)
{
return;
}
//
const TopTools_ListOfShape* pLFInv = mySSInterfs.Seek (theFInv);
const TopTools_DataMapOfShapeListOfShape& aSSInterfsMap = theArtCase ? mySSInterfsArt : mySSInterfs;
const TopTools_ListOfShape* pLFInv = aSSInterfsMap.Seek (theFInv);
if (!pLFInv)
{
return;
@@ -5985,7 +6206,7 @@ void BRepOffset_BuildOffsetFaces::FindFacesForIntersection (const TopoDS_Shape&
for (i = 1; i <= aNbE; ++i)
{
const TopoDS_Shape& aS = theME (i);
const TopTools_ListOfShape* pLF = mySSInterfs.Seek (aS);
const TopTools_ListOfShape* pLF = aSSInterfsMap.Seek (aS);
if (!pLF)
{
continue;
@@ -6002,30 +6223,33 @@ void BRepOffset_BuildOffsetFaces::FindFacesForIntersection (const TopoDS_Shape&
//
// check if the face has some connection to already added for intersection faces
const TopTools_ListOfShape& aLFIm = myOFImages.FindFromKey (aF);
TopTools_ListIteratorOfListOfShape aItLFIm (aLFIm);
for (; aItLFIm.More(); aItLFIm.Next())
if (!theArtCase)
{
const TopoDS_Shape& aFIm = aItLFIm.Value();
TopExp_Explorer aExp (aFIm, TopAbs_EDGE);
for (; aExp.More(); aExp.Next())
TopTools_ListIteratorOfListOfShape aItLFIm (aLFIm);
for (; aItLFIm.More(); aItLFIm.Next())
{
if (aMShapes.Contains (aExp.Current()))
const TopoDS_Shape& aFIm = aItLFIm.Value();
TopExp_Explorer aExp (aFIm, TopAbs_EDGE);
for (; aExp.More(); aExp.Next())
{
if (aMShapes.Contains (aExp.Current()))
{
break;
}
}
if (aExp.More())
{
break;
}
}
if (aExp.More())
if (!aItLFIm.More())
{
break;
continue;
}
}
if (!aItLFIm.More())
{
continue;
}
//
aMFToAdd.Add (aF);
aItLFIm.Initialize (aLFIm);
TopTools_ListIteratorOfListOfShape aItLFIm (aLFIm);
for (; aItLFIm.More(); aItLFIm.Next())
{
const TopoDS_Shape& aFIm = aItLFIm.Value();
@@ -6423,6 +6647,7 @@ void BRepOffset_BuildOffsetFaces::IntersectAndTrimEdges (const TopTools_IndexedM
const TopTools_MapOfShape& theVertsToAvoid,
const TopTools_MapOfShape& theNewVertsToAvoid,
const TopTools_MapOfShape& theMECheckExt,
const TopTools_DataMapOfShapeListOfShape* theSSInterfs,
TopTools_MapOfShape& theMVBounds,
TopTools_DataMapOfShapeListOfShape& theEImages)
{
@@ -6468,30 +6693,39 @@ void BRepOffset_BuildOffsetFaces::IntersectAndTrimEdges (const TopTools_IndexedM
aNb = theMSInv.Extent();
for (i = 1; i <= aNb; ++i)
{
const TopoDS_Shape& aV = theMSInv (i);
if (aV.ShapeType() != TopAbs_VERTEX)
const TopoDS_Shape& aS = theMSInv(i);
// edge case
if (theSSInterfs)
{
continue;
}
//
TopTools_ListOfShape* pLVE = aDMVE.ChangeSeek (aV);
if (!pLVE)
{
continue;
}
//
aIt.Initialize (*pLVE);
for (; aIt.More(); aIt.Next())
{
const TopoDS_Shape& aE = aIt.Value();
//
aExp.Init (aE, TopAbs_VERTEX);
for (; aExp.More(); aExp.Next())
if (const TopTools_ListOfShape* pLV = theSSInterfs->Seek (aS))
{
const TopoDS_Shape& aV1 = aExp.Current();
if (!theVertsToAvoid.Contains (aV1) && aMFence.Add (aV1))
// Add vertices from intersection info to trim section edges of artificial faces
for (TopTools_ListOfShape::Iterator itLV (*pLV); itLV.More(); itLV.Next())
{
aLArgs.Append (aV1);
if (itLV.Value().ShapeType() == TopAbs_VERTEX)
{
aLArgs.Append (itLV.Value());
}
}
}
}
// vertex case
if (const TopTools_ListOfShape* pLVE = aDMVE.ChangeSeek(aS))
{
aIt.Initialize(*pLVE);
for (; aIt.More(); aIt.Next())
{
const TopoDS_Shape& aE = aIt.Value();
//
aExp.Init(aE, TopAbs_VERTEX);
for (; aExp.More(); aExp.Next())
{
const TopoDS_Shape& aV1 = aExp.Current();
if (!theVertsToAvoid.Contains(aV1) && aMFence.Add(aV1))
{
aLArgs.Append(aV1);
}
}
}
}
@@ -7137,9 +7371,19 @@ void BRepOffset_BuildOffsetFaces::UpdateValidEdges (const TopTools_IndexedDataMa
TopExp::MapShapes (aItSpIm.Value(), TopAbs_EDGE, aNewEdges);
}
}
TopoDS_Compound anInsideEdges;
BRep_Builder().MakeCompound (anInsideEdges);
for (Standard_Integer iE = 1; iE <= myInsideEdges.Extent(); ++iE)
{
BRep_Builder().Add (anInsideEdges, myInsideEdges (iE));
}
//
// Rebuild the map of edges to avoid, using the intersection results
TopTools_IndexedMapOfShape aMEAvoid;
TopoDS_Compound aCEAvoid;
BRep_Builder().MakeCompound (aCEAvoid);
// GF's data structure
const BOPDS_PDS& pDS = aGF.PDS();
@@ -7175,7 +7419,7 @@ void BRepOffset_BuildOffsetFaces::UpdateValidEdges (const TopTools_IndexedDataMa
if (bKeep)
{
// keep the original edge
aMEAvoid.Add (aE);
AddToContainer (aE, aMEAvoid);
continue;
}
@@ -7184,9 +7428,41 @@ void BRepOffset_BuildOffsetFaces::UpdateValidEdges (const TopTools_IndexedDataMa
{
const TopoDS_Shape& aEIm = aItLEIm.Value();
if (!aNewEdges.Contains (aEIm))
aMEAvoid.Add (aEIm);
{
AddToContainer(aEIm, aCEAvoid);
}
}
}
Standard_Boolean isCut = Standard_False;
if (aCEAvoid.NbChildren() > 0)
{
// Perform intersection with the small subset of the edges to make
// it possible to use the inside edges for building new splits.
BOPAlgo_BOP aBOP;
aBOP.AddArgument (aCEAvoid);
aBOP.AddTool (anInsideEdges);
aBOP.SetOperation (BOPAlgo_CUT);
aBOP.Perform();
isCut = !aBOP.HasErrors();
if (isCut)
{
for (TopoDS_Iterator itCE (aCEAvoid); itCE.More(); itCE.Next())
{
if (!aBOP.IsDeleted (itCE.Value()))
{
aMEAvoid.Add (itCE.Value());
}
}
}
}
if (!isCut)
{
TopExp::MapShapes (aCEAvoid, TopAbs_EDGE, aMEAvoid);
}
myEdgesToAvoid = aMEAvoid;
}

View File

@@ -132,7 +132,7 @@ static int TranslateFrom (const BinObjMgt_Persistent& theSource,
TopAbs_Orientation anOrient = CharToOrientation (aCharOrient);
theResult.TShape (theShapeSet->Shape (aShapeID).TShape());//TShape
theResult.Location (theShapeSet->Locations().Location (aLocID)); //Location
theResult.Location (theShapeSet->Locations().Location (aLocID), Standard_False); //Location
theResult.Orientation (anOrient);//Orientation
return 0;
}

View File

@@ -103,9 +103,11 @@ bool Font_FTFont::Init (const Handle(NCollection_Buffer)& theData,
{
throw Standard_ProgramError ("Font_FTFont, Light and Normal hinting styles are mutually exclusive");
}
#ifdef HAVE_FREETYPE
setLoadFlag (FT_LOAD_TARGET_LIGHT, (theParams.FontHinting & Font_Hinting_Light) != 0);
setLoadFlag (FT_LOAD_NO_HINTING, (theParams.FontHinting & Font_Hinting_Normal) == 0
&& (theParams.FontHinting & Font_Hinting_Light) == 0);
#endif
// manage native / autohinting
if ((theParams.FontHinting & Font_Hinting_ForceAutohint) != 0
@@ -113,8 +115,10 @@ bool Font_FTFont::Init (const Handle(NCollection_Buffer)& theData,
{
throw Standard_ProgramError ("Font_FTFont, ForceAutohint and NoAutohint are mutually exclusive");
}
#ifdef HAVE_FREETYPE
setLoadFlag (FT_LOAD_FORCE_AUTOHINT, (theParams.FontHinting & Font_Hinting_ForceAutohint) != 0);
setLoadFlag (FT_LOAD_NO_AUTOHINT, (theParams.FontHinting & Font_Hinting_NoAutohint) != 0);
#endif
if (!myFTLib->IsValid())
{

View File

@@ -22,6 +22,14 @@
#define No_Standard_OutOfRange
#endif
static void CutVectorByTolerances (gp_Vec2d& theVector,
const math_Vector& theTolerance)
{
if (Abs(theVector.X()) < theTolerance(1))
theVector.SetX (0.);
if (Abs(theVector.Y()) < theTolerance(2))
theVector.SetY (0.);
}
// _______________________________________________
//
@@ -771,8 +779,13 @@ void IntWalk_IWalking::TestArretCadre
Line->Value(j).ParametersOnS1(Uc,Vc);
}
Scal = (Up-wd1[i].ustart) * (Uc-wd1[i].ustart) +
(Vp-wd1[i].vstart) * (Vc-wd1[i].vstart);
gp_Vec2d aVec1 (Up-wd1[i].ustart, Vp-wd1[i].vstart),
aVec2 (Uc-wd1[i].ustart, Vc-wd1[i].vstart);
CutVectorByTolerances (aVec1, tolerance);
CutVectorByTolerances (aVec2, tolerance);
Scal = aVec1 * aVec2;
// if a stop point is found: stop the line on this point.
if (Scal < 0) {
Line->Cut(j); nbp= Line->NbPoints();
@@ -791,8 +804,14 @@ void IntWalk_IWalking::TestArretCadre
}
else if (nbMultiplicities[i] > 0) {
for (Standard_Integer k = N+1; k <= N + nbMultiplicities[i]; k++) {
Scal = (Up-Umult(k)) * (Uc-Umult(k)) +
(Vp-Vmult(k)) * (Vc-Vmult(k));
aVec1.SetCoord (Up-Umult(k), Vp-Vmult(k)),
aVec2.SetCoord (Uc-Umult(k), Vc-Vmult(k));
CutVectorByTolerances (aVec1, tolerance);
CutVectorByTolerances (aVec2, tolerance);
Scal = aVec1 * aVec2;
if (Scal < 0) {
Line->Cut(j); nbp= Line->NbPoints();
Irang=i;
@@ -847,11 +866,13 @@ void IntWalk_IWalking::TestArretCadre
// now the last point of the line and the last calculated point are compated.
// there will be no need to "Cut"
Scal = (Up-wd1[i].ustart) * (UV(1)-wd1[i].ustart) +
// (Vp-wd1[i].vstart) * (UV(2)-wd1[i].vstart);
// modified by NIZHNY-MKK Fri Oct 27 12:29:41 2000
(Vp-wd1[i].vstart) * (UV(2)-wd1[i].vstart);
gp_Vec2d aVec1 (Up-wd1[i].ustart, Vp-wd1[i].vstart),
aVec2 (UV(1)-wd1[i].ustart, UV(2)-wd1[i].vstart);
CutVectorByTolerances (aVec1, tolerance);
CutVectorByTolerances (aVec2, tolerance);
Scal = aVec1 * aVec2;
if (Scal < 0) {
Irang = i;
UV(1) = wd1[Irang].ustart;
@@ -867,8 +888,14 @@ void IntWalk_IWalking::TestArretCadre
}
else if (nbMultiplicities[i] > 0) {
for (Standard_Integer j = N+1; j <= N+nbMultiplicities[i]; j++) {
Scal = (Up-Umult(j)) * (UV(1)-Umult(j)) +
(Vp-Vmult(j)) * (UV(2)-Vmult(j));
aVec1.SetCoord (Up-Umult(j), Vp-Vmult(j));
aVec2.SetCoord (UV(1)-Umult(j), UV(2)-Vmult(j));
CutVectorByTolerances (aVec1, tolerance);
CutVectorByTolerances (aVec2, tolerance);
Scal = aVec1 * aVec2;
if (Scal < 0) {
Irang=i;
UV(1) = wd1[Irang].ustart;

View File

@@ -67,7 +67,9 @@
#if !defined(HAVE_EGL)
#if defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(HAVE_GLES2) || defined(OCCT_UWP)
#define HAVE_EGL
#if !defined(__APPLE__)
#define HAVE_EGL // EAGL is used instead of EGL
#endif
#elif !defined(_WIN32) && !defined(__APPLE__) && !defined(HAVE_XLIB)
#define HAVE_EGL
#endif

View File

@@ -52,7 +52,17 @@ IMPLEMENT_STANDARD_RTTIEXT(OpenGl_GraphicDriver,Graphic3d_GraphicDriver)
#include <GL/glx.h>
#endif
#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__)
#if !defined(HAVE_EGL)
#if defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(HAVE_GLES2) || defined(OCCT_UWP)
#if !defined(__APPLE__)
#define HAVE_EGL // EAGL is used instead of EGL
#endif
#elif !defined(_WIN32) && !defined(__APPLE__) && !defined(HAVE_XLIB)
#define HAVE_EGL
#endif
#endif
#if defined(HAVE_EGL)
#include <EGL/egl.h>
#ifndef EGL_OPENGL_ES3_BIT
#define EGL_OPENGL_ES3_BIT 0x00000040
@@ -63,7 +73,7 @@ namespace
{
static const Handle(OpenGl_Context) TheNullGlCtx;
#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__)
#if defined(HAVE_EGL)
//! Wrapper over eglChooseConfig() called with preferred defaults.
static EGLConfig chooseEglSurfConfig (EGLDisplay theDisplay)
{
@@ -155,7 +165,7 @@ OpenGl_GraphicDriver::OpenGl_GraphicDriver (const Handle(Aspect_DisplayConnectio
myMapOfView (1, NCollection_BaseAllocator::CommonBaseAllocator()),
myMapOfStructure (1, NCollection_BaseAllocator::CommonBaseAllocator())
{
#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__)
#if defined(HAVE_EGL)
myEglDisplay = (Aspect_Display )EGL_NO_DISPLAY;
myEglContext = (Aspect_RenderingContext )EGL_NO_CONTEXT;
#endif
@@ -250,7 +260,7 @@ void OpenGl_GraphicDriver::ReleaseContext()
aWindow->GetGlContext()->forcedRelease();
}
#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__)
#if defined(HAVE_EGL)
if (myIsOwnContext)
{
if (myEglContext != (Aspect_RenderingContext )EGL_NO_CONTEXT)
@@ -285,7 +295,7 @@ void OpenGl_GraphicDriver::ReleaseContext()
Standard_Boolean OpenGl_GraphicDriver::InitContext()
{
ReleaseContext();
#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__)
#if defined(HAVE_EGL)
#if defined(HAVE_XLIB)
if (myDisplayConnection.IsNull())
@@ -369,7 +379,7 @@ Standard_Boolean OpenGl_GraphicDriver::InitEglContext (Aspect_Display t
void* theEglConfig)
{
ReleaseContext();
#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__)
#if defined(HAVE_EGL)
#if defined(HAVE_XLIB)
if (myDisplayConnection.IsNull())
{
@@ -420,7 +430,7 @@ void OpenGl_GraphicDriver::chooseVisualInfo()
XVisualInfo* aVisInfo = NULL;
Aspect_FBConfig anFBConfig = NULL;
#if defined(HAVE_EGL) || defined(HAVE_GLES2)
#if defined(HAVE_EGL)
XVisualInfo aVisInfoTmp;
memset (&aVisInfoTmp, 0, sizeof(aVisInfoTmp));
aVisInfoTmp.screen = DefaultScreen (aDisp);

View File

@@ -14,8 +14,17 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ProjLib.hxx>
#include <Adaptor3d_Surface.hxx>
#include <ElSLib.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2d_Circle.hxx>
#include <Geom2d_Ellipse.hxx>
#include <Geom2d_Parabola.hxx>
#include <Geom2d_Hyperbola.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <gp_Circ.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Cone.hxx>
@@ -33,22 +42,13 @@
#include <gp_Pnt2d.hxx>
#include <gp_Sphere.hxx>
#include <gp_Torus.hxx>
#include <ProjLib.hxx>
#include <ProjLib_Cone.hxx>
#include <ProjLib_Cylinder.hxx>
#include <ProjLib_Plane.hxx>
#include <ProjLib_Sphere.hxx>
#include <ProjLib_Torus.hxx>
#include <ProjLib_ProjectedCurve.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2d_Circle.hxx>
#include <Geom2d_Ellipse.hxx>
#include <Geom2d_Parabola.hxx>
#include <Geom2d_Hyperbola.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <Standard_NotImplemented.hxx>
#include <Adaptor3d_Surface.hxx>
//=======================================================================
//function : Project

View File

@@ -37,141 +37,77 @@ class gp_Cylinder;
class gp_Cone;
class gp_Sphere;
class gp_Torus;
class ProjLib_ProjectOnPlane;
class ProjLib_ProjectOnSurface;
class ProjLib_ComputeApprox;
class ProjLib_ComputeApproxOnPolarSurface;
class ProjLib_ProjectedCurve;
class ProjLib_HProjectedCurve;
class ProjLib_CompProjectedCurve;
class ProjLib_HCompProjectedCurve;
class ProjLib_PrjResolve;
class ProjLib_PrjFunc;
class ProjLib_Projector;
class ProjLib_Plane;
class ProjLib_Cylinder;
class ProjLib_Cone;
class ProjLib_Sphere;
class ProjLib_Torus;
//! The projLib package first provides projection of
//! curves on a plane along a given Direction. The
//! result will be a 3D curve.
//! The ProjLib package provides projection of curves
//! on surfaces to compute the curve in the parametric
//! space.
//! The ProjLib package first provides projection of curves on a plane along a given Direction.
//! The result will be a 3D curve.
//!
//! The ProjLib package provides projection of curves on surfaces to compute the curve in the parametric space.
//! It is assumed that the curve is on the surface.
//!
//! It provides :
//! It provides:
//!
//! * Package methods to handle the easiest cases :
//! * Package methods to handle the easiest cases:
//! - Line, Circle, Ellipse, Parabola, Hyperbola on plane.
//! - Line, Circle on cylinder.
//! - Line, Circle on cone.
//!
//! - Line, Circle, Ellipse, Parabola, Hyperbola on plane.
//! * Classes to handle the general cases:
//! - Plane.
//! - Cylinder.
//! - Cone.
//! - Sphere.
//! - Torus.
//!
//! - Line, Circle on cylinder.
//!
//! - Line, Circle on cone.
//!
//! * Classes to handle the general cases :
//!
//! - Plane.
//!
//! - Cylinder.
//!
//! - Cone.
//!
//! - Sphere.
//!
//! - Torus.
//!
//! * A generic class to handle a Curve from Adaptor3d
//! on a Surface from Adaptor3d.
//! * A generic class to handle a Adaptor3d_Curve on a Adaptor3d_Surface.
class ProjLib
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT static gp_Pnt2d Project (const gp_Pln& Pl, const gp_Pnt& P);
Standard_EXPORT static gp_Lin2d Project (const gp_Pln& Pl, const gp_Lin& L);
Standard_EXPORT static gp_Circ2d Project (const gp_Pln& Pl, const gp_Circ& C);
Standard_EXPORT static gp_Elips2d Project (const gp_Pln& Pl, const gp_Elips& E);
Standard_EXPORT static gp_Parab2d Project (const gp_Pln& Pl, const gp_Parab& P);
Standard_EXPORT static gp_Hypr2d Project (const gp_Pln& Pl, const gp_Hypr& H);
Standard_EXPORT static gp_Pnt2d Project (const gp_Cylinder& Cy, const gp_Pnt& P);
Standard_EXPORT static gp_Lin2d Project (const gp_Cylinder& Cy, const gp_Lin& L);
Standard_EXPORT static gp_Lin2d Project (const gp_Cylinder& Cy, const gp_Circ& Ci);
Standard_EXPORT static gp_Pnt2d Project (const gp_Cone& Co, const gp_Pnt& P);
Standard_EXPORT static gp_Lin2d Project (const gp_Cone& Co, const gp_Lin& L);
Standard_EXPORT static gp_Lin2d Project (const gp_Cone& Co, const gp_Circ& Ci);
Standard_EXPORT static gp_Pnt2d Project (const gp_Sphere& Sp, const gp_Pnt& P);
Standard_EXPORT static gp_Lin2d Project (const gp_Sphere& Sp, const gp_Circ& Ci);
Standard_EXPORT static gp_Pnt2d Project (const gp_Torus& To, const gp_Pnt& P);
Standard_EXPORT static gp_Lin2d Project (const gp_Torus& To, const gp_Circ& Ci);
//! Make empty P-Curve <aC> of relevant to <PC> type
Standard_EXPORT static void MakePCurveOfType (const ProjLib_ProjectedCurve& PC,
Handle(Geom2d_Curve)& aC);
//! Returns "true" if surface is analytical, that is it can be
//! Plane, Cylinder, Cone, Sphere, Torus.
//! For all other types of surface method returns "false".
Standard_EXPORT static Standard_Boolean IsAnaSurf
(const Handle(Adaptor3d_Surface)& theAS);
protected:
private:
friend class ProjLib_ProjectOnPlane;
friend class ProjLib_ProjectOnSurface;
friend class ProjLib_ComputeApprox;
friend class ProjLib_ComputeApproxOnPolarSurface;
friend class ProjLib_ProjectedCurve;
friend class ProjLib_HProjectedCurve;
friend class ProjLib_CompProjectedCurve;
friend class ProjLib_HCompProjectedCurve;
friend class ProjLib_PrjResolve;
friend class ProjLib_PrjFunc;
friend class ProjLib_Projector;
friend class ProjLib_Plane;
friend class ProjLib_Cylinder;
friend class ProjLib_Cone;
friend class ProjLib_Sphere;
friend class ProjLib_Torus;
};
#endif // _ProjLib_HeaderFile

View File

@@ -297,6 +297,7 @@ bool RWGltf_TriangulationReader::readDracoBuffer (const Handle(RWGltf_GltfLatePr
myCoordSysConverter.TransformPosition (anXYZ.ChangeCoord());
setNodePosition (theDestMesh, THE_LOWER_NODE_INDEX + aVertIter, anXYZ);
}
break;
}
case RWGltf_GltfArrayType_Normal:
{

View File

@@ -284,6 +284,11 @@ Handle(Transfer_Binder) STEPControl_ActorRead::Transfer
{
// [BEGIN] Get version of preprocessor (to detect I-Deas case) (ssv; 23.11.2010)
Handle(StepData_StepModel) aStepModel = Handle(StepData_StepModel)::DownCast ( TP->Model() );
if (!aStepModel->IsInitializedUnit())
{
XSAlgo::AlgoContainer()->PrepareForTransfer(); // update unit info
aStepModel->SetLocalLengthUnit(UnitsMethods::GetCasCadeLengthUnit());
}
Interface_EntityIterator anEntIt = aStepModel->Header();
for ( anEntIt.Start(); anEntIt.More(); anEntIt.Next() ) {
DeclareAndCast( HeaderSection_FileName, aFileNameEntity, anEntIt.Value() );
@@ -1614,7 +1619,6 @@ Handle(Transfer_Binder) STEPControl_ActorRead::TransferShape(
const Message_ProgressRange& theProgress)
{
if (start.IsNull()) return NullResult();
XSAlgo::AlgoContainer()->PrepareForTransfer();
Message_Messenger::StreamBuffer sout = TP->Messenger()->SendInfo();
#ifdef TRANSLOG

View File

@@ -543,7 +543,11 @@ Standard_Boolean SelectMgr_AxisIntersector::OverlapsSphere (const gp_Pnt& theCen
return Standard_False;
}
const gp_Pnt aPntOnSphere (myAxis.Location().XYZ() + myAxis.Direction().XYZ() * aDepth);
const gp_Vec aNormal (aPntOnSphere.XYZ() - theCenter.XYZ());
thePickResult.SetDepth (aDepth);
thePickResult.SetPickedPoint (aPntOnSphere);
thePickResult.SetSurfaceNormal (aNormal);
return Standard_True;
}
@@ -576,7 +580,22 @@ Standard_Boolean SelectMgr_AxisIntersector::OverlapsCylinder (const Standard_Rea
{
return false;
}
const gp_Pnt aPntOnCylinder = aLoc.XYZ() + aRayDir.XYZ() * aDepth;
thePickResult.SetDepth (aDepth);
thePickResult.SetPickedPoint (aPntOnCylinder.Transformed (theTrsf));
if (Abs (aPntOnCylinder.Z()) < Precision::Confusion())
{
thePickResult.SetSurfaceNormal (-gp::DZ().Transformed (theTrsf));
}
else if (Abs (aPntOnCylinder.Z() - theHeight) < Precision::Confusion())
{
thePickResult.SetSurfaceNormal (gp::DZ().Transformed (theTrsf));
}
else
{
thePickResult.SetSurfaceNormal (gp_Vec (aPntOnCylinder.X(), aPntOnCylinder.Y(), 0.0).Transformed (theTrsf));
}
return true;
}

View File

@@ -753,20 +753,24 @@ Standard_Boolean SelectMgr_RectangularFrustum::OverlapsCylinder (const Standard_
{
Standard_ASSERT_RAISE (mySelectionType == SelectMgr_SelectionType_Point || mySelectionType == SelectMgr_SelectionType_Box,
"Error! SelectMgr_RectangularFrustum::Overlaps() should be called after selection frustum initialization");
Standard_Real aTimeEnter = 0.0, aTimeLeave = 0.0;
Standard_Real aTimes[2] = { 0.0, 0.0 };
const gp_Trsf aTrsfInv = theTrsf.Inverted();
const gp_Pnt aLoc = myNearPickedPnt.Transformed (aTrsfInv);
const gp_Dir aRayDir = myViewRayDir .Transformed (aTrsfInv);
if (!RayCylinderIntersection (theBottomRad, theTopRad, theHeight, aLoc, aRayDir, aTimeEnter, aTimeLeave))
if (!RayCylinderIntersection (theBottomRad, theTopRad, theHeight, aLoc, aRayDir, aTimes[0], aTimes[1]))
{
return Standard_False;
}
thePickResult.SetDepth (aTimeEnter * myScale);
Standard_Integer aResTime = 0;
thePickResult.SetDepth (aTimes[aResTime] * myScale);
if (theClipRange.IsClipped (thePickResult.Depth()))
{
thePickResult.SetDepth (aTimeLeave * myScale);
aResTime = 1;
thePickResult.SetDepth (aTimes[aResTime] * myScale);
}
const gp_Pnt aPntOnCylinder (aLoc.XYZ() + aRayDir.XYZ() * thePickResult.Depth());
const gp_Pnt aPntOnCylinder = aLoc.XYZ() + aRayDir.XYZ() * aTimes[aResTime];
if (Abs (aPntOnCylinder.Z()) < Precision::Confusion())
{
thePickResult.SetSurfaceNormal (-gp::DZ().Transformed (theTrsf));
@@ -779,7 +783,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::OverlapsCylinder (const Standard_
{
thePickResult.SetSurfaceNormal (gp_Vec (aPntOnCylinder.X(), aPntOnCylinder.Y(), 0.0).Transformed (theTrsf));
}
thePickResult.SetPickedPoint (aPntOnCylinder);
thePickResult.SetPickedPoint (aPntOnCylinder.Transformed (theTrsf));
return !theClipRange.IsClipped (thePickResult.Depth());
}

View File

@@ -35,19 +35,19 @@
// Primary definitions
#define OCC_VERSION_MAJOR 7
#define OCC_VERSION_MINOR 6
#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 "dev"
// #define OCC_VERSION_DEVELOPMENT "dev"
// Derived (manually): version as real and string (major.minor)
#define OCC_VERSION 7.6
#define OCC_VERSION_STRING "7.6"
#define OCC_VERSION_COMPLETE "7.6.0"
#define OCC_VERSION_COMPLETE "7.6.1"
//! Derived: extended version as string ("major.minor.maintenance.dev")
#ifdef OCC_VERSION_DEVELOPMENT

View File

@@ -280,11 +280,11 @@ void StdSelect_BRepSelectionTool::ComputeSensitive (const TopoDS_Shape& theShape
&TopoDS::Face (aSubfacesMap.FindKey (2))
};
TopLoc_Location aLocSurf;
TopLoc_Location aLocSurf[2];
const Handle(Geom_Surface)* aSurfaces[2] =
{
&BRep_Tool::Surface (*aFaces[0], aLocSurf),
&BRep_Tool::Surface (*aFaces[1], aLocSurf)
&BRep_Tool::Surface (*aFaces[0], aLocSurf[0]),
&BRep_Tool::Surface (*aFaces[1], aLocSurf[1])
};
Standard_Integer aConIndex = 0;
@@ -308,7 +308,7 @@ void StdSelect_BRepSelectionTool::ComputeSensitive (const TopoDS_Shape& theShape
const Standard_Real aRad1 = aCone.RefRadius();
const Standard_Real aHeight = (aRad1 != 0.0)
? aRad1 / Abs (Tan (aCone.SemiAngle()))
: aCone.Location().Distance (aGeomPln->Location());
: aCone.Location().Distance (aGeomPln->Location().Transformed (aLocSurf[aConIndex == 0 ? 1 : 0]));
const Standard_Real aRad2 = (aRad1 != 0.0) ? 0.0 : Tan (aCone.SemiAngle()) * aHeight;
gp_Trsf aTrsf;
aTrsf.SetTransformation (aCone.Position(), gp_Ax3());
@@ -326,18 +326,19 @@ void StdSelect_BRepSelectionTool::ComputeSensitive (const TopoDS_Shape& theShape
&TopoDS::Face (aSubfacesMap.FindKey (3))
};
TopLoc_Location aLocSurf;
TopLoc_Location aLocSurf[3];
const Handle(Geom_Surface)* aSurfaces[3] =
{
&BRep_Tool::Surface (*aFaces[0], aLocSurf),
&BRep_Tool::Surface (*aFaces[1], aLocSurf),
&BRep_Tool::Surface (*aFaces[2], aLocSurf)
&BRep_Tool::Surface (*aFaces[0], aLocSurf[0]),
&BRep_Tool::Surface (*aFaces[1], aLocSurf[1]),
&BRep_Tool::Surface (*aFaces[2], aLocSurf[2])
};
Standard_Integer aConIndex = -1, aNbPlanes = 0;
Handle(Geom_ConicalSurface) aGeomCone;
Handle(Geom_CylindricalSurface) aGeomCyl;
Handle(Geom_Plane) aGeomPlanes[2];
const TopLoc_Location* aGeomPlanesLoc[2];
for (Standard_Integer aSurfIter = 0; aSurfIter < 3; ++aSurfIter)
{
const Handle(Geom_Surface)& aSurf = *aSurfaces[aSurfIter];
@@ -361,6 +362,7 @@ void StdSelect_BRepSelectionTool::ComputeSensitive (const TopoDS_Shape& theShape
aGeomPlanes[aNbPlanes] = Handle(Geom_Plane)::DownCast (aSurf);
if (!aGeomPlanes[aNbPlanes].IsNull())
{
aGeomPlanesLoc[aNbPlanes] = &aLocSurf[aSurfIter];
++aNbPlanes;
}
}
@@ -375,7 +377,8 @@ void StdSelect_BRepSelectionTool::ComputeSensitive (const TopoDS_Shape& theShape
{
const gp_Cone aCone = BRepAdaptor_Surface (*aFaces[aConIndex]).Cone();
const Standard_Real aRad1 = aCone.RefRadius();
const Standard_Real aHeight = aGeomPlanes[0]->Location().Distance (aGeomPlanes[1]->Location());
const Standard_Real aHeight = aGeomPlanes[0]->Location().Transformed (*aGeomPlanesLoc[0])
.Distance (aGeomPlanes[1]->Location().Transformed (*aGeomPlanesLoc[1]));
gp_Trsf aTrsf;
aTrsf.SetTransformation (aCone.Position(), gp_Ax3());
const Standard_Real aTriangleHeight = (aCone.SemiAngle() > 0.0)
@@ -398,7 +401,8 @@ void StdSelect_BRepSelectionTool::ComputeSensitive (const TopoDS_Shape& theShape
{
const gp_Cylinder aCyl = BRepAdaptor_Surface (*aFaces[aConIndex]).Cylinder();
const Standard_Real aRad = aCyl.Radius();
const Standard_Real aHeight = aGeomPlanes[0]->Location().Distance (aGeomPlanes[1]->Location());
const Standard_Real aHeight = aGeomPlanes[0]->Location().Transformed (*aGeomPlanesLoc[0])
.Distance (aGeomPlanes[1]->Location().Transformed (*aGeomPlanesLoc[1]));
gp_Trsf aTrsf;
aTrsf.SetTransformation (aCyl.Position(), gp_Ax3());
Handle(Select3D_SensitiveCylinder) aSensSCyl = new Select3D_SensitiveCylinder (theOwner, aRad, aRad, aHeight, aTrsf);
@@ -410,7 +414,7 @@ void StdSelect_BRepSelectionTool::ComputeSensitive (const TopoDS_Shape& theShape
for (Standard_Integer aShIndex = 1; aShIndex <= aSubfacesMap.Extent(); ++aShIndex)
{
ComputeSensitive (aSubfacesMap (aShIndex), theOwner,
ComputeSensitive (aSubfacesMap.FindKey (aShIndex), theOwner,
theSelection,
theDeflection, theDeviationAngle, theNbPOnEdge, theMaxParam, isAutoTriangulation);
}

View File

@@ -325,7 +325,7 @@ static int doTranslate (const XmlMNaming_Shape1& thePShape,
return 1;
theResult.TShape (theShapeSet.Shape(aShapeId).TShape());
theResult.Orientation (thePShape.Orientation());
theResult.Location (theShapeSet.Locations().Location (thePShape.LocId()));
theResult.Location (theShapeSet.Locations().Location (thePShape.LocId()), false);
return 0;
}

6
tests/bugs/xde/bug32784 Normal file
View File

@@ -0,0 +1,6 @@
puts "==========="
puts "0032784: BinXCAF fails to load documents containing the shapes with scaled/mirrored location"
puts "==========="
if [info exists D] {catch {Close D}}
XOpen [locate_data_file bug32784_mirrored.xbf] D

View File

@@ -1,5 +1,3 @@
puts "TODO OCC30286 ALL: Error : The length of result shape is 9589.21, expected 9547.11"
set viewname "vright"
set length 9547.11

View File

@@ -1,6 +1,3 @@
puts "TODO OCC30286 Windows: Error : The length of result shape is 2416.66, expected 2418.08"
puts "TODO OCC30286 Linux: Error : The length of result shape is 2414.48, expected 2418.08"
set viewname "vright"
set length 2418.08

View File

@@ -1,7 +1,5 @@
puts "TODO OCC30286 Linux: Error : The length of result shape is 3249.9, expected 3234.6"
set viewname "vright"
set length 3234.6
set length 3237.63
testreadstep [locate_data_file bug27341_570-DWLNL-40-08-L_131LANG_16VERSATZ_DIN.stp] a
COMPUTE_HLR $viewname $algotype

View File

@@ -0,0 +1,10 @@
puts "================================================"
puts "OCC32747: Exact HLR algorithm gives wrong result"
puts "================================================"
puts ""
set viewname "vfront"
set length 34.3597
restore [locate_data_file bug32747.brep] a
COMPUTE_HLR $viewname $algotype

6
tests/hlr/exact_hlr/end Normal file
View File

@@ -0,0 +1,6 @@
checkprops result -l ${length}
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
# to end a test script
puts "TEST COMPLETED"

View File

@@ -1,7 +1,11 @@
restore [locate_data_file bug25926_before_offset.brep] s
OFFSETSHAPE 50 {} $calcul $type
explode s so
offsetparameter 1e-7 c i r
offsetload s_1 50
offsetperform result
checkprops result -v 3.68672e+008
checkprops result -s 4.96128e+06 -v 3.68655e+08
checknbshapes result -shell 1
unifysamedom result_unif result
checknbshapes result_unif -wire 12 -face 12 -shell 1 -solid 1

View File

@@ -1,8 +1,10 @@
restore [locate_data_file bug25926_before_offset_trim1.brep] s
OFFSETSHAPE 50 {} $calcul $type
offsetparameter 1e-7 c i r
offsetload s 50
offsetperform result
checkprops result -v 3.61993e+007
checkprops result -s 696458
checkprops result -s 694900 -v 3.6175e+07
checknbshapes result -shell 1
unifysamedom result_unif result
checknbshapes result_unif -wire 9 -face 9 -shell 1 -solid 1

View File

@@ -7,7 +7,7 @@ restore [locate_data_file bug25926_offset_shape_trim3.brep] s
OFFSETSHAPE 12 {} $calcul $type
checkprops result -v 948181 -s 66208.6
checkprops result -v 948181 -s 66208.6 -deps 1.e-3
unifysamedom result_unif result
checknbshapes result_unif -shell 1 -face 14

View File

@@ -1,5 +1,3 @@
puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape"
restore [locate_data_file bug26917_dom-8092_trim3.brep] s
offsetparameter 1e-7 $calcul $type

View File

@@ -1,5 +1,3 @@
puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape"
restore [locate_data_file bug26917_dom-8092_trim4.brep] s
offsetparameter 1e-7 $calcul $type

View File

@@ -1,5 +1,3 @@
puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape"
restore [locate_data_file bug26917_dom-8092_simple.brep] s
offsetparameter 1e-7 $calcul $type

View File

@@ -7,7 +7,7 @@ restore [locate_data_file bug26917_25926_offset_shape_trim4.brep] s
OFFSETSHAPE 12 {} $calcul $type
checkprops result -v 643336 -s 45602.9
checkprops result -v 643336 -s 45602.9 -deps 1.e-3
unifysamedom result_unif result
checknbshapes result_unif -shell 1 -face 8

View File

@@ -1,6 +1,6 @@
puts "TODO OCC27414 ALL: Error: The command cannot be built"
puts "TODO OCC27414 ALL: Tcl Exception"
puts "TODO OCC27414 ALL: TEST INCOMPLETE"
puts "TODO OCC27414 ALL: Error : is WRONG because number of"
puts "TODO OCC27414 ALL: Error : The area of result shape is"
puts "TODO OCC27414 ALL: Error : The volume of result shape is"
restore [locate_data_file bug26917_dom-8092.t6c1_trim5_with_faces.brep] c

View File

@@ -4,9 +4,9 @@ offsetparameter 1e-7 c i r
offsetload s 8
offsetperform result
checkprops result -v 4.40128e+007 -s 1.81672e+006
checkprops result -s 1.81645e+06 -v 4.40127e+07
unifysamedom result_unif result
checknbshapes result_unif -edge 186 -face 64 -shell 1
checknbshapes result_unif -wire 62 -face 62 -shell 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,17 @@
puts "============================================================================================="
puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
puts "============================================================================================="
puts ""
restore [locate_data_file bug32333_Z4_trim.brep] s
offsetparameter 1e-7 c i r
offsetload s 9.5
offsetperform result
checkprops result -s 88948.9 -v 1.11587e+06
unifysamedom result_unif result
checknbshapes result_unif -wire 15 -face 15 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,31 @@
puts "TODO CR27414 ALL: Error: operation with offset value 7 has failed"
puts "TODO CR27414 ALL: Error: operation with offset value 8 has failed"
puts "TODO CR27414 ALL: Error: operation with offset value 9 has failed"
puts "TODO CR27414 ALL: Error: operation with offset value 10 has failed"
puts "TODO CR27414 ALL: Error: operation with offset value 11 has failed"
puts "TODO CR27414 ALL: Error: operation with offset value 12 has failed"
puts "TODO CR27414 ALL: Operations with following offset values have failed: 7 8 9 10 11 12"
puts "TODO CR27414 ALL: Error : The offset cannot be built"
puts "============================================================================================="
puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
puts "============================================================================================="
puts ""
# This is a simplified version of XZ7 case
restore [locate_data_file bug32333_178_trim4.brep] s
set ref_values { { 94323.2 1.42329e+06 14 14 } \
{ 98288.3 1.51959e+06 14 14 } \
{ 102311 1.61989e+06 14 14 } \
{ 106392 1.72423e+06 14 14 } \
{ 110531 1.83269e+06 14 14 } \
{ 114728 1.94532e+06 14 14 } }
perform_offset_increasing s 7 12 1 $ref_values
#copy r10 result
#copy r10_unif result_unif
#checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,7 +1,4 @@
puts "TODO CR32333 ALL: Error : The area of result shape is"
puts "TODO CR32333 ALL: Error : The command is not valid."
puts "TODO CR32333 ALL: Error : The volume of result shape is"
puts "TODO CR32333 ALL: Error : is WRONG because number of"
puts "TODO CR27414 ALL: Error : is WRONG because number of"
puts "============================================================================================="
puts "0032088: Modeling Algorithms - Empty result of offset operation in mode \"Complete\" join type \"Intersection\""
@@ -17,6 +14,6 @@ offsetperform result
checkprops result -s 3.1312e+06 -v 5.77267e+07
unifysamedom result_unif result
checknbshapes result_unif -wire 492 -face 492 -shell 1 -solid 1
checknbshapes result_unif -wire 491 -face 492 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,7 +1,3 @@
puts "TODO OCC32333 ALL: Error: The command cannot be built"
puts "TODO OCC32333 ALL: gives an empty result"
puts "TODO OCC32333 ALL: TEST INCOMPLETE"
puts "============================================================================================="
puts "0032088: Modeling Algorithms - Empty result of offset operation in mode \"Complete\" join type \"Intersection\""
puts "============================================================================================="

View File

@@ -0,0 +1,29 @@
puts "============================================================================================="
puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
puts "============================================================================================="
puts ""
restore [locate_data_file bug32333_ZU6_trim.brep] s
set ref_values { { 154279 1.16809e+06 31 31 } \
{ 159804 1.32512e+06 31 31 } \
{ 165387 1.48771e+06 31 31 } \
{ 171028 1.65592e+06 31 31 } \
{ 148419 1.82979e+06 29 29 } \
{ 132204 1.98042e+06 17 17 } \
{ 136267 2.11465e+06 17 17 } \
{ 125291 2.25298e+06 13 13 } \
{ 129494 2.38037e+06 13 13 } \
{ 133767 2.51199e+06 13 13 } \
{ 138109 2.64793e+06 13 13 } \
{ 142522 2.78824e+06 13 13 } \
{ 147004 2.93299e+06 13 13 } \
{ 151557 3.08227e+06 13 13 } \
{ 156179 3.23613e+06 13 13 } }
perform_offset_increasing s 1 15 1 $ref_values
copy r10 result
copy r10_unif result_unif
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,30 @@
puts "TODO CR27414 ALL: Error: number of wire entities in the result"
puts "TODO CR27414 ALL: Error: number of face entities in the result"
puts "TODO CR27414 ALL: Error: operation with offset value 9 has failed"
puts "TODO CR27414 ALL: Error: operation with offset value 10 has failed"
puts "TODO CR27414 ALL: Operations with following offset values have failed: 9 10"
puts "============================================================================================="
puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
puts "============================================================================================="
puts ""
restore [locate_data_file bug32333_172.brep] s
set ref_values { { 2.68545e+06 6.72361e+07 386 386 } \
{ 2.69691e+06 6.99355e+07 330 330 } \
{ 2.73363e+06 7.26508e+07 330 330 } \
{ 2.74228e+06 7.54028e+07 166 166 } \
{ 2.78873e+06 7.81683e+07 166 166 } \
{ 2.82923e+06 8.09803e+07 106 106 } \
{ 2.88058e+06 8.38352e+07 106 106 } \
{ 2.93204e+06 8.67414e+07 106 106 } \
{ 2.65427e+06 8.95363e+07 6 6 } \
{ 2.69318e+06 9.22106e+07 6 6 } }
perform_offset_increasing s 1 10 1 $ref_values
copy r5 result
copy r5_unif result_unif
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,30 @@
puts "TODO CR27414 ALL: Error: number of wire entities in the result"
puts "TODO CR27414 ALL: Error: number of face entities in the result"
puts "TODO CR27414 ALL: Error: operation with offset value 9 has failed"
puts "TODO CR27414 ALL: Error: operation with offset value 10 has failed"
puts "TODO CR27414 ALL: Operations with following offset values have failed: 9 10"
puts "============================================================================================="
puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
puts "============================================================================================="
puts ""
restore [locate_data_file bug32333_172_trim1.brep] s
set ref_values { { 171093 2.538e+06 42 42 } \
{ 169448 2.70883e+06 41 41 } \
{ 174262 2.88068e+06 41 41 } \
{ 176065 3.05738e+06 25 25 } \
{ 181589 3.2362e+06 25 25 } \
{ 185420 3.42058e+06 17 17 } \
{ 191400 3.60898e+06 17 17 } \
{ 197447 3.8034e+06 17 17 } \
{ 175027 3.98979e+06 11 11 } \
{ 179953 4.16727e+06 11 11 } }
perform_offset_increasing s 1 10 1 $ref_values
copy r5 result
copy r5_unif result_unif
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,27 @@
puts "TODO CR27414 ALL: Error: operation with offset value 9 has failed"
puts "TODO CR27414 ALL: Operations with following offset values have failed: 9"
puts "============================================================================================="
puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
puts "============================================================================================="
puts ""
restore [locate_data_file bug32333_172_trim2.brep] s
set ref_values { { 82542.8 820795 18 18 } \
{ 82089.5 903148 19 19 } \
{ 86737.5 987555 19 19 } \
{ 91176.7 1.07665e+06 15 15 } \
{ 95898.3 1.17018e+06 15 15 } \
{ 100690 1.26847e+06 15 15 } \
{ 105551 1.37158e+06 15 15 } \
{ 110483 1.47959e+06 15 15 } \
{ 98501.1 1.58422e+06 5 5 } \
{ 102414 1.68468e+06 5 5 } }
perform_offset_increasing s 1 10 1 $ref_values
copy r5 result
copy r5_unif result_unif
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,21 @@
puts "============================================================================================="
puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
puts "============================================================================================="
puts ""
restore [locate_data_file bug32333_178.brep] s
set ref_values { { 6.2988e+06 1.0009e+08 1590 1590 } \
{ 6.46295e+06 1.12852e+08 1556 1556 } \
{ 6.59935e+06 1.25914e+08 1585 1570 } \
{ 5.67319e+06 1.38166e+08 552 552 } \
{ 5.52249e+06 1.49358e+08 260 260 } \
{ 5.72672e+06 1.60607e+08 260 260 } \
{ 4.90877e+06 1.71755e+08 44 44 } }
perform_offset_increasing s 1 13 2 $ref_values
copy r5 result
copy r5_unif result_unif
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,37 @@
puts "TODO CR27414 ALL: Error: operation with offset value 7 has failed"
puts "TODO CR27414 ALL: Error: operation with offset value 8 has failed"
puts "TODO CR27414 ALL: Error: operation with offset value 9 has failed"
puts "TODO CR27414 ALL: Error: operation with offset value 10 has failed"
puts "TODO CR27414 ALL: Error: operation with offset value 11 has failed"
puts "TODO CR27414 ALL: Error: operation with offset value 12 has failed"
puts "TODO CR27414 ALL: Operations with following offset values have failed: 7 8 9 10 11 12"
puts "============================================================================================="
puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
puts "============================================================================================="
puts ""
restore [locate_data_file bug32333_178_trim1.brep] s
set ref_values { { 237838 3.74252e+06 61 61 } \
{ 241858 3.98236e+06 61 61 } \
{ 245948 4.22626e+06 59 59 } \
{ 250116 4.47428e+06 59 59 } \
{ 245191 4.72003e+06 60 60 } \
{ 236043 4.96659e+06 29 29 } \
{ 241534 5.20537e+06 25 25 } \
{ 245656 5.44968e+06 17 17 } \
{ 251925 5.69846e+06 17 17 } \
{ 258263 5.95355e+06 17 17 } \
{ 264668 6.21501e+06 17 17 } \
{ 271141 6.48291e+06 17 17 } \
{ 243904 6.74052e+06 9 9 } \
{ 249735 6.98734e+06 9 9 } \
{ 255633 7.24002e+06 9 9 } }
perform_offset_increasing s 1 15 1 $ref_values
copy r5 result
copy r5_unif result_unif
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,29 @@
puts "============================================================================================="
puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
puts "============================================================================================="
puts ""
restore [locate_data_file bug32333_178_trim2.brep] s
set ref_values { { 72863.6 1.02754e+06 24 24 } \
{ 75700.8 1.10182e+06 24 24 } \
{ 78584.1 1.17895e+06 24 24 } \
{ 81513.2 1.259e+06 24 24 } \
{ 84488.3 1.342e+06 24 24 } \
{ 87509.3 1.42799e+06 24 24 } \
{ 90576.3 1.51703e+06 24 24 } \
{ 91698.4 1.60916e+06 16 16 } \
{ 94791 1.7024e+06 16 16 } \
{ 97929.5 1.79876e+06 16 16 } \
{ 101114 1.89827e+06 16 16 } \
{ 104344 2.001e+06 16 16 } \
{ 107621 2.10698e+06 16 16 } \
{ 110943 2.21626e+06 16 16 } \
{ 114311 2.32888e+06 16 16 } }
perform_offset_increasing s 1 15 1 $ref_values
copy r5 result
copy r5_unif result_unif
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,17 @@
puts "============================================================================================="
puts "0032333: Modeling Algorithms - Empty(wrong) result of offset operation in mode \"Complete\" join type \"Intersection\""
puts "============================================================================================="
puts ""
restore [locate_data_file bug32333_178_trim3.brep] s
offsetparameter 1e-7 c i r
offsetload s 15
offsetperform result
checkprops result -s 117600 -v 2.73811e+06
unifysamedom result_unif result
checknbshapes result_unif -wire 7 -face 7 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@@ -1,7 +1,10 @@
restore [locate_data_file bug26917_M2_trim4.brep] s
OFFSETSHAPE 8 {} $calcul $type
offsetparameter 1e-7 c i r
offsetload s 8
offsetperform result
checkprops result -v 4.65244e+006
checkprops result -s 279365 -v 4.65244e+06
checknbshapes result -shell 1
unifysamedom result_unif result
checknbshapes result_unif -wire 72 -face 72 -shell 1 -solid 1

View File

@@ -1,10 +1,13 @@
puts "TODO CR27414 ALL: Error : The area of result shape is"
puts "TODO CR27414 ALL: Error : The volume of result shape is"
puts "TODO OCC27414 ALL: Error : is WRONG because number of"
puts "TODO OCC27414 ALL: Error : The area of result shape is"
puts "TODO OCC27414 ALL: Error : The volume of result shape is"
puts "TODO OCC27414 ALL: Error: bsection of the result and s is not equal to zero"
restore [locate_data_file bug26917_M2_trim22.brep] s
OFFSETSHAPE 8 {} $calcul $type
checkprops result -v 1.1318e+006 -s 69137.2
checkprops result -s 69299.9 -v 1.08094e+06 -deps 1.e-3
checknbshapes result -shell 1
unifysamedom result_unif result
checknbshapes result_unif -wire 19 -face 19 -shell 1 -solid 1

View File

@@ -1,11 +1,12 @@
puts "TODO OCC27414 ALL: Error: The command cannot be built"
puts "TODO OCC27414 ALL: gives an empty result"
puts "TODO OCC27414 ALL: TEST INCOMPLETE"
puts "TODO OCC27414 ALL: Error : is WRONG because number of"
puts "TODO OCC27414 ALL: Error : The area of result shape is"
puts "TODO OCC27414 ALL: Error : The volume of result shape is"
restore [locate_data_file bug26917_M2_trim35.brep] s
OFFSETSHAPE 8 {} $calcul $type
checkprops result -v 0
checkprops result -s 30085.9 -v 282977 -deps 1.e-3
checknbshapes result -shell 1
unifysamedom result_unif result
checknbshapes result_unif -wire 9 -face 9 -shell 1 -solid 1

View File

@@ -1,11 +1,12 @@
puts "TODO OCC27414 ALL: Error: The command cannot be built"
puts "TODO OCC27414 ALL: gives an empty result"
puts "TODO OCC27414 ALL: TEST INCOMPLETE"
puts "TODO OCC27414 ALL: Error : is WRONG because number of"
puts "TODO OCC27414 ALL: Error : The area of result shape is"
puts "TODO OCC27414 ALL: Error : The volume of result shape is"
restore [locate_data_file bug26917_M2_trim9.brep] s
OFFSETSHAPE 15 {} $calcul $type
checkprops result -s 0 -v 0
checkprops result -s 29576.6 -v 276693
checknbshapes result -shell 1
unifysamedom result_unif result
checknbshapes result_unif -wire 16 -face 16 -shell 1 -solid 1

View File

@@ -21,7 +21,7 @@ restore [locate_data_file bug31148_plate_split.brep] s
perform_offset_multi_with_ref r0_01 s 0 {6 10 14} {1 5 1} {464 244 26 26} 1; # BAD (null shape)
perform_offset_multi_with_ref r0_02 s 0 {9 11} {5 5} {448 244 24 23} 1; # BAD (filled part)
perform_offset_multi_with_ref r0_03 s 0 {6 9 11 14} {1 5 5 1} {464 268 36 35} 1; # BAD (mostly removed)
perform_offset_multi_with_ref r0_03 s 0 {6 9 11 14} {1 5 5 1} {464 268 36 35} 1; # BAD (internal part is filled)
perform_offset_multi_with_ref r0_04 s 0 {8 10 12} {5 5 5} {464 276 22 20} 1; # BAD (out of borders)
perform_offset_multi_with_ref r0_05 s 0 {6 8 10 12 14 } {1 5 5 5 1} {464 292 30 28} 1
perform_offset_multi_with_ref r0_06 s 0 {7 9 11 13} {1 3 3 1} {424 236 28 27} 1

View File

@@ -1,2 +0,0 @@
vinit View1 -height 400 -width 600
set subgroup "cone_cylinder"

View File

@@ -3,6 +3,9 @@ puts "0032281: Visualization - add Select3D_SensitiveCylinder"
puts "Tests depth value returned by Select3D_SensitiveCylinder"
puts "================================="
pload MODELING VISUALIZATION
vinit View1 -height 400 -width 600
pcylinder cyl 10 20
vdisplay cyl -dispmode 1
vfit

View File

@@ -3,6 +3,9 @@ puts "0032281: Visualization - add Select3D_SensitiveCylinder"
puts "Tests detecting Select3D_SensitiveCylinder"
puts "================================="
pload MODELING VISUALIZATION
vinit View1 -height 400 -width 600
pcylinder cyl 10 20
vdisplay cyl -dispmode 1
vfit

View File

@@ -3,6 +3,9 @@ puts "0032281: Visualization - add Select3D_SensitiveCylinder"
puts "Generating images based on detection of Select3D_SensitiveCylinder"
puts "================================="
pload MODELING VISUALIZATION
vinit View1 -height 400 -width 600
pcylinder cyl 10 20
vdisplay cyl -dispmode 1
vfit

View File

@@ -3,6 +3,9 @@ puts "0032281: Visualization - add Select3D_SensitiveCylinder"
puts "Tests polygon selection of Select3D_SensitiveCylinder"
puts "================================="
pload MODELING VISUALIZATION
vinit View1 -height 400 -width 600
pcylinder c1 10 20
pcone c2 10 0 20
pcone c3 10 5 10

View File

@@ -3,6 +3,9 @@ puts "0032281: Visualization - add Select3D_SensitiveCylinder"
puts "Tests rectangular selection of Select3D_SensitiveCylinder"
puts "================================="
pload MODELING VISUALIZATION
vinit View1 -height 400 -width 600
pcylinder c1 10 20
pcone c2 10 0 20
pcone c3 10 5 10

View File

@@ -3,6 +3,9 @@ puts "0032281: Visualization - add Select3D_SensitiveCylinder"
puts "Tests selection of Select3D_SensitiveCylinder"
puts "================================="
pload MODELING VISUALIZATION
vinit View1 -height 400 -width 600
pcone cone 10 0 20
vdisplay cone -dispmode 1
vfit

View File

@@ -3,6 +3,9 @@ puts "0032281: Visualization - add Select3D_SensitiveCylinder"
puts "Tests selection of Select3D_SensitiveCylinder"
puts "================================="
pload MODELING VISUALIZATION
vinit View1 -height 400 -width 600
pcylinder cyl 10 20
vdisplay cyl -dispmode 1
vfit

View File

@@ -3,6 +3,9 @@ puts "0032281: Visualization - add Select3D_SensitiveCylinder"
puts "Tests selection of Select3D_SensitiveCylinder"
puts "================================="
pload MODELING VISUALIZATION
vinit View1 -height 400 -width 600
pcone tr_cone 10 5 10
vdisplay tr_cone -dispmode 1
vfit

View File

@@ -0,0 +1,40 @@
puts "================================="
puts "0032652: Visualization - Select3D_SensitiveCylinder returns wrong 3D point on transformed shape"
puts "Check picking of transformed cone"
puts "================================="
pload MODELING VISUALIZATION
pcone c 10 5 10
fscale c 0 0 0 0.1
trotate c 0 0 0 1 1 0 25
ttranslate c 2500 3500 1000
vinit View1
# check Select3D_SensitiveTriangulation
vclear
vaxo
compound {*}[explode c Sh] cc
vdisplay -dispmode 1 cc
vfit
vselaxis 2500 3498 1001 0 1 0 -display a -showNormal
set aPntTris [vmoveto 200 200]
vpoint pp {*}$aPntTris
checkpoint aPntTris_p $aPntTris {2500.42 3499.54 1000.81} 0.1
if { ![string match "*Select3D_SensitiveTriangulation*" [vstate -entities]] } { puts "Error: triangulation should be detected" }
vfit
vdump $imagedir/${casename}_prs_tris.png
vseldump $imagedir/${casename}_selnorm_tris.png -type surfNormal
# check Select3D_SensitiveCylinder
vclear
vdisplay -dispmode 1 c
vfit
vselaxis 2500 3498 1001 0 1 0 -display a -showNormal
set aPntCone [vmoveto 200 200]
vpoint pp {*}$aPntCone
checkpoint aPntCone_p $aPntCone {2500.42 3499.54 1000.81} 0.1
if { ![string match "*Select3D_SensitiveCylinder*" [vstate -entities]] } { puts "Error: cylinder should be detected" }
vfit
vdump $imagedir/${casename}_prs_cyl.png
vseldump $imagedir/${casename}_selnorm_cyl.png -type surfNormal

View File

@@ -0,0 +1,40 @@
puts "================================="
puts "0032652: Visualization - Select3D_SensitiveCylinder returns wrong 3D point on transformed shape"
puts "Check picking of transformed cylinder"
puts "================================="
pload MODELING VISUALIZATION
pcylinder c 10 20
fscale c 0 0 0 0.1
trotate c 0 0 0 1 1 0 25
ttranslate c 2500 3500 1000
vinit View1
# check Select3D_SensitiveTriangulation
vclear
vaxo
compound {*}[explode c Sh] cc
vdisplay -dispmode 1 cc
vfit
vselaxis 2500 3498 1001 0 1 0 -display a -showNormal
set aPntTris [vmoveto 200 200]
vpoint pp {*}$aPntTris
checkpoint aPntTris_p $aPntTris {2500.9 3499.0 1001.6} 0.1
if { ![string match "*Select3D_SensitiveTriangulation*" [vstate -entities]] } { puts "Error: triangulation should be detected" }
vfit
vdump $imagedir/${casename}_prs_tris.png
vseldump $imagedir/${casename}_selnorm_tris.png -type surfNormal
# check Select3D_SensitiveCylinder
vclear
vdisplay -dispmode 1 c
vfit
vselaxis 2500 3498 1001 0 1 0 -display a -showNormal
set aPntCyl [vmoveto 200 200]
vpoint pp {*}$aPntCyl
checkpoint aPntCyl_p $aPntCyl {2500.9 3499.0 1001.6} 0.1
if { ![string match "*Select3D_SensitiveCylinder*" [vstate -entities]] } { puts "Error: cylinder should be detected" }
vfit
vdump $imagedir/${casename}_prs_cyl.png
vseldump $imagedir/${casename}_selnorm_cyl.png -type surfNormal

View File

@@ -1,2 +0,0 @@
vinit View1 -height 400 -width 600
set subgroup "sphere"

View File

@@ -3,6 +3,9 @@ puts "0032182: Visualization - add Select3D_SensitiveSphere"
puts "Tests depth value returned by Select3D_SenstiveSphere"
puts "================================="
pload MODELING VISUALIZATION
vinit View1 -height 400 -width 600
psphere s 1
vdisplay -dispMode 1 s
vfit

View File

@@ -3,6 +3,9 @@ puts "0032182: Visualization - add Select3D_SensitiveSphere"
puts "Tests detecting Select3D_SenstiveSphere"
puts "================================="
pload MODELING VISUALIZATION
vinit View1 -height 400 -width 600
psphere s 1
vdisplay -dispMode 1 s
vfit

View File

@@ -3,6 +3,9 @@ puts "000032366: Visualization, SelectMgr_ViewerSelector3d::ToPixMap() - add opt
puts "Generating images based on detection of Select3D_SenstiveSphere"
puts "================================="
pload MODELING VISUALIZATION
vinit View1 -height 400 -width 600
psphere s 1
vdisplay -dispMode 1 s
vfit

View File

@@ -3,6 +3,9 @@ puts "0032182: Visualization - add Select3D_SensitiveSphere"
puts "Tests polygon selection of Select3D_SenstiveSphere"
puts "================================="
pload MODELING VISUALIZATION
vinit View1 -height 400 -width 600
psphere s1 1
psphere s2 1
psphere s3 1

View File

@@ -3,6 +3,9 @@ puts "0032182: Visualization - add Select3D_SensitiveSphere"
puts "Tests rectangular selection of Select3D_SenstiveSphere"
puts "================================="
pload MODELING VISUALIZATION
vinit View1 -height 400 -width 600
psphere s1 1
psphere s2 1
psphere s3 1

View File

@@ -3,6 +3,9 @@ puts "0032182: Visualization - add Select3D_SensitiveSphere"
puts "Tests selection of Select3D_SenstiveSphere"
puts "================================="
pload MODELING VISUALIZATION
vinit View1 -height 400 -width 600
psphere s 1
vdisplay -dispMode 1 s
vfit

43
tests/vselect/sphere/trsf Normal file
View File

@@ -0,0 +1,43 @@
puts "================================="
puts "0032652: Visualization - Select3D_SensitiveCylinder returns wrong 3D point on transformed shape"
puts "Check picking of transformed sphere"
puts "================================="
pload MODELING VISUALIZATION
psphere s 10
fscale s 0 0 0 0.1
trotate s 0 0 0 1 1 0 25
ttranslate s 2500 3500 1000
vinit View1
vlight headlight -head 0
# check Select3D_SensitiveTriangulation
vclear
vaxo
tcopy s ss
incmesh ss 1.0
tclean ss -geom
vdisplay -dispmode 1 ss
vfit
vselaxis 2500 3498 1000 0 1 0 -display a -showNormal
set aPntTris [vmoveto 200 200]
vpoint pp {*}$aPntTris
checkpoint aPntTris_p $aPntTris {2500.54 3499.41 1000.6} 0.1
if { ![string match "*Select3D_SensitiveTriangulation*" [vstate -entities]] } { puts "Error: triangulation should be detected" }
vfit
vdump $imagedir/${casename}_prs_tris.png
vseldump $imagedir/${casename}_selnorm_tris.png -type surfNormal
# check Select3D_SensitiveSphere
vclear
vdisplay -dispmode 1 s
vfit
vselaxis 2500 3498 1000 0 1 0 -display a -showNormal
set aPntSph [vmoveto 200 200]
vpoint pp {*}$aPntSph
checkpoint aPntSph_p $aPntSph {2500.54 3499.41 1000.6} 0.1
if { ![string match "*Select3D_SensitiveSphere*" [vstate -entities]] } { puts "Error: sphere should be detected" }
vfit
vdump $imagedir/${casename}_prs_sph.png
vseldump $imagedir/${casename}_selnorm_sph.png -type surfNormal