mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
Compare commits
1 Commits
CR0_CI_740
...
CR0-Intera
Author | SHA1 | Date | |
---|---|---|---|
|
961713db52 |
@@ -97,9 +97,25 @@ namespace
|
|||||||
return aPoly;
|
return aPoly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Add new solid
|
||||||
|
virtual void AddSolid() Standard_OVERRIDE
|
||||||
|
{
|
||||||
|
Handle(Poly_Triangulation) aCurrentTri = GetTriangulation();
|
||||||
|
myTriangulationList.Append(aCurrentTri);
|
||||||
|
myNodes.Clear();
|
||||||
|
myTriangles.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
NCollection_Sequence<Handle(Poly_Triangulation)> GetTriangulationList()
|
||||||
|
{
|
||||||
|
return myTriangulationList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NCollection_Vector<gp_XYZ> myNodes;
|
NCollection_Vector<gp_XYZ> myNodes;
|
||||||
NCollection_Vector<Poly_Triangle> myTriangles;
|
NCollection_Vector<Poly_Triangle> myTriangles;
|
||||||
|
NCollection_Sequence<Handle(Poly_Triangulation)> myTriangulationList;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -118,6 +134,17 @@ Handle(Poly_Triangulation) RWStl::ReadFile (const Standard_CString theFile,
|
|||||||
return aReader.GetTriangulation();
|
return aReader.GetTriangulation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
//function : ReadFile
|
||||||
|
//purpose :
|
||||||
|
//=============================================================================
|
||||||
|
void RWStl::ReadFile(const Standard_CString theFile, NCollection_Sequence<Handle(Poly_Triangulation)>& theTriangList)
|
||||||
|
{
|
||||||
|
Reader aReader;
|
||||||
|
aReader.Read(theFile, Handle(Message_ProgressIndicator)(), true);
|
||||||
|
theTriangList = aReader.GetTriangulationList();
|
||||||
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
//function : ReadFile
|
//function : ReadFile
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@@ -50,6 +50,8 @@ public:
|
|||||||
Standard_EXPORT static Handle(Poly_Triangulation) ReadFile (const Standard_CString theFile,
|
Standard_EXPORT static Handle(Poly_Triangulation) ReadFile (const Standard_CString theFile,
|
||||||
const Handle(Message_ProgressIndicator)& aProgInd = Handle(Message_ProgressIndicator)());
|
const Handle(Message_ProgressIndicator)& aProgInd = Handle(Message_ProgressIndicator)());
|
||||||
|
|
||||||
|
Standard_EXPORT static void ReadFile(const Standard_CString theFile, NCollection_Sequence<Handle(Poly_Triangulation)>& theTriangList);
|
||||||
|
|
||||||
//! Read triangulation from a binary STL file
|
//! Read triangulation from a binary STL file
|
||||||
//! In case of error, returns Null handle.
|
//! In case of error, returns Null handle.
|
||||||
Standard_EXPORT static Handle(Poly_Triangulation) ReadBinary (const OSD_Path& thePath,
|
Standard_EXPORT static Handle(Poly_Triangulation) ReadBinary (const OSD_Path& thePath,
|
||||||
|
@@ -126,7 +126,8 @@ namespace
|
|||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
Standard_Boolean RWStl_Reader::Read (const char* theFile,
|
Standard_Boolean RWStl_Reader::Read (const char* theFile,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Handle(Message_ProgressIndicator)& theProgress,
|
||||||
|
bool IsMultiSolid)
|
||||||
{
|
{
|
||||||
std::filebuf aBuf;
|
std::filebuf aBuf;
|
||||||
OSD_OpenStream (aBuf, theFile, std::ios::in | std::ios::binary);
|
OSD_OpenStream (aBuf, theFile, std::ios::in | std::ios::binary);
|
||||||
@@ -165,6 +166,8 @@ Standard_Boolean RWStl_Reader::Read (const char* theFile,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
aStream >> std::ws; // skip any white spaces
|
aStream >> std::ws; // skip any white spaces
|
||||||
|
if (IsMultiSolid)
|
||||||
|
AddSolid();
|
||||||
}
|
}
|
||||||
return ! aStream.fail();
|
return ! aStream.fail();
|
||||||
}
|
}
|
||||||
|
@@ -39,7 +39,8 @@ public:
|
|||||||
//! Format is recognized automatically by analysis of the file header.
|
//! Format is recognized automatically by analysis of the file header.
|
||||||
//! Returns true if success, false on error or user break.
|
//! Returns true if success, false on error or user break.
|
||||||
Standard_EXPORT Standard_Boolean Read (const char* theFile,
|
Standard_EXPORT Standard_Boolean Read (const char* theFile,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress);
|
const Handle(Message_ProgressIndicator)& theProgress,
|
||||||
|
bool IsMultiSolid = false);
|
||||||
|
|
||||||
//! Guess whether the stream is an Ascii STL file, by analysis of the first bytes (~200).
|
//! Guess whether the stream is an Ascii STL file, by analysis of the first bytes (~200).
|
||||||
//! The function attempts to put back the read symbols to the stream which thus must support ungetc().
|
//! The function attempts to put back the read symbols to the stream which thus must support ungetc().
|
||||||
@@ -74,6 +75,8 @@ public:
|
|||||||
//! Should create new triangle built on specified nodes in the target model.
|
//! Should create new triangle built on specified nodes in the target model.
|
||||||
virtual void AddTriangle (Standard_Integer theN1, Standard_Integer theN2, Standard_Integer theN3) = 0;
|
virtual void AddTriangle (Standard_Integer theN1, Standard_Integer theN2, Standard_Integer theN3) = 0;
|
||||||
|
|
||||||
|
virtual void AddSolid() = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -25,14 +25,12 @@
|
|||||||
#include <BRepTools.hxx>
|
#include <BRepTools.hxx>
|
||||||
#include <BRepTopAdaptor_FClass2d.hxx>
|
#include <BRepTopAdaptor_FClass2d.hxx>
|
||||||
#include <Extrema_ExtPC2d.hxx>
|
#include <Extrema_ExtPC2d.hxx>
|
||||||
#include <GCPnts_AbscissaPoint.hxx>
|
|
||||||
#include <Geom2d_Curve.hxx>
|
#include <Geom2d_Curve.hxx>
|
||||||
#include <Geom2d_Line.hxx>
|
#include <Geom2d_Line.hxx>
|
||||||
#include <Geom2dAdaptor_Curve.hxx>
|
#include <Geom2dAdaptor_Curve.hxx>
|
||||||
#include <Geom2dInt_GInter.hxx>
|
#include <Geom2dInt_GInter.hxx>
|
||||||
#include <Geom_Curve.hxx>
|
#include <Geom_Curve.hxx>
|
||||||
#include <Geom_ElementarySurface.hxx>
|
#include <Geom_ElementarySurface.hxx>
|
||||||
#include <GeomAdaptor_Curve.hxx>
|
|
||||||
#include <GeomAdaptor_Surface.hxx>
|
#include <GeomAdaptor_Surface.hxx>
|
||||||
#include <gp_Dir2d.hxx>
|
#include <gp_Dir2d.hxx>
|
||||||
#include <gp_Lin2d.hxx>
|
#include <gp_Lin2d.hxx>
|
||||||
@@ -283,13 +281,6 @@ Standard_Boolean ShapeFix_ComposeShell::Status (const ShapeExtend_Status status)
|
|||||||
#define ITP_ENDSEG 32 // stop of tangential segment
|
#define ITP_ENDSEG 32 // stop of tangential segment
|
||||||
#define ITP_TANG 64 // tangential point
|
#define ITP_TANG 64 // tangential point
|
||||||
|
|
||||||
enum ShapeFix_MakeCut
|
|
||||||
{
|
|
||||||
ShapeFix_NoCut,
|
|
||||||
ShapeFix_CutHead,
|
|
||||||
ShapeFix_CutTail
|
|
||||||
};
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : PointLineDeviation
|
//function : PointLineDeviation
|
||||||
//purpose : auxilary
|
//purpose : auxilary
|
||||||
@@ -818,7 +809,6 @@ static Standard_Real GetGridResolution(const Handle(TColStd_HArray1OfReal) Split
|
|||||||
ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wire,
|
ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wire,
|
||||||
TColStd_SequenceOfInteger& indexes,
|
TColStd_SequenceOfInteger& indexes,
|
||||||
const TColStd_SequenceOfReal& values,
|
const TColStd_SequenceOfReal& values,
|
||||||
const TopTools_MapOfShape& theVerts,
|
|
||||||
TopTools_SequenceOfShape& vertices,
|
TopTools_SequenceOfShape& vertices,
|
||||||
const TColStd_SequenceOfInteger &SegmentCodes,
|
const TColStd_SequenceOfInteger &SegmentCodes,
|
||||||
const Standard_Boolean isCutByU,
|
const Standard_Boolean isCutByU,
|
||||||
@@ -832,7 +822,6 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
ShapeAnalysis_Edge sae;
|
ShapeAnalysis_Edge sae;
|
||||||
Standard_Integer start = 1;
|
Standard_Integer start = 1;
|
||||||
TopAbs_Orientation anWireOrient = wire.Orientation();
|
TopAbs_Orientation anWireOrient = wire.Orientation();
|
||||||
Standard_Integer aLastSplitted = 0;
|
|
||||||
gp_Trsf T;
|
gp_Trsf T;
|
||||||
if ( ! myLoc.IsIdentity() ) T = myLoc.Inverted().Transformation();
|
if ( ! myLoc.IsIdentity() ) T = myLoc.Inverted().Transformation();
|
||||||
|
|
||||||
@@ -848,7 +837,6 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
std::cout << "Error: ShapeFix_ComposeShell::SplitWire: edge dismissed" << std::endl;
|
std::cout << "Error: ShapeFix_ComposeShell::SplitWire: edge dismissed" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
i--;
|
i--;
|
||||||
aLastSplitted = 0;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -867,7 +855,6 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
result.AddEdge ( 0, edge, iumin, iumax, ivmin, ivmax );
|
result.AddEdge ( 0, edge, iumin, iumax, ivmin, ivmax );
|
||||||
if(code!=0 || wire.Orientation()!=TopAbs_EXTERNAL) // pdn 0 code handling for extertnal wires
|
if(code!=0 || wire.Orientation()!=TopAbs_EXTERNAL) // pdn 0 code handling for extertnal wires
|
||||||
DefinePatch ( result, code, isCutByU, cutIndex );
|
DefinePatch ( result, code, isCutByU, cutIndex );
|
||||||
aLastSplitted = 0;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//find non-manifold vertices on edge
|
//find non-manifold vertices on edge
|
||||||
@@ -961,14 +948,11 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
Standard_Integer NbEdgesStart = result.NbEdges();
|
Standard_Integer NbEdgesStart = result.NbEdges();
|
||||||
Standard_Boolean splitted = Standard_False;
|
Standard_Boolean splitted = Standard_False;
|
||||||
Standard_Real currPar=lastPar; //SK
|
Standard_Real currPar=lastPar; //SK
|
||||||
Standard_Integer aCurSplitted = 0;
|
|
||||||
for ( Standard_Integer j = start; j <= stop; prevPar = currPar, j++ ) {
|
for ( Standard_Integer j = start; j <= stop; prevPar = currPar, j++ ) {
|
||||||
if ( ! splitted && j >= stop ) {// no splitting at all
|
if ( ! splitted && j >= stop ) {// no splitting at all
|
||||||
// code = SegmentCodes ( j >1 ? j-1 : SegmentCodes.Length() ); // classification code
|
// code = SegmentCodes ( j >1 ? j-1 : SegmentCodes.Length() ); // classification code
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ShapeFix_MakeCut aCutPart = ShapeFix_NoCut;
|
|
||||||
Standard_Boolean isCutChecked = Standard_False;
|
|
||||||
currPar = ( j < stop ? values.Value(j) : lastPar );
|
currPar = ( j < stop ? values.Value(j) : lastPar );
|
||||||
//fix for case when pcurve is periodic and first parameter of edge is more than 2P
|
//fix for case when pcurve is periodic and first parameter of edge is more than 2P
|
||||||
//method ShapeBuild_Edge::CopyRanges shift pcurve to range 0-2P and parameters of cutting
|
//method ShapeBuild_Edge::CopyRanges shift pcurve to range 0-2P and parameters of cutting
|
||||||
@@ -1001,82 +985,50 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
currPnt = myGrid->Value ( currPnt2d );
|
currPnt = myGrid->Value ( currPnt2d );
|
||||||
if ( currPnt.Distance ( lastVPnt ) <= lastVTol &&
|
if ( currPnt.Distance ( lastVPnt ) <= lastVTol &&
|
||||||
lastPnt.Distance ( currPnt ) <= tol &&
|
lastPnt.Distance ( currPnt ) <= tol &&
|
||||||
// Tolerance is increased to prevent degenerated cuts in cases where all vertex
|
|
||||||
// tolerance is covered by distance of the edge curve from vertex point.
|
|
||||||
// Doubled to prevent edge being fully covered by its vertices tolerance (invalid edge).
|
|
||||||
CheckByCurve3d ( lastVPnt, c3d, f3d+(currPar-firstPar)*(l3d-f3d)/span2d,
|
CheckByCurve3d ( lastVPnt, c3d, f3d+(currPar-firstPar)*(l3d-f3d)/span2d,
|
||||||
T, lastVTol + 2 * Precision::Confusion() ) &&
|
T, lastVTol ) &&
|
||||||
lastPnt.Distance ( myGrid->Value ( C2d->Value(0.5*(currPar+lastPar)) ) ) <= tol )
|
lastPnt.Distance ( myGrid->Value ( C2d->Value(0.5*(currPar+lastPar)) ) ) <= tol ) {
|
||||||
{
|
V = lastV;
|
||||||
if (theVerts.Contains(lastV))
|
Standard_Real uRes = myUResolution;
|
||||||
{
|
Standard_Real vRes = myVResolution;
|
||||||
GeomAdaptor_Curve AC(c3d, currPar, (edge.Orientation() == TopAbs_REVERSED) ? firstPar : lastPar);
|
if(isCutByU) {
|
||||||
Standard_Real L = GCPnts_AbscissaPoint::Length(AC, Precision::Confusion());
|
Standard_Real gridRes = GetGridResolution(myGrid->UJointValues(),cutIndex)/tol;
|
||||||
if (L < BRep_Tool::Tolerance(lastV))
|
uRes = Min(myUResolution,gridRes);
|
||||||
aCutPart = ShapeFix_CutTail;
|
|
||||||
isCutChecked = Standard_True;
|
|
||||||
}
|
}
|
||||||
if (aCutPart == ShapeFix_NoCut)
|
else {
|
||||||
{
|
Standard_Real gridRes = GetGridResolution(myGrid->VJointValues(),cutIndex)/tol;
|
||||||
V = lastV;
|
vRes = Min(myVResolution,gridRes);
|
||||||
Standard_Real uRes = myUResolution;
|
|
||||||
Standard_Real vRes = myVResolution;
|
|
||||||
if (isCutByU) {
|
|
||||||
Standard_Real gridRes = GetGridResolution(myGrid->UJointValues(), cutIndex) / tol;
|
|
||||||
uRes = Min(myUResolution, gridRes);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Standard_Real gridRes = GetGridResolution(myGrid->VJointValues(), cutIndex) / tol;
|
|
||||||
vRes = Min(myVResolution, gridRes);
|
|
||||||
}
|
|
||||||
if (IsCoincided(lastPnt2d, currPnt2d, uRes, vRes, tol) &&
|
|
||||||
IsCoincided(lastPnt2d, C2d->Value(0.5*(currPar + lastPar)), uRes, vRes, tol))
|
|
||||||
{
|
|
||||||
doCut = Standard_False;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if ( IsCoincided ( lastPnt2d, currPnt2d, uRes, vRes, tol ) &&
|
||||||
|
IsCoincided ( lastPnt2d, C2d->Value(0.5*(currPar+lastPar)), uRes, vRes, tol ) )
|
||||||
|
doCut = Standard_False;
|
||||||
}
|
}
|
||||||
else if ( currPnt.Distance ( prevVPnt ) <= prevVTol &&
|
else if ( currPnt.Distance ( prevVPnt ) <= prevVTol &&
|
||||||
prevPnt.Distance ( currPnt ) <= tol &&
|
prevPnt.Distance ( currPnt ) <= tol &&
|
||||||
// Tolerance is increased to prevent degenerated cuts in cases where all vertex
|
CheckByCurve3d ( prevVPnt, c3d, f3d+(currPar-firstPar)*(l3d-f3d)/span2d,
|
||||||
// tolerance is covered by distance of the edge curve from vertex point.
|
T, prevVTol ) &&
|
||||||
// Doubled to prevent edge being fully covered by its vertices tolerance (invalid edge).
|
prevPnt.Distance ( myGrid->Value ( C2d->Value(0.5*(currPar+prevPar)) ) ) <= tol ) {
|
||||||
CheckByCurve3d ( prevVPnt, c3d, f3d + (currPar - firstPar)*(l3d - f3d) / span2d,
|
V = prevV;
|
||||||
T, prevVTol + 2 * Precision::Confusion()) &&
|
Standard_Real uRes = myUResolution;
|
||||||
prevPnt.Distance ( myGrid->Value ( C2d->Value(0.5*(currPar + prevPar)) ) ) <= tol )
|
Standard_Real vRes = myVResolution;
|
||||||
{
|
if(isCutByU) {
|
||||||
if (theVerts.Contains(prevV))
|
Standard_Real gridRes = GetGridResolution(myGrid->UJointValues(),cutIndex)/tol;
|
||||||
{
|
uRes = Min(myUResolution,gridRes);
|
||||||
GeomAdaptor_Curve AC(c3d, (edge.Orientation() == TopAbs_REVERSED) ? lastPar : firstPar, currPar);
|
|
||||||
Standard_Real L = GCPnts_AbscissaPoint::Length(AC, Precision::Confusion());
|
|
||||||
if (L < BRep_Tool::Tolerance(prevV))
|
|
||||||
aCutPart = ShapeFix_CutHead;
|
|
||||||
isCutChecked = Standard_True;
|
|
||||||
}
|
}
|
||||||
if (aCutPart == ShapeFix_NoCut)
|
else {
|
||||||
{
|
Standard_Real gridRes = GetGridResolution(myGrid->VJointValues(),cutIndex)/tol;
|
||||||
V = prevV;
|
vRes = Min(myVResolution,gridRes);
|
||||||
Standard_Real uRes = myUResolution;
|
}
|
||||||
Standard_Real vRes = myVResolution;
|
if ( IsCoincided ( prevPnt2d, currPnt2d, uRes, vRes, tol ) &&
|
||||||
if (isCutByU) {
|
IsCoincided ( prevPnt2d, C2d->Value(0.5*(currPar+prevPar)), uRes, vRes, tol ) ) {
|
||||||
Standard_Real gridRes = GetGridResolution(myGrid->UJointValues(), cutIndex) / tol;
|
vertices.Append ( prevV );
|
||||||
uRes = Min(myUResolution, gridRes);
|
code = SegmentCodes ( j ); // classification code - update for next segment
|
||||||
}
|
continue; // no splitting at this point, go to next one
|
||||||
else {
|
|
||||||
Standard_Real gridRes = GetGridResolution(myGrid->VJointValues(), cutIndex) / tol;
|
|
||||||
vRes = Min(myVResolution, gridRes);
|
|
||||||
}
|
|
||||||
if (IsCoincided(prevPnt2d, currPnt2d, uRes, vRes, tol) &&
|
|
||||||
IsCoincided(prevPnt2d, C2d->Value(0.5*(currPar + prevPar)), uRes, vRes, tol)) {
|
|
||||||
vertices.Append(prevV);
|
|
||||||
code = SegmentCodes(j); // classification code - update for next segment
|
|
||||||
continue; // no splitting at this point, go to next one
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//:abv 28.05.02: OCC320 Sample_2: if maxtol = 1e-7, the vertex tolerance
|
//:abv 28.05.02: OCC320 Sample_2: if maxtol = 1e-7, the vertex tolerance
|
||||||
// is actually ignored - protect against new vertex on degenerated edge
|
// is actually ignored - protect against new vertex on degenerated edge
|
||||||
else if (BRep_Tool::Degenerated(edge) && prevV.IsSame(lastV)) {
|
else if ( BRep_Tool::Degenerated(edge) && prevV.IsSame(lastV) ) {
|
||||||
V = prevV;
|
V = prevV;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1087,40 +1039,10 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
if ( V.IsNull() ) {
|
if ( V.IsNull() ) {
|
||||||
B.MakeVertex ( V, currPnt.Transformed(myLoc.Transformation()), tolEdge );
|
B.MakeVertex ( V, currPnt.Transformed(myLoc.Transformation()), tolEdge );
|
||||||
vertices.Append ( V );
|
vertices.Append ( V );
|
||||||
if (!isCutChecked)
|
|
||||||
{
|
|
||||||
Standard_Real aVTol;
|
|
||||||
if (theVerts.Contains(prevV))
|
|
||||||
{
|
|
||||||
aVTol = BRep_Tool::Tolerance(prevV);
|
|
||||||
if (currPnt.SquareDistance(prevVPnt) < aVTol * aVTol)
|
|
||||||
{
|
|
||||||
GeomAdaptor_Curve AC(c3d, (edge.Orientation() == TopAbs_REVERSED) ? lastPar : firstPar, currPar);
|
|
||||||
Standard_Real L = GCPnts_AbscissaPoint::Length(AC, Precision::Confusion());
|
|
||||||
if (L < aVTol)
|
|
||||||
aCutPart = ShapeFix_CutHead;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (theVerts.Contains(lastV))
|
|
||||||
{
|
|
||||||
aVTol = BRep_Tool::Tolerance(lastV);
|
|
||||||
if (currPnt.SquareDistance(lastVPnt) < aVTol * aVTol)
|
|
||||||
{
|
|
||||||
GeomAdaptor_Curve AC(c3d, currPar, (edge.Orientation() == TopAbs_REVERSED) ? firstPar : lastPar);
|
|
||||||
Standard_Real L = GCPnts_AbscissaPoint::Length(AC, Precision::Confusion());
|
|
||||||
if (L < aVTol)
|
|
||||||
aCutPart = ShapeFix_CutTail;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// else adjusted to end, fill all resting vertices
|
// else adjusted to end, fill all resting vertices
|
||||||
else if ( ! doCut ) {
|
else if ( ! doCut ) {
|
||||||
for (; j < stop; j++)
|
for ( ; j < stop; j++ ) vertices.Append ( lastV );
|
||||||
{
|
|
||||||
vertices.Append(lastV);
|
|
||||||
aCurSplitted++;
|
|
||||||
}
|
|
||||||
if ( ! splitted ) break; // no splitting at all
|
if ( ! splitted ) break; // no splitting at all
|
||||||
currPar = lastPar;
|
currPar = lastPar;
|
||||||
}
|
}
|
||||||
@@ -1210,21 +1132,8 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
code = ( ( isCutByU == (j == 1) ) ? 1 : 2 );
|
code = ( ( isCutByU == (j == 1) ) ? 1 : 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aCutPart == ShapeFix_CutHead)
|
result.AddEdge ( 0, newEdge, iumin, iumax, ivmin, ivmax );
|
||||||
{
|
DefinePatch ( result, code, isCutByU, cutIndex );
|
||||||
V.Orientation(TopAbs_FORWARD);
|
|
||||||
Context()->Replace(prevV, V);
|
|
||||||
// also replce this vertice in the sequence
|
|
||||||
for (Standard_Integer iV = 1; aLastSplitted > 0; aLastSplitted--, iV++)
|
|
||||||
{
|
|
||||||
vertices.ChangeValue(vertices.Length() - iV) = V;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result.AddEdge(0, newEdge, iumin, iumax, ivmin, ivmax);
|
|
||||||
DefinePatch(result, code, isCutByU, cutIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Changing prev parameters
|
// Changing prev parameters
|
||||||
prevV = V;
|
prevV = V;
|
||||||
@@ -1232,16 +1141,8 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
|
|||||||
prevVPnt = BRep_Tool::Pnt ( V );
|
prevVPnt = BRep_Tool::Pnt ( V );
|
||||||
prevPnt = currPnt;
|
prevPnt = currPnt;
|
||||||
prevPnt2d = currPnt2d;
|
prevPnt2d = currPnt2d;
|
||||||
|
|
||||||
if (aCutPart == ShapeFix_CutTail)
|
|
||||||
{
|
|
||||||
Context()->Replace(lastV, V);
|
|
||||||
for (; j + 1 < stop; j++) vertices.Append(lastV);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
start = stop;
|
start = stop;
|
||||||
aLastSplitted = aCurSplitted;
|
|
||||||
|
|
||||||
if ( splitted ) {
|
if ( splitted ) {
|
||||||
// record replacement in context
|
// record replacement in context
|
||||||
@@ -1302,8 +1203,6 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire,
|
|||||||
TColStd_SequenceOfReal IntEdgePar; // parameter of intersection point on edge
|
TColStd_SequenceOfReal IntEdgePar; // parameter of intersection point on edge
|
||||||
TColStd_SequenceOfReal IntLinePar; // parameter of intersection point on line
|
TColStd_SequenceOfReal IntLinePar; // parameter of intersection point on line
|
||||||
|
|
||||||
TopTools_MapOfShape exactVertices; // vertices that line passes through
|
|
||||||
|
|
||||||
Standard_Boolean isnonmanifold = (wire.Orientation() == TopAbs_INTERNAL);
|
Standard_Boolean isnonmanifold = (wire.Orientation() == TopAbs_INTERNAL);
|
||||||
//gka correction for non-manifold vertices SAMTECH
|
//gka correction for non-manifold vertices SAMTECH
|
||||||
if(wire.IsVertex()) {
|
if(wire.IsVertex()) {
|
||||||
@@ -1420,7 +1319,6 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire,
|
|||||||
IntLinePar.Append ( ParamPointsOnLine ( pos, prevPos, line ) ); // !! - maybe compute exactly ?
|
IntLinePar.Append ( ParamPointsOnLine ( pos, prevPos, line ) ); // !! - maybe compute exactly ?
|
||||||
IntEdgePar.Append ( isreversed ? l : f );
|
IntEdgePar.Append ( isreversed ? l : f );
|
||||||
IntEdgeInd.Append ( iedge );
|
IntEdgeInd.Append ( iedge );
|
||||||
exactVertices.Add (sae.FirstVertex(E));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1499,7 +1397,6 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire,
|
|||||||
IntLinePar.Append ( ParamPointsOnLine ( pos, firstPos, line ) );
|
IntLinePar.Append ( ParamPointsOnLine ( pos, firstPos, line ) );
|
||||||
IntEdgePar.Append ( isreversed ? f : l );
|
IntEdgePar.Append ( isreversed ? f : l );
|
||||||
IntEdgeInd.Append ( iedge );
|
IntEdgeInd.Append ( iedge );
|
||||||
exactVertices.Add (sae.LastVertex(E));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1637,7 +1534,7 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire,
|
|||||||
//=======================================
|
//=======================================
|
||||||
// Split edges in the wire by intersection points and fill vertices array
|
// Split edges in the wire by intersection points and fill vertices array
|
||||||
TopTools_SequenceOfShape IntVertices;
|
TopTools_SequenceOfShape IntVertices;
|
||||||
wire = SplitWire ( wire, IntEdgeInd, IntEdgePar, exactVertices, IntVertices,
|
wire = SplitWire ( wire, IntEdgeInd, IntEdgePar, IntVertices,
|
||||||
aNewSegCodes, isCutByU, cutIndex );
|
aNewSegCodes, isCutByU, cutIndex );
|
||||||
|
|
||||||
// add all data to input arrays
|
// add all data to input arrays
|
||||||
@@ -1683,8 +1580,7 @@ void ShapeFix_ComposeShell::SplitByLine (ShapeFix_SequenceOfWireSegment &wires,
|
|||||||
|
|
||||||
// merge null-length tangential segments into one-point tangencies or intersections
|
// merge null-length tangential segments into one-point tangencies or intersections
|
||||||
for ( i = 1; i < SplitLinePar.Length(); i++ ) {
|
for ( i = 1; i < SplitLinePar.Length(); i++ ) {
|
||||||
Standard_Boolean isSameVertex = SplitLineVertex(i).IsSame(SplitLineVertex(i + 1));
|
if ( Abs ( SplitLinePar(i+1) - SplitLinePar(i) ) > ::Precision::PConfusion() && !SplitLineVertex(i).IsSame(SplitLineVertex(i+1)) ) continue;
|
||||||
if ( Abs ( SplitLinePar(i+1) - SplitLinePar(i) ) > ::Precision::PConfusion() && !isSameVertex) continue;
|
|
||||||
if ( ( SplitLineCode(i) & ITP_ENDSEG &&
|
if ( ( SplitLineCode(i) & ITP_ENDSEG &&
|
||||||
SplitLineCode(i+1) & ITP_BEGSEG ) ||
|
SplitLineCode(i+1) & ITP_BEGSEG ) ||
|
||||||
( SplitLineCode(i) & ITP_BEGSEG &&
|
( SplitLineCode(i) & ITP_BEGSEG &&
|
||||||
@@ -1695,17 +1591,6 @@ void ShapeFix_ComposeShell::SplitByLine (ShapeFix_SequenceOfWireSegment &wires,
|
|||||||
SplitLineCode.Remove(i+1);
|
SplitLineCode.Remove(i+1);
|
||||||
SplitLineVertex.Remove(i+1);
|
SplitLineVertex.Remove(i+1);
|
||||||
}
|
}
|
||||||
else if (isSameVertex &&
|
|
||||||
((SplitLineCode (i) & ITP_TANG &&
|
|
||||||
SplitLineCode (i + 1) & ITP_INTER) ||
|
|
||||||
(SplitLineCode (i) & ITP_INTER &&
|
|
||||||
SplitLineCode (i + 1) & ITP_TANG)))
|
|
||||||
{
|
|
||||||
SplitLineCode.SetValue(i, IOR_BOTH | ITP_INTER );
|
|
||||||
SplitLinePar.Remove(i + 1);
|
|
||||||
SplitLineCode.Remove(i + 1);
|
|
||||||
SplitLineVertex.Remove(i + 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// go along line, split it by intersection points and create edges
|
// go along line, split it by intersection points and create edges
|
||||||
|
@@ -33,7 +33,6 @@
|
|||||||
#include <TColStd_SequenceOfInteger.hxx>
|
#include <TColStd_SequenceOfInteger.hxx>
|
||||||
#include <TColStd_SequenceOfReal.hxx>
|
#include <TColStd_SequenceOfReal.hxx>
|
||||||
#include <TopTools_SequenceOfShape.hxx>
|
#include <TopTools_SequenceOfShape.hxx>
|
||||||
#include <TopTools_MapOfShape.hxx>
|
|
||||||
class ShapeExtend_CompositeSurface;
|
class ShapeExtend_CompositeSurface;
|
||||||
class ShapeAnalysis_TransferParameters;
|
class ShapeAnalysis_TransferParameters;
|
||||||
class ShapeExtend_WireData;
|
class ShapeExtend_WireData;
|
||||||
@@ -99,10 +98,7 @@ public:
|
|||||||
//! Here face defines both set of wires and way of getting
|
//! Here face defines both set of wires and way of getting
|
||||||
//! pcurves. Precision is used (together with tolerance of edges)
|
//! pcurves. Precision is used (together with tolerance of edges)
|
||||||
//! for handling subtle cases, such as tangential intersections.
|
//! for handling subtle cases, such as tangential intersections.
|
||||||
Standard_EXPORT void Init (const Handle(ShapeExtend_CompositeSurface)& Grid,
|
Standard_EXPORT void Init (const Handle(ShapeExtend_CompositeSurface)& Grid, const TopLoc_Location& L, const TopoDS_Face& Face, const Standard_Real Prec);
|
||||||
const TopLoc_Location& L,
|
|
||||||
const TopoDS_Face& Face,
|
|
||||||
const Standard_Real Prec);
|
|
||||||
|
|
||||||
//! Returns (modifiable) flag for special 'closed'
|
//! Returns (modifiable) flag for special 'closed'
|
||||||
//! mode which forces ComposeShell to consider
|
//! mode which forces ComposeShell to consider
|
||||||
@@ -143,8 +139,7 @@ public:
|
|||||||
//! and all pcurves on the initial (pseudo)face are reassigned to
|
//! and all pcurves on the initial (pseudo)face are reassigned to
|
||||||
//! that surface. If several wires are one inside another, single
|
//! that surface. If several wires are one inside another, single
|
||||||
//! face is created.
|
//! face is created.
|
||||||
Standard_EXPORT void DispatchWires (TopTools_SequenceOfShape& faces,
|
Standard_EXPORT void DispatchWires (TopTools_SequenceOfShape& faces, ShapeFix_SequenceOfWireSegment& wires) const;
|
||||||
ShapeFix_SequenceOfWireSegment& wires) const;
|
|
||||||
|
|
||||||
//! Sets tool for transfer parameters from 3d to 2d and vice versa.
|
//! Sets tool for transfer parameters from 3d to 2d and vice versa.
|
||||||
Standard_EXPORT void SetTransferParamTool (const Handle(ShapeAnalysis_TransferParameters)& TransferParam);
|
Standard_EXPORT void SetTransferParamTool (const Handle(ShapeAnalysis_TransferParameters)& TransferParam);
|
||||||
@@ -170,13 +165,7 @@ protected:
|
|||||||
//! between two intersections: tells if segment is on left or right side
|
//! between two intersections: tells if segment is on left or right side
|
||||||
//! of cutting line, or tangent to it (by several points recomputed to 3d,
|
//! of cutting line, or tangent to it (by several points recomputed to 3d,
|
||||||
//! distance is compared with tolerance of corresponding edge).
|
//! distance is compared with tolerance of corresponding edge).
|
||||||
Standard_EXPORT Standard_Integer ComputeCode (const Handle(ShapeExtend_WireData)& wire,
|
Standard_EXPORT Standard_Integer ComputeCode (const Handle(ShapeExtend_WireData)& wire, const gp_Lin2d& line, const Standard_Integer begInd, const Standard_Integer endInd, const Standard_Real begPar, const Standard_Real endPar, const Standard_Boolean IsInternal = Standard_False);
|
||||||
const gp_Lin2d& line,
|
|
||||||
const Standard_Integer begInd,
|
|
||||||
const Standard_Integer endInd,
|
|
||||||
const Standard_Real begPar,
|
|
||||||
const Standard_Real endPar,
|
|
||||||
const Standard_Boolean IsInternal = Standard_False);
|
|
||||||
|
|
||||||
//! Splits edges in the wire by given indices of edges and
|
//! Splits edges in the wire by given indices of edges and
|
||||||
//! parameters on them. Returns resulting wire and vertices
|
//! parameters on them. Returns resulting wire and vertices
|
||||||
@@ -189,14 +178,7 @@ protected:
|
|||||||
//! NOTE: If edge is splitted, it is replaced by wire, and
|
//! NOTE: If edge is splitted, it is replaced by wire, and
|
||||||
//! order of edges in the wire corresponds to FORWARD orientation
|
//! order of edges in the wire corresponds to FORWARD orientation
|
||||||
//! of the edge.
|
//! of the edge.
|
||||||
Standard_EXPORT ShapeFix_WireSegment SplitWire (ShapeFix_WireSegment& wire,
|
Standard_EXPORT ShapeFix_WireSegment SplitWire (ShapeFix_WireSegment& wire, TColStd_SequenceOfInteger& indexes, const TColStd_SequenceOfReal& values, TopTools_SequenceOfShape& vertices, const TColStd_SequenceOfInteger& segcodes, const Standard_Boolean cutbyu, const Standard_Integer cutindex);
|
||||||
TColStd_SequenceOfInteger& indexes,
|
|
||||||
const TColStd_SequenceOfReal& values,
|
|
||||||
const TopTools_MapOfShape& theVerts,
|
|
||||||
TopTools_SequenceOfShape& vertices,
|
|
||||||
const TColStd_SequenceOfInteger& segcodes,
|
|
||||||
const Standard_Boolean cutbyu,
|
|
||||||
const Standard_Integer cutindex);
|
|
||||||
|
|
||||||
//! Split edges in the wire by cutting line.
|
//! Split edges in the wire by cutting line.
|
||||||
//! Wires with FORWARD or REVERSED orientation are considered
|
//! Wires with FORWARD or REVERSED orientation are considered
|
||||||
@@ -209,13 +191,7 @@ protected:
|
|||||||
//! Method fills sequences of parameters of intersection points
|
//! Method fills sequences of parameters of intersection points
|
||||||
//! of cutting line with all edges, their types, and corresponding
|
//! of cutting line with all edges, their types, and corresponding
|
||||||
//! vertices (including ones created during splitting edges).
|
//! vertices (including ones created during splitting edges).
|
||||||
Standard_EXPORT Standard_Boolean SplitByLine (ShapeFix_WireSegment& wire,
|
Standard_EXPORT Standard_Boolean SplitByLine (ShapeFix_WireSegment& wire, const gp_Lin2d& line, const Standard_Boolean cutbyu, const Standard_Integer cutindex, TColStd_SequenceOfReal& SplitLinePar, TColStd_SequenceOfInteger& SplitLineCode, TopTools_SequenceOfShape& SplitLineVertex);
|
||||||
const gp_Lin2d& line,
|
|
||||||
const Standard_Boolean cutbyu,
|
|
||||||
const Standard_Integer cutindex,
|
|
||||||
TColStd_SequenceOfReal& SplitLinePar,
|
|
||||||
TColStd_SequenceOfInteger& SplitLineCode,
|
|
||||||
TopTools_SequenceOfShape& SplitLineVertex);
|
|
||||||
|
|
||||||
//! Split edges in the sequence of wires by cutting line.
|
//! Split edges in the sequence of wires by cutting line.
|
||||||
//! Wires with FORWARD or REVERSED orientation are considered
|
//! Wires with FORWARD or REVERSED orientation are considered
|
||||||
@@ -230,10 +206,7 @@ protected:
|
|||||||
//! All modifications (splitting) are recorded in context,
|
//! All modifications (splitting) are recorded in context,
|
||||||
//! except splitting of wires marked as EXTERNAL
|
//! except splitting of wires marked as EXTERNAL
|
||||||
//! (they are supposed to be former cutting lines).
|
//! (they are supposed to be former cutting lines).
|
||||||
Standard_EXPORT void SplitByLine (ShapeFix_SequenceOfWireSegment& seqw,
|
Standard_EXPORT void SplitByLine (ShapeFix_SequenceOfWireSegment& seqw, const gp_Lin2d& line, const Standard_Boolean cutbyu, const Standard_Integer cutindex);
|
||||||
const gp_Lin2d& line,
|
|
||||||
const Standard_Boolean cutbyu,
|
|
||||||
const Standard_Integer cutindex);
|
|
||||||
|
|
||||||
//! Split initial set of (closed) wires by grid of lines corresponding
|
//! Split initial set of (closed) wires by grid of lines corresponding
|
||||||
//! to joints between patches on the composite surface.
|
//! to joints between patches on the composite surface.
|
||||||
@@ -258,15 +231,12 @@ protected:
|
|||||||
//! taking EXTERNAL as necessary in fork points. Forks are detected
|
//! taking EXTERNAL as necessary in fork points. Forks are detected
|
||||||
//! by common vertices. In fork point, most left way is seleccted
|
//! by common vertices. In fork point, most left way is seleccted
|
||||||
//! among all possible ways.
|
//! among all possible ways.
|
||||||
Standard_EXPORT void CollectWires (ShapeFix_SequenceOfWireSegment& wires,
|
Standard_EXPORT void CollectWires (ShapeFix_SequenceOfWireSegment& wires, ShapeFix_SequenceOfWireSegment& seqw);
|
||||||
ShapeFix_SequenceOfWireSegment& seqw);
|
|
||||||
|
|
||||||
//! Creates new faces on one path of grid. It dispatches given loops
|
//! Creates new faces on one path of grid. It dispatches given loops
|
||||||
//! (wires) into one or several faces depending on their mutual
|
//! (wires) into one or several faces depending on their mutual
|
||||||
//! position.
|
//! position.
|
||||||
Standard_EXPORT void MakeFacesOnPatch (TopTools_SequenceOfShape& faces,
|
Standard_EXPORT void MakeFacesOnPatch (TopTools_SequenceOfShape& faces, const Handle(Geom_Surface)& surf, TopTools_SequenceOfShape& loops) const;
|
||||||
const Handle(Geom_Surface)& surf,
|
|
||||||
TopTools_SequenceOfShape& loops) const;
|
|
||||||
|
|
||||||
TopAbs_Orientation myOrient;
|
TopAbs_Orientation myOrient;
|
||||||
TopoDS_Shape myResult;
|
TopoDS_Shape myResult;
|
||||||
|
@@ -411,6 +411,22 @@ static Standard_Integer ReadObj (Draw_Interpretor& theDI,
|
|||||||
{
|
{
|
||||||
aFilePath = theArgVec[anArgIter];
|
aFilePath = theArgVec[anArgIter];
|
||||||
}
|
}
|
||||||
|
else if (theArgc == 4 && strcmp("multi", theArgv[3]) == 0)
|
||||||
|
{
|
||||||
|
NCollection_Sequence<Handle(Poly_Triangulation)> theTriangList;
|
||||||
|
RWStl::ReadFile(theArgv[2], theTriangList);
|
||||||
|
BRep_Builder aB;
|
||||||
|
TopoDS_Compound aCmp;
|
||||||
|
aB.MakeCompound(aCmp);
|
||||||
|
for (int i = 1; i <= theTriangList.Length(); i++)
|
||||||
|
{
|
||||||
|
TopoDS_Face aFace;
|
||||||
|
aB.MakeFace(aFace);
|
||||||
|
aB.UpdateFace(aFace, theTriangList(i));
|
||||||
|
aB.Add(aCmp, aFace);
|
||||||
|
}
|
||||||
|
DBRep::Set(theArgv[1], aCmp);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "Syntax error at '" << theArgVec[anArgIter] << "'\n";
|
std::cout << "Syntax error at '" << theArgVec[anArgIter] << "'\n";
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
puts "TODO All: Faulty shapes in variables faulty_1 to faulty_"
|
||||||
|
|
||||||
puts "========"
|
puts "========"
|
||||||
puts "OCC22919"
|
puts "OCC22919"
|
||||||
puts "========"
|
puts "========"
|
||||||
|
@@ -1,4 +0,0 @@
|
|||||||
restore [locate_data_file bug31202.brep] shape
|
|
||||||
fixshape result shape 0.000001137 0.0001137
|
|
||||||
checkshape result
|
|
||||||
checknbshapes result -edge 4
|
|
@@ -1,5 +1,6 @@
|
|||||||
# !!!! This file is generated automatically, do not edit manually! See end script
|
# !!!! This file is generated automatically, do not edit manually! See end script
|
||||||
puts "TODO CR23096 ALL: TPSTAT : Faulty"
|
puts "TODO CR23096 ALL: TPSTAT : Faulty"
|
||||||
|
puts "TODO CR23096 ALL: CHECKSHAPE : Faulty"
|
||||||
|
|
||||||
|
|
||||||
set filename bm1_sy_exhaust.stp
|
set filename bm1_sy_exhaust.stp
|
||||||
|
Reference in New Issue
Block a user