mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-02-10 19:53:07 +05:00
new options of pipe construction
This commit is contained in:
parent
3a8ba583ab
commit
5fcda672da
@ -48,6 +48,8 @@
|
|||||||
#include <BRepBuilderAPI_Sewing.hxx>
|
#include <BRepBuilderAPI_Sewing.hxx>
|
||||||
#include <BRepCheck_Analyzer.hxx>
|
#include <BRepCheck_Analyzer.hxx>
|
||||||
#include <BRepGProp.hxx>
|
#include <BRepGProp.hxx>
|
||||||
|
#include <GeomFill_Trihedron.hxx>
|
||||||
|
#include <GeomFill_CorrectedFrenet.hxx>
|
||||||
#include <BRepOffsetAPI_MakePipe.hxx>
|
#include <BRepOffsetAPI_MakePipe.hxx>
|
||||||
#include <BRepOffsetAPI_MakePipeShell.hxx>
|
#include <BRepOffsetAPI_MakePipeShell.hxx>
|
||||||
|
|
||||||
@ -80,6 +82,7 @@
|
|||||||
#include <Geom_Conic.hxx>
|
#include <Geom_Conic.hxx>
|
||||||
#include <Geom_BSplineCurve.hxx>
|
#include <Geom_BSplineCurve.hxx>
|
||||||
#include <Geom_BSplineSurface.hxx>
|
#include <Geom_BSplineSurface.hxx>
|
||||||
|
#include <GeomAdaptor_HCurve.hxx>
|
||||||
#include <GeomFill_BSplineCurves.hxx>
|
#include <GeomFill_BSplineCurves.hxx>
|
||||||
#include <GeomConvert_ApproxCurve.hxx>
|
#include <GeomConvert_ApproxCurve.hxx>
|
||||||
#include <GeomConvert.hxx>
|
#include <GeomConvert.hxx>
|
||||||
@ -116,6 +119,39 @@ GEOMImpl_PipeDriver::GEOMImpl_PipeDriver()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : EvaluateBestSweepMode
|
||||||
|
//purpose : auxilary for right call of MakePipe and MakePipeShell
|
||||||
|
//=======================================================================
|
||||||
|
static GeomFill_Trihedron EvaluateBestSweepMode(const TopoDS_Shape& Spine)
|
||||||
|
{
|
||||||
|
GeomFill_Trihedron theMode = GeomFill_IsFrenet;
|
||||||
|
|
||||||
|
TopExp_Explorer Explo(Spine, TopAbs_EDGE);
|
||||||
|
for (; Explo.More(); Explo.Next())
|
||||||
|
{
|
||||||
|
TopoDS_Edge anEdge = TopoDS::Edge(Explo.Current());
|
||||||
|
Standard_Real fpar, lpar;
|
||||||
|
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar);
|
||||||
|
GeomAdaptor_Curve GAcurve(aCurve, fpar, lpar);
|
||||||
|
Handle(GeomAdaptor_HCurve) GAHcurve = new GeomAdaptor_HCurve(GAcurve);
|
||||||
|
|
||||||
|
Handle(GeomFill_CorrectedFrenet) aCorrFrenet = new GeomFill_CorrectedFrenet(Standard_True); //for evaluation
|
||||||
|
aCorrFrenet->SetCurve(GAHcurve);
|
||||||
|
GeomFill_Trihedron aMode = aCorrFrenet->EvaluateBestMode();
|
||||||
|
if (aMode == GeomFill_IsDiscreteTrihedron)
|
||||||
|
{
|
||||||
|
theMode = aMode;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (aMode == GeomFill_IsCorrectedFrenet)
|
||||||
|
theMode = aMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
return theMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : FillForOtherEdges
|
//function : FillForOtherEdges
|
||||||
//purpose : auxilary for CreatePipeForShellSections()
|
//purpose : auxilary for CreatePipeForShellSections()
|
||||||
@ -211,6 +247,9 @@ static bool FillCorrespondingEdges(const TopoDS_Shape& FS1,
|
|||||||
TopExp_Explorer expw2(FS2,TopAbs_WIRE);
|
TopExp_Explorer expw2(FS2,TopAbs_WIRE);
|
||||||
TopoDS_Wire aWire2 = TopoDS::Wire(expw2.Current());
|
TopoDS_Wire aWire2 = TopoDS::Wire(expw2.Current());
|
||||||
BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
|
BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
|
||||||
|
GeomFill_Trihedron theBestMode = EvaluateBestSweepMode(aWirePath);
|
||||||
|
if (theBestMode == GeomFill_IsDiscreteTrihedron)
|
||||||
|
aBuilder.SetDiscreteMode();
|
||||||
aBuilder.Add(aWire1, aLoc1);
|
aBuilder.Add(aWire1, aLoc1);
|
||||||
aBuilder.Add(aWire2, aLoc2);
|
aBuilder.Add(aWire2, aLoc2);
|
||||||
if (!aBuilder.IsReady()) {
|
if (!aBuilder.IsReady()) {
|
||||||
@ -875,6 +914,9 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
|
|||||||
num2 = SplitLocNums.Value(nn);
|
num2 = SplitLocNums.Value(nn);
|
||||||
// make pipe
|
// make pipe
|
||||||
BRepOffsetAPI_MakePipeShell aBuilder(tmpW);
|
BRepOffsetAPI_MakePipeShell aBuilder(tmpW);
|
||||||
|
GeomFill_Trihedron theBestMode = EvaluateBestSweepMode(tmpW);
|
||||||
|
if (theBestMode == GeomFill_IsDiscreteTrihedron)
|
||||||
|
aBuilder.SetDiscreteMode();
|
||||||
Standard_Integer nbShapes = aTmpSeqBases.Length();
|
Standard_Integer nbShapes = aTmpSeqBases.Length();
|
||||||
for (i=1; i<=nbShapes; i++) {
|
for (i=1; i<=nbShapes; i++) {
|
||||||
TopoDS_Shape aShapeLoc = aTmpSeqLocs.Value(i);
|
TopoDS_Shape aShapeLoc = aTmpSeqLocs.Value(i);
|
||||||
@ -903,6 +945,9 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
|
|||||||
}
|
}
|
||||||
// make pipe for last part
|
// make pipe for last part
|
||||||
BRepOffsetAPI_MakePipeShell aBuilder(tmpW);
|
BRepOffsetAPI_MakePipeShell aBuilder(tmpW);
|
||||||
|
GeomFill_Trihedron theBestMode = EvaluateBestSweepMode(tmpW);
|
||||||
|
if (theBestMode == GeomFill_IsDiscreteTrihedron)
|
||||||
|
aBuilder.SetDiscreteMode();
|
||||||
Standard_Integer nbShapes = aTmpSeqBases.Length();
|
Standard_Integer nbShapes = aTmpSeqBases.Length();
|
||||||
for (i=1; i<=nbShapes; i++) {
|
for (i=1; i<=nbShapes; i++) {
|
||||||
TopoDS_Shape aShapeLoc = aTmpSeqLocs.Value(i);
|
TopoDS_Shape aShapeLoc = aTmpSeqLocs.Value(i);
|
||||||
@ -930,6 +975,9 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
|
|||||||
else {
|
else {
|
||||||
// old implementation without splitting
|
// old implementation without splitting
|
||||||
BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
|
BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
|
||||||
|
GeomFill_Trihedron theBestMode = EvaluateBestSweepMode(aWirePath);
|
||||||
|
if (theBestMode == GeomFill_IsDiscreteTrihedron)
|
||||||
|
aBuilder.SetDiscreteMode();
|
||||||
|
|
||||||
Standard_Integer nbShapes = aSeqBases.Length();
|
Standard_Integer nbShapes = aSeqBases.Length();
|
||||||
Standard_Integer step = nbShapes/nbBases;
|
Standard_Integer step = nbShapes/nbBases;
|
||||||
@ -1443,6 +1491,9 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
|
|||||||
if (!aWire1.IsNull() && !aWire2.IsNull()) {
|
if (!aWire1.IsNull() && !aWire2.IsNull()) {
|
||||||
//BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
|
//BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
|
||||||
BRepOffsetAPI_MakePipeShell aBuilder(WPath);
|
BRepOffsetAPI_MakePipeShell aBuilder(WPath);
|
||||||
|
GeomFill_Trihedron theBestMode = EvaluateBestSweepMode(WPath);
|
||||||
|
if (theBestMode == GeomFill_IsDiscreteTrihedron)
|
||||||
|
aBuilder.SetDiscreteMode();
|
||||||
aBuilder.Add(aWire1, TopoDS::Vertex(VLocs(i)),
|
aBuilder.Add(aWire1, TopoDS::Vertex(VLocs(i)),
|
||||||
aWithContact, aWithCorrect);
|
aWithContact, aWithCorrect);
|
||||||
aBuilder.Add(aWire2, TopoDS::Vertex(VLocs(i+1)),
|
aBuilder.Add(aWire2, TopoDS::Vertex(VLocs(i+1)),
|
||||||
@ -1678,6 +1729,9 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
|
|||||||
// make pipe using aWire1 and aWire2
|
// make pipe using aWire1 and aWire2
|
||||||
if (!aWire1.IsNull() && !aWire2.IsNull()) {
|
if (!aWire1.IsNull() && !aWire2.IsNull()) {
|
||||||
BRepOffsetAPI_MakePipeShell aBuilder(WPath);
|
BRepOffsetAPI_MakePipeShell aBuilder(WPath);
|
||||||
|
GeomFill_Trihedron theBestMode = EvaluateBestSweepMode(WPath);
|
||||||
|
if (theBestMode == GeomFill_IsDiscreteTrihedron)
|
||||||
|
aBuilder.SetDiscreteMode();
|
||||||
aBuilder.Add(aWire1, TopoDS::Vertex(VLocs(i)),
|
aBuilder.Add(aWire1, TopoDS::Vertex(VLocs(i)),
|
||||||
aWithContact, aWithCorrect);
|
aWithContact, aWithCorrect);
|
||||||
aBuilder.Add(aWire2, TopoDS::Vertex(VLocs(i+1)),
|
aBuilder.Add(aWire2, TopoDS::Vertex(VLocs(i+1)),
|
||||||
@ -2392,7 +2446,10 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
|
|||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
aShape = BRepOffsetAPI_MakePipe(aWirePath, aShapeBase);
|
{
|
||||||
|
GeomFill_Trihedron theBestMode = EvaluateBestSweepMode(aWirePath);
|
||||||
|
aShape = BRepOffsetAPI_MakePipe(aWirePath, aShapeBase, theBestMode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//building pipe with different sections
|
//building pipe with different sections
|
||||||
|
Loading…
Reference in New Issue
Block a user