mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-27 21:40:33 +05:00
IMP 0020308: EDF 995 GEOM : Closed Polyline with tangence.
This commit is contained in:
parent
6a891e2286
commit
522b8bee22
@ -15,9 +15,10 @@ possible types of curves: Polyline, Besier or B-spline (Interpolated).
|
|||||||
<ul>
|
<ul>
|
||||||
<li><em>geompy.MakePolyline(ListOfShapes)</em></li>
|
<li><em>geompy.MakePolyline(ListOfShapes)</em></li>
|
||||||
<li><em>geompy.MakeBezier(ListOfShapes)</em></li>
|
<li><em>geompy.MakeBezier(ListOfShapes)</em></li>
|
||||||
<li><em>geompy.MakeInterpol(ListOfShapes)</em></li>
|
<li><em>geompy.MakeInterpol(ListOfShapes,isClosed)</em></li>
|
||||||
</ul>
|
</ul>
|
||||||
ListOfShape is a list of points through which the curve passes.
|
ListOfShape is a list of points through which the curve passes.
|
||||||
|
If isClosed is True, MakeInterpol builds a closed edge.
|
||||||
|
|
||||||
<b>Arguments:</b> Name + at least 2 points which will serve as nodes
|
<b>Arguments:</b> Name + at least 2 points which will serve as nodes
|
||||||
on the curve.
|
on the curve.
|
||||||
|
@ -199,7 +199,7 @@ polyline = geompy.MakePolyline([p0, p1, p2, p3, p4])
|
|||||||
bezier = geompy.MakeBezier([p0, p1, p2, p3, p4])
|
bezier = geompy.MakeBezier([p0, p1, p2, p3, p4])
|
||||||
|
|
||||||
#create a b-spline curve from a list of points
|
#create a b-spline curve from a list of points
|
||||||
interpol = geompy.MakeInterpol([p0, p1, p2, p3, p4])
|
interpol = geompy.MakeInterpol([p0, p1, p2, p3, p4], False)
|
||||||
|
|
||||||
# add objects in the study
|
# add objects in the study
|
||||||
id_p0 = geompy.addToStudy(p0, "Point1")
|
id_p0 = geompy.addToStudy(p0, "Point1")
|
||||||
|
@ -2209,9 +2209,11 @@ module GEOM
|
|||||||
/*!
|
/*!
|
||||||
* Create B-Spline curve on the set of points.
|
* Create B-Spline curve on the set of points.
|
||||||
* \param thePoints Sequence of points for the B-Spline curve.
|
* \param thePoints Sequence of points for the B-Spline curve.
|
||||||
|
* \param theIsClosed If TRUE, build a closed curve.
|
||||||
* \return New GEOM_Object, containing the created B-Spline curve.
|
* \return New GEOM_Object, containing the created B-Spline curve.
|
||||||
*/
|
*/
|
||||||
GEOM_Object MakeSplineInterpolation (in ListOfGO thePoints);
|
GEOM_Object MakeSplineInterpolation (in ListOfGO thePoints,
|
||||||
|
in boolean theIsClosed);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Create a sketcher (wire or face), following the textual description,
|
* Create a sketcher (wire or face), following the textual description,
|
||||||
|
@ -502,7 +502,8 @@ module GEOM
|
|||||||
in GEOM_Object thePnt2) ;
|
in GEOM_Object thePnt2) ;
|
||||||
GEOM_Object MakePolyline (in GEOM_List thePoints) ;
|
GEOM_Object MakePolyline (in GEOM_List thePoints) ;
|
||||||
GEOM_Object MakeSplineBezier (in GEOM_List thePoints) ;
|
GEOM_Object MakeSplineBezier (in GEOM_List thePoints) ;
|
||||||
GEOM_Object MakeSplineInterpolation (in GEOM_List thePoints) ;
|
GEOM_Object MakeSplineInterpolation (in GEOM_List thePoints,
|
||||||
|
in boolean theIsClosed) ;
|
||||||
GEOM_Object MakeSketcher (in string theCommand,
|
GEOM_Object MakeSketcher (in string theCommand,
|
||||||
in GEOM_List theWorkingPlane) ;
|
in GEOM_List theWorkingPlane) ;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
// File : BasicGUI_CurveDlg.cxx
|
// File : BasicGUI_CurveDlg.cxx
|
||||||
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
|
||||||
//
|
|
||||||
#include "BasicGUI_CurveDlg.h"
|
#include "BasicGUI_CurveDlg.h"
|
||||||
|
|
||||||
#include <DlgRef.h>
|
#include <DlgRef.h>
|
||||||
@ -69,7 +69,7 @@ BasicGUI_CurveDlg::BasicGUI_CurveDlg( GeometryGUI* theGeometryGUI, QWidget* pare
|
|||||||
mainFrame()->RadioButton2->setIcon( image3 );
|
mainFrame()->RadioButton2->setIcon( image3 );
|
||||||
mainFrame()->RadioButton3->setIcon( image2 );
|
mainFrame()->RadioButton3->setIcon( image2 );
|
||||||
|
|
||||||
GroupPoints = new DlgRef_1Sel( centralWidget() );
|
GroupPoints = new DlgRef_1Sel1Check( centralWidget() );
|
||||||
|
|
||||||
GroupPoints->GroupBox1->setTitle( tr( "GEOM_NODES" ) );
|
GroupPoints->GroupBox1->setTitle( tr( "GEOM_NODES" ) );
|
||||||
GroupPoints->TextLabel1->setText( tr( "GEOM_POINTS" ) );
|
GroupPoints->TextLabel1->setText( tr( "GEOM_POINTS" ) );
|
||||||
@ -78,6 +78,10 @@ BasicGUI_CurveDlg::BasicGUI_CurveDlg( GeometryGUI* theGeometryGUI, QWidget* pare
|
|||||||
|
|
||||||
GroupPoints->LineEdit1->setReadOnly( true );
|
GroupPoints->LineEdit1->setReadOnly( true );
|
||||||
|
|
||||||
|
GroupPoints->CheckButton1->setText( tr( "GEOM_IS_CLOSED" ) );
|
||||||
|
GroupPoints->CheckButton1->setChecked(false);
|
||||||
|
GroupPoints->CheckButton1->hide();
|
||||||
|
|
||||||
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
|
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
|
||||||
layout->setMargin( 0 ); layout->setSpacing( 6 );
|
layout->setMargin( 0 ); layout->setSpacing( 6 );
|
||||||
layout->addWidget( GroupPoints );
|
layout->addWidget( GroupPoints );
|
||||||
@ -125,8 +129,10 @@ void BasicGUI_CurveDlg::Init()
|
|||||||
connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||||
|
|
||||||
|
connect( GroupPoints->CheckButton1,SIGNAL( toggled(bool) ), this, SLOT( CheckButtonToggled() ) );
|
||||||
|
|
||||||
connect( myGeomGUI->getApp()->selectionMgr(),
|
connect( myGeomGUI->getApp()->selectionMgr(),
|
||||||
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ) ;
|
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
|
||||||
initName( tr( "GEOM_CURVE" ) );
|
initName( tr( "GEOM_CURVE" ) );
|
||||||
resize(100,100);
|
resize(100,100);
|
||||||
@ -142,6 +148,11 @@ void BasicGUI_CurveDlg::ConstructorsClicked( int id )
|
|||||||
QString aTitle = tr( id == 0 ? "GEOM_POLYLINE" : id == 1 ? "GEOM_BEZIER" : "GEOM_INTERPOL" );
|
QString aTitle = tr( id == 0 ? "GEOM_POLYLINE" : id == 1 ? "GEOM_BEZIER" : "GEOM_INTERPOL" );
|
||||||
mainFrame()->GroupConstructors->setTitle( aTitle );
|
mainFrame()->GroupConstructors->setTitle( aTitle );
|
||||||
|
|
||||||
|
if (id == 2) // b-spline
|
||||||
|
GroupPoints->CheckButton1->show();
|
||||||
|
else
|
||||||
|
GroupPoints->CheckButton1->hide();
|
||||||
|
|
||||||
myPoints = new GEOM::ListOfGO();
|
myPoints = new GEOM::ListOfGO();
|
||||||
myPoints->length( 0 );
|
myPoints->length( 0 );
|
||||||
|
|
||||||
@ -175,6 +186,15 @@ void BasicGUI_CurveDlg::LineEditReturnPressed()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : CheckButtonToggled()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_CurveDlg::CheckButtonToggled()
|
||||||
|
{
|
||||||
|
displayPreview();
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ClickOnOk()
|
// function : ClickOnOk()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -351,7 +371,7 @@ void BasicGUI_CurveDlg::SelectionIntoArgument()
|
|||||||
if ( myPoints->length() > 0 )
|
if ( myPoints->length() > 0 )
|
||||||
GroupPoints->LineEdit1->setText( QString::number( myPoints->length() ) + "_" + tr( "GEOM_POINT" ) + tr( "_S_" ) );
|
GroupPoints->LineEdit1->setText( QString::number( myPoints->length() ) + "_" + tr( "GEOM_POINT" ) + tr( "_S_" ) );
|
||||||
|
|
||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -429,7 +449,8 @@ bool BasicGUI_CurveDlg::execute( ObjectList& objects )
|
|||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case 2 :
|
case 2 :
|
||||||
anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeSplineInterpolation( myPoints );
|
anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->
|
||||||
|
MakeSplineInterpolation( myPoints, GroupPoints->CheckButton1->isChecked() );
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
// File : BasicGUI_CurveDlg.h
|
// File : BasicGUI_CurveDlg.h
|
||||||
// Author : Alexander SLADKOV, Open CASCADE S.A.S. (alexander.sladkov@opencascade.com)
|
// Author : Alexander SLADKOV, Open CASCADE S.A.S. (alexander.sladkov@opencascade.com)
|
||||||
//
|
|
||||||
#ifndef BASICGUI_CURVEDLG_H
|
#ifndef BASICGUI_CURVEDLG_H
|
||||||
#define BASICGUI_CURVEDLG_H
|
#define BASICGUI_CURVEDLG_H
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
class DlgRef_1Sel;
|
class DlgRef_1Sel1Check;
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : BasicGUI_CurveDlg
|
// class : BasicGUI_CurveDlg
|
||||||
@ -55,7 +55,7 @@ private:
|
|||||||
void enterEvent( QEvent* );
|
void enterEvent( QEvent* );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DlgRef_1Sel* GroupPoints;
|
DlgRef_1Sel1Check* GroupPoints;
|
||||||
GEOM::ListOfGO_var myPoints;
|
GEOM::ListOfGO_var myPoints;
|
||||||
std::list<GEOM::GEOM_Object_var> myOrderedSel; //!< This list used for managing orderes selection
|
std::list<GEOM::GEOM_Object_var> myOrderedSel; //!< This list used for managing orderes selection
|
||||||
|
|
||||||
@ -68,6 +68,7 @@ private slots:
|
|||||||
|
|
||||||
void ConstructorsClicked( int );
|
void ConstructorsClicked( int );
|
||||||
void LineEditReturnPressed();
|
void LineEditReturnPressed();
|
||||||
|
void CheckButtonToggled();
|
||||||
void SelectionIntoArgument();
|
void SelectionIntoArgument();
|
||||||
void SetEditCurrentArgument();
|
void SetEditCurrentArgument();
|
||||||
};
|
};
|
||||||
|
@ -3844,6 +3844,13 @@ Please, select face, shell or solid and try again</translation>
|
|||||||
<translation>Length unit in the file is not a 'meter'. Do you want to scale a model?</translation>
|
<translation>Length unit in the file is not a 'meter'. Do you want to scale a model?</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>BasicGUI_CurveDlg</name>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_IS_CLOSED</source>
|
||||||
|
<translation>Build a closed edge</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>BasicGUI_EllipseDlg</name>
|
<name>BasicGUI_EllipseDlg</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -664,7 +664,8 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineBezier
|
|||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation
|
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation
|
||||||
(list<Handle(GEOM_Object)> thePoints)
|
(list<Handle(GEOM_Object)> thePoints,
|
||||||
|
bool theIsClosed)
|
||||||
{
|
{
|
||||||
SetErrorCode(KO);
|
SetErrorCode(KO);
|
||||||
|
|
||||||
@ -694,6 +695,8 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation
|
|||||||
aCI.SetPoint(ind, aRefPnt);
|
aCI.SetPoint(ind, aRefPnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
aCI.SetIsClosed(theIsClosed);
|
||||||
|
|
||||||
//Compute the Spline value
|
//Compute the Spline value
|
||||||
try {
|
try {
|
||||||
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
|
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
|
||||||
|
@ -68,7 +68,8 @@ class GEOMImpl_ICurvesOperations : public GEOM_IOperations {
|
|||||||
Handle(GEOM_Object) thePnt3);
|
Handle(GEOM_Object) thePnt3);
|
||||||
|
|
||||||
Standard_EXPORT Handle(GEOM_Object) MakeSplineBezier (list<Handle(GEOM_Object)> thePoints);
|
Standard_EXPORT Handle(GEOM_Object) MakeSplineBezier (list<Handle(GEOM_Object)> thePoints);
|
||||||
Standard_EXPORT Handle(GEOM_Object) MakeSplineInterpolation (list<Handle(GEOM_Object)> thePoints);
|
Standard_EXPORT Handle(GEOM_Object) MakeSplineInterpolation (list<Handle(GEOM_Object)> thePoints,
|
||||||
|
bool theIsClosed = false);
|
||||||
|
|
||||||
Standard_EXPORT Handle(GEOM_Object) MakeSketcher (const char* theCommand,
|
Standard_EXPORT Handle(GEOM_Object) MakeSketcher (const char* theCommand,
|
||||||
list<double> theWorkingPlane);
|
list<double> theWorkingPlane);
|
||||||
|
@ -19,12 +19,13 @@
|
|||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
//NOTE: This is an intreface to a function for the Spline creation.
|
// NOTE: This is an interface to a function for the Spline creation.
|
||||||
//
|
|
||||||
#include "GEOM_Function.hxx"
|
#include "GEOM_Function.hxx"
|
||||||
|
|
||||||
#define SPL_ARG_LENG 1
|
#define SPL_ARG_LENG 1
|
||||||
#define SPL_ARG_LAST 1
|
#define SPL_ARG_CLOS 2
|
||||||
|
#define SPL_ARG_LAST 2
|
||||||
|
|
||||||
class GEOMImpl_ISpline
|
class GEOMImpl_ISpline
|
||||||
{
|
{
|
||||||
@ -34,10 +35,14 @@ class GEOMImpl_ISpline
|
|||||||
|
|
||||||
void SetLength(int theLen) { _func->SetInteger(SPL_ARG_LENG, theLen); }
|
void SetLength(int theLen) { _func->SetInteger(SPL_ARG_LENG, theLen); }
|
||||||
|
|
||||||
|
void SetIsClosed(bool theIsClosed) { _func->SetInteger(SPL_ARG_CLOS, (int)theIsClosed); }
|
||||||
|
|
||||||
void SetPoint(int theId, Handle(GEOM_Function) theP) { _func->SetReference(SPL_ARG_LAST + theId, theP); }
|
void SetPoint(int theId, Handle(GEOM_Function) theP) { _func->SetReference(SPL_ARG_LAST + theId, theP); }
|
||||||
|
|
||||||
int GetLength() { return _func->GetInteger(SPL_ARG_LENG); }
|
int GetLength() { return _func->GetInteger(SPL_ARG_LENG); }
|
||||||
|
|
||||||
|
bool GetIsClosed() { return (bool)_func->GetInteger(SPL_ARG_CLOS); }
|
||||||
|
|
||||||
Handle(GEOM_Function) GetPoint(int theId) { return _func->GetReference(SPL_ARG_LAST + theId); }
|
Handle(GEOM_Function) GetPoint(int theId) { return _func->GetReference(SPL_ARG_LAST + theId); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -107,13 +107,14 @@ Standard_Integer GEOMImpl_SplineDriver::Execute(TFunction_Logbook& log) const
|
|||||||
Handle(Geom_BezierCurve) GBC = new Geom_BezierCurve(CurvePoints);
|
Handle(Geom_BezierCurve) GBC = new Geom_BezierCurve(CurvePoints);
|
||||||
aShape = BRepBuilderAPI_MakeEdge(GBC).Edge();
|
aShape = BRepBuilderAPI_MakeEdge(GBC).Edge();
|
||||||
} else {
|
} else {
|
||||||
// GeomAPI_PointsToBSpline GBC (CurvePoints);
|
//GeomAPI_PointsToBSpline GBC (CurvePoints);
|
||||||
// aShape = BRepBuilderAPI_MakeEdge(GBC).Edge();
|
//aShape = BRepBuilderAPI_MakeEdge(GBC).Edge();
|
||||||
Handle(TColgp_HArray1OfPnt) aHCurvePoints = new TColgp_HArray1OfPnt(1, aLen);
|
Handle(TColgp_HArray1OfPnt) aHCurvePoints = new TColgp_HArray1OfPnt(1, aLen);
|
||||||
for (ind = 1; ind <= aLen; ind++) {
|
for (ind = 1; ind <= aLen; ind++) {
|
||||||
aHCurvePoints->SetValue(ind, CurvePoints.Value(ind));
|
aHCurvePoints->SetValue(ind, CurvePoints.Value(ind));
|
||||||
}
|
}
|
||||||
GeomAPI_Interpolate GBC (aHCurvePoints, Standard_False, gp::Resolution());
|
int isClosed = aCI.GetIsClosed();
|
||||||
|
GeomAPI_Interpolate GBC (aHCurvePoints, isClosed, gp::Resolution());
|
||||||
GBC.Perform();
|
GBC.Perform();
|
||||||
if (GBC.IsDone())
|
if (GBC.IsDone())
|
||||||
aShape = BRepBuilderAPI_MakeEdge(GBC.Curve()).Edge();
|
aShape = BRepBuilderAPI_MakeEdge(GBC.Curve()).Edge();
|
||||||
|
@ -397,7 +397,8 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineBezier
|
|||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineInterpolation
|
GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineInterpolation
|
||||||
(const GEOM::ListOfGO& thePoints)
|
(const GEOM::ListOfGO& thePoints,
|
||||||
|
CORBA::Boolean theIsClosed)
|
||||||
{
|
{
|
||||||
GEOM::GEOM_Object_var aGEOMObject;
|
GEOM::GEOM_Object_var aGEOMObject;
|
||||||
|
|
||||||
@ -416,7 +417,7 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineInterpolation
|
|||||||
|
|
||||||
// Make Polyline
|
// Make Polyline
|
||||||
Handle(GEOM_Object) anObject =
|
Handle(GEOM_Object) anObject =
|
||||||
GetOperations()->MakeSplineInterpolation(aPoints);
|
GetOperations()->MakeSplineInterpolation(aPoints, theIsClosed);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||||
return aGEOMObject._retn();
|
return aGEOMObject._retn();
|
||||||
|
|
||||||
|
@ -79,7 +79,8 @@ class GEOM_I_EXPORT GEOM_ICurvesOperations_i :
|
|||||||
|
|
||||||
GEOM::GEOM_Object_ptr MakeSplineBezier (const GEOM::ListOfGO& thePoints);
|
GEOM::GEOM_Object_ptr MakeSplineBezier (const GEOM::ListOfGO& thePoints);
|
||||||
|
|
||||||
GEOM::GEOM_Object_ptr MakeSplineInterpolation (const GEOM::ListOfGO& thePoints);
|
GEOM::GEOM_Object_ptr MakeSplineInterpolation (const GEOM::ListOfGO& thePoints,
|
||||||
|
CORBA::Boolean theIsClosed);
|
||||||
|
|
||||||
GEOM::GEOM_Object_ptr MakeSketcher (const char* theCommand, const GEOM::ListOfDouble& theWorkingPlane);
|
GEOM::GEOM_Object_ptr MakeSketcher (const char* theCommand, const GEOM::ListOfDouble& theWorkingPlane);
|
||||||
|
|
||||||
|
@ -2679,14 +2679,15 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSplineBezier (GEOM::GEOM_List_ptr thePo
|
|||||||
//=============================================================================
|
//=============================================================================
|
||||||
// MakeSplineInterpolation:
|
// MakeSplineInterpolation:
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSplineInterpolation (GEOM::GEOM_List_ptr thePoints)
|
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSplineInterpolation (GEOM::GEOM_List_ptr thePoints,
|
||||||
|
CORBA::Boolean theIsClosed)
|
||||||
{
|
{
|
||||||
beginService( " GEOM_Superv_i::MakeSplineInterpolation" );
|
beginService( " GEOM_Superv_i::MakeSplineInterpolation" );
|
||||||
MESSAGE("GEOM_Superv_i::MakeSplineInterpolation");
|
MESSAGE("GEOM_Superv_i::MakeSplineInterpolation");
|
||||||
if (GEOM_List_i<GEOM::ListOfGO>* aListImplP =
|
if (GEOM_List_i<GEOM::ListOfGO>* aListImplP =
|
||||||
dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(thePoints, myPOA).in())) {
|
dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(thePoints, myPOA).in())) {
|
||||||
getCurvesOp();
|
getCurvesOp();
|
||||||
GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakeSplineInterpolation(aListImplP->GetList());
|
GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakeSplineInterpolation(aListImplP->GetList(), theIsClosed);
|
||||||
endService( " GEOM_Superv_i::MakeSplineInterpolation" );
|
endService( " GEOM_Superv_i::MakeSplineInterpolation" );
|
||||||
return anObj;
|
return anObj;
|
||||||
}
|
}
|
||||||
|
@ -584,7 +584,8 @@ public:
|
|||||||
GEOM::GEOM_Object_ptr thePnt3);
|
GEOM::GEOM_Object_ptr thePnt3);
|
||||||
GEOM::GEOM_Object_ptr MakePolyline (GEOM::GEOM_List_ptr thePoints);
|
GEOM::GEOM_Object_ptr MakePolyline (GEOM::GEOM_List_ptr thePoints);
|
||||||
GEOM::GEOM_Object_ptr MakeSplineBezier (GEOM::GEOM_List_ptr thePoints);
|
GEOM::GEOM_Object_ptr MakeSplineBezier (GEOM::GEOM_List_ptr thePoints);
|
||||||
GEOM::GEOM_Object_ptr MakeSplineInterpolation (GEOM::GEOM_List_ptr thePoints);
|
GEOM::GEOM_Object_ptr MakeSplineInterpolation (GEOM::GEOM_List_ptr thePoints,
|
||||||
|
CORBA::Boolean theIsClosed);
|
||||||
GEOM::GEOM_Object_ptr MakeSketcher (const char* theCommand,
|
GEOM::GEOM_Object_ptr MakeSketcher (const char* theCommand,
|
||||||
GEOM::GEOM_List_ptr theWorkingPlane);
|
GEOM::GEOM_List_ptr theWorkingPlane);
|
||||||
GEOM::GEOM_Object_ptr Make3DSketcher (GEOM::GEOM_List_ptr theCoordinates);
|
GEOM::GEOM_Object_ptr Make3DSketcher (GEOM::GEOM_List_ptr theCoordinates);
|
||||||
|
@ -102,7 +102,7 @@ def TestAll (geompy, math):
|
|||||||
Ellipse = geompy.MakeEllipse(p0, vy, radius2, radius1) #(2 GEOM_Object_ptr, 2 Doubles)->GEOM_Object_ptr
|
Ellipse = geompy.MakeEllipse(p0, vy, radius2, radius1) #(2 GEOM_Object_ptr, 2 Doubles)->GEOM_Object_ptr
|
||||||
Polyline = geompy.MakePolyline([p0, pz, py, p200]) #(List of GEOM_Object_ptr)->GEOM_Object_ptr
|
Polyline = geompy.MakePolyline([p0, pz, py, p200]) #(List of GEOM_Object_ptr)->GEOM_Object_ptr
|
||||||
Bezier = geompy.MakeBezier([p0, pz, p200, px]) #(List of GEOM_Object_ptr)->GEOM_Object_ptr
|
Bezier = geompy.MakeBezier([p0, pz, p200, px]) #(List of GEOM_Object_ptr)->GEOM_Object_ptr
|
||||||
Interpol = geompy.MakeInterpol([px, py, p200, pxyz]) #(List of GEOM_Object_ptr)->GEOM_Object_ptr
|
Interpol = geompy.MakeInterpol([px, py, p200, pxyz], True) #(List of GEOM_Object_ptr,Boolean)->GEOM_Object_ptr
|
||||||
Sketcher = geompy.MakeSketcher("Sketcher:F -100 -100:TT 250 -100:R 0:C 100 150:R 0:L 300:WW",
|
Sketcher = geompy.MakeSketcher("Sketcher:F -100 -100:TT 250 -100:R 0:C 100 150:R 0:L 300:WW",
|
||||||
[100,0,0, 1,1,1, -1,1,0]) #(String, List of Doubles)->GEOM_Object_ptr
|
[100,0,0, 1,1,1, -1,1,0]) #(String, List of Doubles)->GEOM_Object_ptr
|
||||||
Sketcher3d = geompy.Make3DSketcher([0,0,0, 50,50,50, 0,50,50, 10,0,0])
|
Sketcher3d = geompy.Make3DSketcher([0,0,0, 50,50,50, 0,50,50, 10,0,0])
|
||||||
@ -121,7 +121,7 @@ def TestAll (geompy, math):
|
|||||||
tan_vertex_2 = geompy.MakeVertex(0, 90, 30)
|
tan_vertex_2 = geompy.MakeVertex(0, 90, 30)
|
||||||
tan_vertex_3 = geompy.MakeVertex(100, 90, 0)
|
tan_vertex_3 = geompy.MakeVertex(100, 90, 0)
|
||||||
tan_vertex_4 = geompy.MakeVertex(-100, 90, 0)
|
tan_vertex_4 = geompy.MakeVertex(-100, 90, 0)
|
||||||
tan_curve = geompy.MakeInterpol([tan_vertex_4, tan_vertex_2, tan_vertex_3, tan_vertex_1])
|
tan_curve = geompy.MakeInterpol([tan_vertex_4, tan_vertex_2, tan_vertex_3, tan_vertex_1], False)
|
||||||
tan_extrusion = geompy.MakePrismDXDYDZ(tan_curve, 0, 30, -60)
|
tan_extrusion = geompy.MakePrismDXDYDZ(tan_curve, 0, 30, -60)
|
||||||
tan_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
|
tan_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
|
||||||
|
|
||||||
|
@ -747,12 +747,13 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
|
|
||||||
## Create B-Spline curve on the set of points.
|
## Create B-Spline curve on the set of points.
|
||||||
# @param thePoints Sequence of points for the B-Spline curve.
|
# @param thePoints Sequence of points for the B-Spline curve.
|
||||||
|
# @param theIsClosed If True, build a closed curve.
|
||||||
# @return New GEOM_Object, containing the created B-Spline curve.
|
# @return New GEOM_Object, containing the created B-Spline curve.
|
||||||
#
|
#
|
||||||
# @ref tui_creation_curve "Example"
|
# @ref tui_creation_curve "Example"
|
||||||
def MakeInterpol(self,thePoints):
|
def MakeInterpol(self, thePoints, theIsClosed=False):
|
||||||
# Example: see GEOM_TestAll.py
|
# Example: see GEOM_TestAll.py
|
||||||
anObj = self.CurvesOp.MakeSplineInterpolation(thePoints)
|
anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed)
|
||||||
RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
|
RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
|
||||||
return anObj
|
return anObj
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user