mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0023367: New functionality restoring the middle path of pipe-like shape
Version 2 Small correction Adding test cases
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include <BRepOffsetAPI_MakeEvolved.hxx>
|
||||
#include <BRepOffsetAPI_ThruSections.hxx>
|
||||
#include <BRepOffsetAPI_MakePipeShell.hxx>
|
||||
#include <BRepOffsetAPI_MiddlePath.hxx>
|
||||
|
||||
#include <BRepLib_MakeWire.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
@@ -772,6 +773,32 @@ static Standard_Integer simulsweep(Draw_Interpretor& di,
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// middlepath
|
||||
//=======================================================================
|
||||
static Standard_Integer middlepath(Draw_Interpretor& di,
|
||||
Standard_Integer n, const char** a)
|
||||
{
|
||||
if (n < 5) return 1;
|
||||
|
||||
TopoDS_Shape aShape = DBRep::Get(a[2]);
|
||||
if (aShape.IsNull()) return 1;
|
||||
|
||||
TopoDS_Shape StartShape = DBRep::Get(a[3]);
|
||||
if (StartShape.IsNull()) return 1;
|
||||
|
||||
TopoDS_Shape EndShape = DBRep::Get(a[4]);
|
||||
if (EndShape.IsNull()) return 1;
|
||||
|
||||
BRepOffsetAPI_MiddlePath Builder(aShape, StartShape, EndShape);
|
||||
Builder.Build();
|
||||
|
||||
TopoDS_Shape Result = Builder.Shape();
|
||||
DBRep::Set(a[1], Result);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SweepCommands
|
||||
//purpose :
|
||||
@@ -839,5 +866,8 @@ void BRepTest::SweepCommands(Draw_Interpretor& theCommands)
|
||||
__FILE__,simulsweep,g);
|
||||
theCommands.Add("geompipe", "geompipe r spineedge profileedge radius [byACR [byrotate]]"
|
||||
__FILE__,geompipe,g);
|
||||
|
||||
theCommands.Add("middlepath", "middlepath res shape startshape endshape",
|
||||
__FILE__,middlepath,g);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user