#include <BRepLib_FindSurface.hxx>
#include <BRepLib_MakeWire.hxx>
#include <BRepLib_MakeEdge.hxx>
+#include <BRepCheck_Wire.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
#include <Bnd_Box.hxx>
#include <BRepBndLib.hxx>
Standard_Boolean allClosed = Standard_True;
Standard_Integer i,ii,ideb=1,ifin=NbSects;
for (i=1; i<=NbSects; i++) {
- allClosed = (allClosed && myWork(i).Closed());
+ Handle(BRepCheck_Wire) Checker = new BRepCheck_Wire(TopoDS::Wire(myWork(i)));
+ allClosed = (allClosed && (Checker->Closed() == BRepCheck_NoError));
+ //allClosed = (allClosed && myWork(i).Closed());
}
if (!allClosed)
Standard_NoSuchObject::Raise("BRepFill_CompatibleWires::SameNumberByPolarMethod : the wires must be closed");
uses
SectionLaw from GeomFill,
- HArray1OfSectionLaw from GeomFill,
- BSplineSurface from Geom,
+ HArray1OfSectionLaw from GeomFill,
+ SequenceOfTrsf from GeomFill,
+ BSplineSurface from Geom,
HArray2OfShape from TopTools,
SequenceOfReal from TColStd,
SequenceOfShape from TopTools,
---Purpose: Construct
returns NSections from BRepFill;
- Create (S : SequenceOfShape from TopTools;
- P : SequenceOfReal from TColStd;
- VF,VL : Real;
- Build : Boolean = Standard_True)
+ Create (S : SequenceOfShape from TopTools;
+ Trsfs : SequenceOfTrsf from GeomFill;
+ P : SequenceOfReal from TColStd;
+ VF,VL : Real;
+ Build : Boolean = Standard_True)
---Purpose: Construct
returns NSections from BRepFill;
fields
VFirst, VLast : Real;
myShapes: SequenceOfShape from TopTools;
- myParams: SequenceOfReal from TColStd;
+ myTrsfs: SequenceOfTrsf from GeomFill;
+ myParams: SequenceOfReal from TColStd;
myEdges: HArray2OfShape from TopTools;
mySurface: BSplineSurface from Geom;
end NSections;
//=======================================================================
BRepFill_NSections::BRepFill_NSections(const TopTools_SequenceOfShape& S,
+ const GeomFill_SequenceOfTrsf& Transformations,
const TColStd_SequenceOfReal & P,
const Standard_Real VF,
const Standard_Real VL,
if (ok) {
myParams = P;
myShapes = S;
+ myTrsfs = Transformations;
VFirst = VF;
VLast = VL;
Init(P,Build);
// if (! B.Degenerated(wexp.Current())) NbEdge++;
if (! BRep_Tool::Degenerated(wexp.Current())) NbEdge++;
-
myEdges = new (TopTools_HArray2OfShape) (1, NbEdge, 1, NbSects);
// On Remplit les tables
Standard_Real Ufirst = ii-1;
Standard_Real Ulast = ii;
- myLaws->ChangeValue(ii) = new (GeomFill_NSections)(NC,myParams,
+ myLaws->ChangeValue(ii) = new (GeomFill_NSections)(NC, myTrsfs, myParams,
Ufirst,Ulast,
VFirst,VLast,
mySurface);
for (Standard_Integer jj=1; jj<=myShapes.Length(); jj++) {
NCompo.Append(mySurface->VIso(myParams(jj)));
}
- Law = new (GeomFill_NSections)(NCompo, myParams,
+ Law = new (GeomFill_NSections)(NCompo, myTrsfs, myParams,
Ufirst, Ulast,
Vfirst, Vlast,
mySurface);
---Purpose: Perform general sweeping construction
uses
Dir from gp,
- Ax2 from gp,
+ Ax2 from gp,
+ Trsf from gp,
Function from Law,
ListOfShape from TopTools,
HArray2OfShape from TopTools,
Place(me : mutable;
Sec : Section from BRepFill;
W : out Wire from TopoDS;
+ Trsf : out Trsf from gp;
param : out Real from Standard) is private;
ResetLoc(me : mutable) is private;
CW.SetPercent(0.1);
CW.Perform();
if (!CW.IsDone()) StdFail_NotDone::Raise("Uncompatible wires");
- Handle(BRepFill_NSections) SL = new (BRepFill_NSections) (CW.Shape(),SR,0.,1.)
-;
+ GeomFill_SequenceOfTrsf EmptyTrsfs;
+ Handle(BRepFill_NSections) SL = new (BRepFill_NSections) (CW.Shape(),EmptyTrsfs,SR,0.,1.);
Standard_Real US = p1/(p1+p2);
SL->D0(US, Wres);
return Standard_True;
// Construction de la loi de section
if (mySeq.Length() == 1) {
Standard_Real p1;
- Place(mySeq(1), theSect,p1);
+ gp_Trsf aTrsf;
+ Place(mySeq(1), theSect, aTrsf, p1);
TopoDS_Wire aLocalShape = theSect;
if (mySeq(1).IsLaw())
mySection = new BRepFill_ShapeLaw(aLocalShape, myLaw);
{
TColStd_SequenceOfReal Param;
TopTools_SequenceOfShape WSeq;
- WSeq.Clear();
- Param.Clear();
+ GeomFill_SequenceOfTrsf Transformations;
+ //WSeq.Clear();
+ //Param.Clear();
Standard_Integer NbL = myLocation->NbLaw();
+ gp_Trsf aTrsf;
Standard_Real V1, V2, param;
myLocation->CurvilinearBounds(NbL, V1, V2);
V1 = 0.;
// for (Standard_Integer iseq=1;iseq<=mySeq.Length();iseq++) {
Standard_Integer iseq;
for (iseq=1;iseq<=mySeq.Length();iseq++) {
- Place(mySeq(iseq), theSect, param);
+ Place(mySeq(iseq), theSect, aTrsf, param);
Param.Append(param);
WSeq.Append(theSect);
// WSeq.Append(TopoDS::Wire(theSect));
+ Transformations.Append(aTrsf);
if (param==V1) ideb = iseq;
if (param==V2) ifin = iseq;
}
else {
Standard_ConstructionError::Raise("PipeShell : uncompatible wires");
}
- mySection = new (BRepFill_NSections) (WorkingSections,Param,V1,V2);
+ mySection = new (BRepFill_NSections) (WorkingSections,Transformations,Param,V1,V2);
}// else
//=======================================================================
void BRepFill_PipeShell::Place(const BRepFill_Section& Sec,
TopoDS_Wire& W,
+ gp_Trsf& aTrsf,
Standard_Real& param)
{
BRepFill_SectionPlacement Place(myLocation,
Sec.WithContact(),
Sec.WithCorrection());
W = Sec.Wire();
+ aTrsf = Place.Transformation();
TopLoc_Location Loc2(Place.Transformation()), Loc1;
Loc1 = W.Location();
W.Location(Loc2.Multiplied(Loc1));
if(!mySeq.IsEmpty()) {
Standard_Integer iseq;
TopoDS_Wire aSect;
+ gp_Trsf aTrsf;
Standard_Real param = 0., aparmin = RealLast(), aparmax = -RealLast();
Standard_Integer ideb = 1, ifin = mySeq.Length();
for (iseq = 1;iseq <= mySeq.Length(); iseq++) {
- Place(mySeq(iseq), aSect, param);
+ Place(mySeq(iseq), aSect, aTrsf, param);
if(param < aparmin) {
ideb = iseq;