mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
2674598ff1 | ||
|
c51df6bfd2 | ||
|
5e43274280 | ||
|
efe960751c | ||
|
6b9e0dc3f8 | ||
|
2ef94c994e | ||
|
1dd4b902c0 | ||
|
a846d36326 |
@@ -62,6 +62,7 @@
|
||||
#include <IntTools_SequenceOfCurves.hxx>
|
||||
#include <IntTools_SequenceOfPntOn2Faces.hxx>
|
||||
#include <IntTools_Tools.hxx>
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
#include <NCollection_Vector.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TColStd_ListOfInteger.hxx>
|
||||
@@ -578,14 +579,12 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
|
||||
Standard_Integer i, nF1, nF2, aNbC, aNbP, j;
|
||||
Standard_Integer nV1, nV2;
|
||||
Standard_Real aT1, aT2;
|
||||
Handle(NCollection_BaseAllocator) aAllocator;
|
||||
Handle(NCollection_BaseAllocator) aAllocator = new NCollection_IncAllocator;
|
||||
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
|
||||
TopoDS_Edge aES;
|
||||
Handle(BOPDS_PaveBlock) aPBOut;
|
||||
//
|
||||
//-----------------------------------------------------scope f
|
||||
aAllocator=
|
||||
NCollection_BaseAllocator::CommonBaseAllocator();
|
||||
//
|
||||
TColStd_ListOfInteger aLSE(aAllocator), aLBV(aAllocator);
|
||||
TColStd_MapOfInteger aMVOnIn(100, aAllocator), aMVCommon(100, aAllocator),
|
||||
|
@@ -322,7 +322,8 @@ Standard_Boolean IGESCAFControl_Reader::Transfer (const Handle(TDocStd_Document)
|
||||
|
||||
//Checks that current entity is a subfigure
|
||||
Handle(IGESBasic_SubfigureDef) aSubfigure = Handle(IGESBasic_SubfigureDef)::DownCast (ent);
|
||||
if (GetNameMode() && !aSubfigure.IsNull() && STool->Search (S, L, Standard_True, Standard_True))
|
||||
if (GetNameMode() && !aSubfigure.IsNull() && !aSubfigure->Name().IsNull() &&
|
||||
STool->Search(S, L, Standard_True, Standard_True))
|
||||
{
|
||||
//In this case we attach subfigure name to the label, instead of default "COMPOUND"
|
||||
Handle(TCollection_HAsciiString) aName = aSubfigure->Name();
|
||||
|
@@ -633,34 +633,55 @@ Standard_Boolean IGESData_ParamReader::ReadXYZ
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadText
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean IGESData_ParamReader::ReadText
|
||||
(const IGESData_ParamCursor& PC, const Message_Msg& amsg,
|
||||
Handle(TCollection_HAsciiString)& val)
|
||||
Standard_Boolean IGESData_ParamReader::ReadText(const IGESData_ParamCursor& thePC,
|
||||
const Message_Msg& theMsg,
|
||||
Handle(TCollection_HAsciiString)& theVal)
|
||||
{
|
||||
if (!PrepareRead(PC,Standard_False)) return Standard_False;
|
||||
const Interface_FileParameter& FP = theparams->Value(theindex+thebase);
|
||||
if (FP.ParamType() != Interface_ParamText) {
|
||||
if (FP.ParamType() == Interface_ParamVoid) {
|
||||
val = new TCollection_HAsciiString("");
|
||||
if (!PrepareRead(thePC, Standard_False))
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
const Interface_FileParameter& aFP = theparams->Value(theindex + thebase);
|
||||
if (aFP.ParamType() != Interface_ParamText)
|
||||
{
|
||||
theVal = new TCollection_HAsciiString("");
|
||||
if (aFP.ParamType() == Interface_ParamVoid)
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
SendFail (amsg);
|
||||
SendFail(theMsg);
|
||||
return Standard_False;
|
||||
}
|
||||
Handle(TCollection_HAsciiString) tval = new TCollection_HAsciiString (FP.CValue());
|
||||
Standard_Integer lnt = tval->Length();
|
||||
Standard_Integer lnh = tval->Location(1,'H',1,lnt);
|
||||
if (lnh <= 1 || lnh >= lnt) {
|
||||
SendFail (amsg);
|
||||
const Handle(TCollection_HAsciiString) aBaseValue = new TCollection_HAsciiString(aFP.CValue());
|
||||
const Standard_Integer aBaseLength = aBaseValue->Length();
|
||||
const Standard_Integer aSymbolLocation = aBaseValue->Location(1, 'H', 1, aBaseLength);
|
||||
if (aSymbolLocation <= 1 || aSymbolLocation > aBaseLength)
|
||||
{
|
||||
theVal = new TCollection_HAsciiString("");
|
||||
SendFail(theMsg);
|
||||
return Standard_False;
|
||||
} else {
|
||||
Standard_Integer hol = atoi (tval->SubString(1,lnh-1)->ToCString());
|
||||
if (hol != (lnt-lnh)) SendWarning (amsg);
|
||||
}
|
||||
val = new TCollection_HAsciiString(tval->SubString(lnh+1,lnt)->ToCString());
|
||||
const TCollection_AsciiString aSpecialSubString = aBaseValue->String().SubString(1, aSymbolLocation - 1);
|
||||
if (!aSpecialSubString.IsIntegerValue())
|
||||
{
|
||||
theVal = new TCollection_HAsciiString("");
|
||||
SendFail(theMsg);
|
||||
return Standard_False;
|
||||
}
|
||||
Standard_Integer aResLength = aSpecialSubString.IntegerValue();
|
||||
if (aResLength != (aBaseLength - aSymbolLocation))
|
||||
{
|
||||
SendWarning(theMsg);
|
||||
aResLength = aBaseLength - aSymbolLocation;
|
||||
}
|
||||
TCollection_AsciiString aResString;
|
||||
if (aResLength > 0)
|
||||
{
|
||||
aResString = aBaseValue->String().SubString(aSymbolLocation + 1, aBaseLength);
|
||||
}
|
||||
theVal = new TCollection_HAsciiString(aResString);
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
|
@@ -200,7 +200,7 @@ public:
|
||||
//! For Message
|
||||
Standard_EXPORT Standard_Boolean ReadXYZ (const IGESData_ParamCursor& PC, const Standard_CString mess, gp_XYZ& val);
|
||||
|
||||
Standard_EXPORT Standard_Boolean ReadText (const IGESData_ParamCursor& PC, const Message_Msg& amsg, Handle(TCollection_HAsciiString)& val);
|
||||
Standard_EXPORT Standard_Boolean ReadText (const IGESData_ParamCursor& thePC, const Message_Msg& theMsg, Handle(TCollection_HAsciiString)& theVal);
|
||||
|
||||
//! Reads a Text value from parameter "num", as a String from
|
||||
//! Collection, that is, Hollerith text without leading "nnnH"
|
||||
|
@@ -225,6 +225,14 @@ static Resource_KindOfLine WhatKindOfLine(OSD_File& aFile,
|
||||
aToken2.Clear();
|
||||
else {
|
||||
Line.Remove(1,Pos-1);
|
||||
const Standard_Integer aLineLength = Line.Length();
|
||||
if (aLineLength >= 2)
|
||||
{
|
||||
if (Line.Value(aLineLength - 1) == '\r')
|
||||
{
|
||||
Line.Remove(aLineLength - 1);
|
||||
}
|
||||
}
|
||||
Line.Remove(Line.Length());
|
||||
aToken2 = Line;
|
||||
}
|
||||
|
@@ -4692,9 +4692,16 @@ void collectRepresentationItems(const Interface_Graph& theGraph,
|
||||
const Handle(StepShape_ShapeRepresentation)& theRepresentation,
|
||||
NCollection_Sequence<Handle(StepRepr_RepresentationItem)>& theItems)
|
||||
{
|
||||
Handle(StepRepr_HArray1OfRepresentationItem) aReprItems = theRepresentation->Items();
|
||||
for (Standard_Integer itemIt = aReprItems->Lower(); itemIt <= aReprItems->Upper(); itemIt++)
|
||||
theItems.Append(aReprItems->Value(itemIt));
|
||||
for (StepRepr_HArray1OfRepresentationItem::Iterator anIter(theRepresentation->Items()->Array1());
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(StepRepr_RepresentationItem)& anReprItem = anIter.Value();
|
||||
if (anReprItem.IsNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
theItems.Append(anReprItem);
|
||||
}
|
||||
|
||||
Interface_EntityIterator entIt = theGraph.TypedSharings(theRepresentation, STANDARD_TYPE(StepRepr_RepresentationRelationship));
|
||||
for (entIt.Start(); entIt.More(); entIt.Next())
|
||||
|
@@ -47,7 +47,9 @@ class TopoDS_Shape;
|
||||
//! Also supports multifile writing
|
||||
class STEPCAFControl_Writer
|
||||
{
|
||||
public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
public:
|
||||
|
||||
//! Creates a writer with an empty
|
||||
|
@@ -155,8 +155,16 @@ static TopoDS_Edge MakeEdge
|
||||
TopoDS_Edge E;
|
||||
B.MakeEdge (E,C3D,Precision::Confusion());
|
||||
B.Add (E,V1); B.Add (E,V2);
|
||||
B.UpdateVertex(V1, U1, E, 0.);
|
||||
B.UpdateVertex(V2, U2, E, 0.);
|
||||
if (!Precision::IsPositiveInfinite(U1) &&
|
||||
!Precision::IsNegativeInfinite(U1))
|
||||
{
|
||||
B.UpdateVertex(V1, U1, E, 0.);
|
||||
}
|
||||
if (!Precision::IsPositiveInfinite(U2) &&
|
||||
!Precision::IsNegativeInfinite(U2))
|
||||
{
|
||||
B.UpdateVertex(V2, U2, E, 0.);
|
||||
}
|
||||
return E;
|
||||
}
|
||||
|
||||
@@ -302,11 +310,17 @@ void StepToTopoDS_TranslateEdge::Init(const Handle(StepShape_Edge)& aEdge,
|
||||
// --- * a 3D Curve
|
||||
// ----------------------------------------------------------
|
||||
|
||||
if ( C->IsKind(STANDARD_TYPE(StepGeom_Pcurve))) {
|
||||
if (C->IsKind(STANDARD_TYPE(StepGeom_Pcurve)))
|
||||
{
|
||||
B.MakeEdge(E);
|
||||
//:S4136 B.UpdateEdge (E,preci);
|
||||
B.Add(E, V1);
|
||||
B.Add(E, V2);
|
||||
if (!V1.IsNull())
|
||||
{
|
||||
B.Add(E, V1);
|
||||
}
|
||||
if (!V2.IsNull())
|
||||
{
|
||||
B.Add(E, V2);
|
||||
}
|
||||
}
|
||||
else if (C->IsKind(STANDARD_TYPE(StepGeom_SurfaceCurve)) ) {
|
||||
// For SeamCurve and IntersectionCurve types
|
||||
@@ -380,6 +394,21 @@ void StepToTopoDS_TranslateEdge::MakeFromCurve3D
|
||||
done = Standard_False;
|
||||
return;
|
||||
}
|
||||
//BRep_Builder aBuilder;
|
||||
//if (V1.IsNull())
|
||||
//{
|
||||
// TopoDS_Vertex aTmpVert;
|
||||
// const Standard_Real aFirst = C1->FirstParameter();
|
||||
// aBuilder.MakeVertex(aTmpVert, C1->Value(aFirst), preci);
|
||||
// V1 = aTmpVert;
|
||||
//}
|
||||
//if (V2.IsNull())
|
||||
//{
|
||||
// TopoDS_Vertex aTmpVert;
|
||||
// const Standard_Real aFirst = C1->LastParameter();
|
||||
// aBuilder.MakeVertex(aTmpVert, C1->Value(aFirst), preci);
|
||||
// V2 = aTmpVert;
|
||||
//}
|
||||
// -- Statistics -- -> No Warning message
|
||||
aTool.AddContinuity (C1);
|
||||
BRep_Builder B;
|
||||
|
@@ -22,21 +22,27 @@
|
||||
// rln 02.06.99 removing #include <StepToTopoDS_DegeneratedTool.hxx>
|
||||
// smh 31.01.01 BUC60810 : IsNull protection
|
||||
|
||||
#include <StepToTopoDS_TranslateEdgeLoop.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <GeomToStep_MakeCartesianPoint.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Interface_Static.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <ShapeAlgo.hxx>
|
||||
#include <ShapeAlgo_AlgoContainer.hxx>
|
||||
#include <ShapeAlgo_ToolContainer.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <ShapeAnalysis_Curve.hxx>
|
||||
#include <ShapeAnalysis_Edge.hxx>
|
||||
#include <ShapeBuild_Edge.hxx>
|
||||
@@ -52,13 +58,13 @@
|
||||
#include <StepShape_FaceBound.hxx>
|
||||
#include <StepShape_OrientedEdge.hxx>
|
||||
#include <StepShape_Vertex.hxx>
|
||||
#include <StepShape_VertexPoint.hxx>
|
||||
#include <StepToGeom.hxx>
|
||||
#include <StepToTopoDS.hxx>
|
||||
#include <StepToTopoDS_GeometricTool.hxx>
|
||||
#include <StepToTopoDS_NMTool.hxx>
|
||||
#include <StepToTopoDS_Tool.hxx>
|
||||
#include <StepToTopoDS_TranslateEdge.hxx>
|
||||
#include <StepToTopoDS_TranslateEdgeLoop.hxx>
|
||||
#include <StepToTopoDS_TranslateVertex.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopExp.hxx>
|
||||
@@ -74,6 +80,26 @@
|
||||
#include <XSAlgo.hxx>
|
||||
#include <XSAlgo_AlgoContainer.hxx>
|
||||
|
||||
// ============================================================================
|
||||
// Method : MakeCurveFromStep
|
||||
// Purpose :
|
||||
// ============================================================================
|
||||
static Handle(Geom_Curve) MakeCurveFromStep (const Handle(StepGeom_Curve)& theStepCurve,
|
||||
const Handle(Transfer_TransientProcess) theTP)
|
||||
{
|
||||
Handle(Geom_Curve) aResCurve = Handle(Geom_Curve)::DownCast(theTP->FindTransient(theStepCurve));
|
||||
if (!aResCurve.IsNull())
|
||||
{
|
||||
return aResCurve;
|
||||
}
|
||||
aResCurve = StepToGeom::MakeCurve(theStepCurve);
|
||||
if (!aResCurve.IsNull())
|
||||
{
|
||||
theTP->BindTransient(theStepCurve, aResCurve);
|
||||
}
|
||||
return aResCurve;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Method : RemoveSinglePCurve
|
||||
// Purpose :
|
||||
@@ -220,21 +246,13 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
|
||||
BRep_Builder B;
|
||||
Handle(Transfer_TransientProcess) TP = aTool.TransientProcess();
|
||||
|
||||
Standard_Real preci = Precision();
|
||||
const Standard_Real preci = Precision();
|
||||
TopoDS_Wire W;
|
||||
TopoDS_Edge E;
|
||||
TopoDS_Vertex V;
|
||||
|
||||
Standard_Boolean isSeam, isLikeSeam;
|
||||
Handle(Geom2d_Curve) C2d, C2d1, C2d2;
|
||||
|
||||
Handle(StepShape_OrientedEdge) OrEdge1, OrEdge2;
|
||||
Handle(StepGeom_Curve) StepCurve, StepCurve1, StepCurve2;
|
||||
Handle(StepRepr_DefinitionalRepresentation) DRI, Dri1, Dri2;
|
||||
|
||||
Handle(Geom2d_Curve) C2d, C2d1, C2d2, WhichC2d1, WhichC2d2;
|
||||
TopoDS_Edge suspectE; //:f1, degEdge;
|
||||
|
||||
Standard_Integer j, NbEdge = EL->NbEdgeList();
|
||||
const Standard_Integer NbEdge = EL->NbEdgeList();
|
||||
if (NbEdge == 0) {
|
||||
TP->AddWarning(EL, "Wire not done. EdgeLoop does not contain edges.");
|
||||
done = Standard_False;
|
||||
@@ -269,9 +287,9 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
|
||||
// This case may not be processed, PCurves has to be recomputed from scratch
|
||||
// -----------------------------------------------
|
||||
// Standard_Integer theSame = 1; //gka 15.12.98
|
||||
|
||||
for (j=1; j<=NbEdge; j++) {
|
||||
OrEdge1 = EL->EdgeListValue(j);
|
||||
NCollection_Map<Handle(StepShape_OrientedEdge)> aIncorrectEdges;
|
||||
for (Standard_Integer j=1; j<=NbEdge; j++) {
|
||||
Handle(StepShape_OrientedEdge) OrEdge1 = EL->EdgeListValue(j);
|
||||
|
||||
if (OrEdge1.IsNull() || OrEdge1->EdgeElement().IsNull())
|
||||
{
|
||||
@@ -337,21 +355,38 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
|
||||
StepToTopoDS_TranslateVertex myTranVertex1(Vstart, aTool, NMTool);
|
||||
StepToTopoDS_TranslateVertex myTranVertex2(Vend, aTool, NMTool);
|
||||
|
||||
if (myTranVertex1.IsDone()) {
|
||||
if (myTranVertex1.IsDone())
|
||||
{
|
||||
V1 = TopoDS::Vertex(myTranVertex1.Value());
|
||||
}
|
||||
if (myTranVertex2.IsDone()) {
|
||||
if (myTranVertex2.IsDone())
|
||||
{
|
||||
V2 = TopoDS::Vertex(myTranVertex2.Value());
|
||||
gp_Pnt p1 = BRep_Tool::Pnt(V1);
|
||||
gp_Pnt p2 = BRep_Tool::Pnt(V2);
|
||||
if (p1.Distance(p2) <= Precision::Confusion()) { //:S4136: preci) {
|
||||
Standard_Boolean Fixed = Standard_True;
|
||||
if (!iseV) aTool.Bind(Vend, V1); //gka 21.08.1998 bug PRO7656
|
||||
else if (!istV) aTool.Bind (Vstart, V2);
|
||||
else aTool.Bind (Vend, V1);
|
||||
if (!C1.IsNull() && !C1->IsClosed() && Fixed)
|
||||
}
|
||||
if (!V1.IsNull() && !V2.IsNull())
|
||||
{
|
||||
gp_Pnt aPnt1 = BRep_Tool::Pnt(V1);
|
||||
gp_Pnt aPnt2 = BRep_Tool::Pnt(V2);
|
||||
if (aPnt1.Distance(aPnt2) <= Precision::Confusion())
|
||||
{
|
||||
Standard_Boolean aIsFixed = Standard_True;
|
||||
if (!iseV)
|
||||
{
|
||||
aTool.Bind(Vend, V1);
|
||||
}
|
||||
else if (!istV)
|
||||
{
|
||||
aTool.Bind(Vstart, V2);
|
||||
}
|
||||
else
|
||||
{
|
||||
aTool.Bind(Vend, V1);
|
||||
}
|
||||
if (!C1.IsNull() && !C1->IsClosed() && aIsFixed)
|
||||
{
|
||||
TP->AddWarning(EL->EdgeListValue(j),
|
||||
"Vertex of same coordinates, set confused");
|
||||
"Vertex of same coordinates, set confused");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -361,32 +396,141 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
|
||||
// and make it be one vertex
|
||||
// NOTE: this is done only for the case if at least one of edges
|
||||
// was not yet translated; else nothing will help
|
||||
for (j=1; j<=NbEdge; j++) {
|
||||
OrEdge1 = EL->EdgeListValue (j);
|
||||
OrEdge2 = EL->EdgeListValue (j < NbEdge ? j + 1 : 1);
|
||||
if (OrEdge1.IsNull() || OrEdge2.IsNull())
|
||||
for (Standard_Integer anEdgeInd = 1; anEdgeInd <= NbEdge; anEdgeInd++)
|
||||
{
|
||||
Handle(StepShape_OrientedEdge) anOrEdge1 =
|
||||
EL->EdgeListValue(anEdgeInd);
|
||||
Handle(StepShape_OrientedEdge) anOrEdge2 =
|
||||
EL->EdgeListValue(anEdgeInd < NbEdge ? anEdgeInd + 1 : 1);
|
||||
if (anOrEdge1.IsNull() || anOrEdge2.IsNull())
|
||||
continue;
|
||||
|
||||
Handle(StepShape_EdgeCurve) EC1 =
|
||||
Handle(StepShape_EdgeCurve)::DownCast (OrEdge1->EdgeElement());
|
||||
Handle(StepShape_EdgeCurve) EC2 =
|
||||
Handle(StepShape_EdgeCurve)::DownCast (OrEdge2->EdgeElement());
|
||||
if (EC1.IsNull() || EC2.IsNull()) // see #29979
|
||||
if (!anOrEdge1->EdgeElement().IsNull() &&
|
||||
anOrEdge1->EdgeElement()->IsKind(STANDARD_TYPE(StepShape_OrientedEdge)))
|
||||
{
|
||||
anOrEdge1 = Handle(StepShape_OrientedEdge)::DownCast(anOrEdge1->EdgeElement());
|
||||
}
|
||||
if (!anOrEdge2->EdgeElement().IsNull() &&
|
||||
anOrEdge2->EdgeElement()->IsKind(STANDARD_TYPE(StepShape_OrientedEdge)))
|
||||
{
|
||||
anOrEdge2 = Handle(StepShape_OrientedEdge)::DownCast(anOrEdge2->EdgeElement());
|
||||
}
|
||||
Handle(StepShape_EdgeCurve) aEC1 =
|
||||
Handle(StepShape_EdgeCurve)::DownCast(anOrEdge1->EdgeElement());
|
||||
const Handle(StepShape_EdgeCurve) aEC2 =
|
||||
Handle(StepShape_EdgeCurve)::DownCast(anOrEdge2->EdgeElement());
|
||||
if (aEC1.IsNull() || aEC2.IsNull()) // see #29979
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(StepShape_Vertex) Vs1, Vs2, Vs11, Vs22;
|
||||
Vs1 = (OrEdge1->Orientation() ? EC1->EdgeEnd() : EC1->EdgeStart());
|
||||
Vs2 = (OrEdge2->Orientation() ? EC2->EdgeStart() : EC2->EdgeEnd());
|
||||
Handle(StepShape_Vertex) aVs1 = anOrEdge1->Orientation() ? aEC1->EdgeEnd() : aEC1->EdgeStart();
|
||||
Handle(StepShape_Vertex) aVs2 = anOrEdge2->Orientation() ? aEC2->EdgeStart() : aEC2->EdgeEnd();
|
||||
|
||||
Vs11 = (OrEdge1->Orientation() ? EC1->EdgeStart() : EC1->EdgeEnd());
|
||||
Vs22 = (OrEdge2->Orientation() ? EC2->EdgeEnd() : EC2->EdgeStart());
|
||||
Handle(StepShape_Vertex) aVs11 = anOrEdge1->Orientation() ? aEC1->EdgeStart() : aEC1->EdgeEnd();
|
||||
const Handle(StepShape_Vertex) aVs22 = anOrEdge2->Orientation() ? aEC2->EdgeEnd() : aEC2->EdgeStart();
|
||||
|
||||
if ((Vs1 == Vs2) || (Vs1 == Vs22) || (Vs2 == Vs11) || (Vs22 == Vs11)) continue;
|
||||
|
||||
StepToTopoDS_TranslateVertex myTranVertex1 (Vs1, aTool, NMTool);
|
||||
StepToTopoDS_TranslateVertex myTranVertex2 (Vs2, aTool, NMTool);
|
||||
if (!aVs1.IsNull() && !aVs11.IsNull() &&
|
||||
((aVs1 == aVs2) || (aVs1 == aVs22) || (aVs2 == aVs11) || (aVs22 == aVs11)))
|
||||
{
|
||||
//continue;
|
||||
}
|
||||
if (aVs1.IsNull())
|
||||
{
|
||||
aIncorrectEdges.Add(anOrEdge1);
|
||||
if (aVs2.IsNull())
|
||||
{
|
||||
Handle(Geom_Curve) aCurve;
|
||||
const Handle(Geom_Curve) aCurveFirst = MakeCurveFromStep(aEC1->EdgeGeometry(), TP);
|
||||
const Handle(Geom_Curve) aCurveSecond = MakeCurveFromStep(aEC2->EdgeGeometry(), TP);
|
||||
Standard_Real aLast = Precision::Infinite();
|
||||
aCurve = aCurveFirst;
|
||||
aLast = anOrEdge1->Orientation() ? aCurve->LastParameter() : aCurve->FirstParameter();
|
||||
if (Precision::IsPositiveInfinite(aLast) ||
|
||||
Precision::IsNegativeInfinite(aLast))
|
||||
{
|
||||
aCurve = aCurveSecond;
|
||||
aLast = anOrEdge2->Orientation() ? aCurve->FirstParameter() : aCurve->LastParameter();
|
||||
}
|
||||
gp_Pnt aStartP;
|
||||
Standard_Boolean aIsFinded = Standard_False;
|
||||
if (Precision::IsPositiveInfinite(aLast) ||
|
||||
Precision::IsNegativeInfinite(aLast))
|
||||
{
|
||||
//if (anOrEdge2->Orientation())
|
||||
//{
|
||||
// aLast = 0.0;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
aCurve = aCurveFirst;
|
||||
Handle(StepShape_VertexPoint) VP = Handle(StepShape_VertexPoint)::DownCast(aVs22);
|
||||
Handle(StepGeom_Point) P = VP->VertexGeometry();
|
||||
Handle(StepGeom_CartesianPoint) P1 = Handle(StepGeom_CartesianPoint)::DownCast(P);
|
||||
Handle(Geom_CartesianPoint) P2 = StepToGeom::MakeCartesianPoint(P1);
|
||||
gp_Pnt aLastPnt = P2->Pnt();
|
||||
VP = Handle(StepShape_VertexPoint)::DownCast(aVs11);
|
||||
P = VP->VertexGeometry();
|
||||
P1 = Handle(StepGeom_CartesianPoint)::DownCast(P);
|
||||
P2 = StepToGeom::MakeCartesianPoint(P1);
|
||||
gp_Pnt aFirstPnt = P2->Pnt();
|
||||
aLast = anOrEdge1->Orientation() ? aLastPnt.Distance(aFirstPnt) : 0.0;
|
||||
if (aCurveFirst->IsKind(STANDARD_TYPE(Geom_Line)))
|
||||
{
|
||||
Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast(aCurveFirst);
|
||||
aStartP = aFirstPnt.XYZ() + ((aLine->Position().Direction().XYZ() * aLastPnt.Distance(aFirstPnt)) * (anOrEdge1->Orientation() ? 1 : -1));
|
||||
aIsFinded = Standard_True;
|
||||
}
|
||||
//}
|
||||
}
|
||||
if (!aIsFinded)
|
||||
{
|
||||
aStartP = aCurve->Value(aLast);
|
||||
}
|
||||
GeomToStep_MakeCartesianPoint aMkPoint(aStartP);
|
||||
const Handle(StepGeom_CartesianPoint) aGpms = aMkPoint.Value();
|
||||
const Handle(StepShape_VertexPoint) aVSP0 =
|
||||
new StepShape_VertexPoint();
|
||||
const Handle(TCollection_HAsciiString) aName =
|
||||
new TCollection_HAsciiString("");
|
||||
aVSP0->Init(aName, aGpms);
|
||||
aVs2 = aVSP0;
|
||||
}
|
||||
if (!aVs2.IsNull())
|
||||
{
|
||||
aVs1 = aVs2;
|
||||
if (anOrEdge1->Orientation())
|
||||
{
|
||||
aEC1->SetEdgeEnd(aVs1);
|
||||
}
|
||||
else
|
||||
{
|
||||
aEC1->SetEdgeStart(aVs1);
|
||||
}
|
||||
if (anOrEdge2->Orientation())
|
||||
{
|
||||
aEC2->SetEdgeStart(aVs1);
|
||||
}
|
||||
else
|
||||
{
|
||||
aEC2->SetEdgeEnd(aVs1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (aVs2.IsNull())
|
||||
{
|
||||
aVs2 = aVs1;
|
||||
if (anOrEdge2->Orientation())
|
||||
{
|
||||
aEC2->SetEdgeStart(aVs1);
|
||||
}
|
||||
else
|
||||
{
|
||||
aEC2->SetEdgeEnd(aVs1);
|
||||
}
|
||||
}
|
||||
StepToTopoDS_TranslateVertex myTranVertex1 (aVs1, aTool, NMTool);
|
||||
StepToTopoDS_TranslateVertex myTranVertex2 (aVs2, aTool, NMTool);
|
||||
|
||||
TopoDS_Vertex V1, V2;
|
||||
if (myTranVertex1.IsDone())
|
||||
@@ -400,8 +544,8 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
|
||||
gp_Pnt p2 = BRep_Tool::Pnt(V2);
|
||||
Standard_Boolean locFixed = Standard_True;
|
||||
if (p1.Distance(p2) <= preci) {
|
||||
if (! aTool.IsBound (EC1)) aTool.Bind (Vs1, V2);
|
||||
else if (! aTool.IsBound (EC2)) aTool.Bind (Vs2, V1);
|
||||
if (! aTool.IsBound (aEC1)) aTool.Bind (aVs1, V2);
|
||||
else if (! aTool.IsBound (aEC2)) aTool.Bind (aVs2, V1);
|
||||
else locFixed = Standard_False;
|
||||
}
|
||||
else locFixed = Standard_False;
|
||||
@@ -413,7 +557,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
|
||||
// Iteration on each Oriented Edge of the EdgeLoop
|
||||
// -----------------------------------------------
|
||||
|
||||
for (j=1; j<=NbEdge; j++) {
|
||||
for (Standard_Integer j=1; j<=NbEdge; j++) {
|
||||
|
||||
Standard_Boolean ThereIsLikeSeam = Standard_False;
|
||||
|
||||
@@ -421,7 +565,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
|
||||
std::cout << " Processing Edge :" << j << std::endl;
|
||||
#endif
|
||||
|
||||
OrEdge1 = EL->EdgeListValue(j);
|
||||
Handle(StepShape_OrientedEdge) OrEdge1 = EL->EdgeListValue(j);
|
||||
if (OrEdge1.IsNull() || OrEdge1->EdgeElement().IsNull())
|
||||
continue;
|
||||
|
||||
@@ -430,7 +574,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
|
||||
OrEdge1 = Handle(StepShape_OrientedEdge)::DownCast (OrEdge1->EdgeElement());
|
||||
|
||||
Handle(StepShape_EdgeCurve) EC = Handle(StepShape_EdgeCurve)::DownCast(OrEdge1->EdgeElement());
|
||||
if (EC.IsNull())
|
||||
if (EC.IsNull()/* || aIncorrectEdges.Contains(OrEdge1)*/)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -458,7 +602,8 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
|
||||
E.Orientation(TopAbs_FORWARD);
|
||||
else E.Orientation(TopAbs_REVERSED);
|
||||
|
||||
isSeam = isLikeSeam = Standard_False;
|
||||
Standard_Boolean isSeam = Standard_False;
|
||||
Standard_Boolean isLikeSeam = Standard_False;
|
||||
|
||||
// ------------------------------------------
|
||||
// Map the StepEdge parametric representation
|
||||
@@ -526,7 +671,6 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
|
||||
}
|
||||
|
||||
if (isLikeSeam) {
|
||||
suspectE = E;
|
||||
ThereIsLikeSeam = Standard_True;
|
||||
hasPcurve = Standard_True;
|
||||
}
|
||||
|
@@ -1,6 +1,3 @@
|
||||
puts "TODO CR23671 Linux: Error"
|
||||
puts "TODO CR23671 Linux: Draw_Failure: Could not open"
|
||||
|
||||
puts "============"
|
||||
puts "CR23671"
|
||||
puts "============"
|
||||
|
16
tests/bugs/iges/bug33327
Normal file
16
tests/bugs/iges/bug33327
Normal file
@@ -0,0 +1,16 @@
|
||||
puts "============"
|
||||
puts "0033327: Data Exchange, IGES Import - SubfigureDef can't read string"
|
||||
puts "============"
|
||||
|
||||
pload DCAF
|
||||
|
||||
Close D -silent
|
||||
|
||||
ReadIges D [locate_data_file "bug33327.igs"]
|
||||
vclear
|
||||
vinit View1
|
||||
XDisplay -dispMode 1 D
|
||||
vfit
|
||||
vdump "$imagedir/${casename}_src.png"
|
||||
|
||||
Close D
|
15
tests/bugs/modalg_7/bug33264
Normal file
15
tests/bugs/modalg_7/bug33264
Normal file
@@ -0,0 +1,15 @@
|
||||
puts "============"
|
||||
puts "0033264: Modeling Algorithms - Result of section operation is incomplete"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug33264_1.brep] srf1
|
||||
restore [locate_data_file bug33264_2.brep] srf2
|
||||
|
||||
bsection res srf1 srf2
|
||||
|
||||
checknbshapes res -vertex 44 -edge 43
|
||||
checkprops res -l 51.3377
|
||||
checksection res
|
||||
|
||||
checkview -display res -2d -path ${imagedir}/${test_image}.png
|
14
tests/bugs/step/bug33331
Normal file
14
tests/bugs/step/bug33331
Normal file
@@ -0,0 +1,14 @@
|
||||
puts "===================================="
|
||||
puts "0033331: Data Exchange, Step Import - Unsupported Representation Items"
|
||||
puts "===================================="
|
||||
puts ""
|
||||
|
||||
pload DCAF
|
||||
catch {Close D}
|
||||
|
||||
param "read.stepcaf.subshapes.name" 1
|
||||
|
||||
ReadStep D [locate_data_file bug33331.stp]
|
||||
|
||||
param "read.stepcaf.subshapes.name" 0
|
||||
Close D
|
Reference in New Issue
Block a user