IMPs 21188, 21053, 21064

This commit is contained in:
jfa 2011-03-28 12:36:29 +00:00
parent 8f4a73d6ed
commit 723f0c59fb
46 changed files with 1485 additions and 775 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -5,10 +5,10 @@
To create an \b Edge, in the <b>Main Menu</b> select <b>New Entity >
Build > Edge</b>
There are two ways to create an edge. In both cases the \b Result
There are three ways to create an edge. In all cases the \b Result
will be a \b GEOM_Object (EDGE).
Firstly, you can create an \b Edge by specifying two points (\b Point1 and
Firstly, you can create a linear \b Edge by specifying two points (\b Point1 and
\b Point2), which are the first and the last vertices of the edge.
<b>TUI Command:</b> <em>geompy.MakeEdge(Vertex1, Vertex2)</em><br>
@ -41,6 +41,20 @@ the connection points (sharp bend) is not processed.
\image html edge2.png "Create edge from wire"
The third case allows building edges of desired length on any existing
curve (selected existing edge). <b>Start Point</b> parameter is optional.
Any point can be selected for it, the new edge will begin at the end
of initial edge, close to the selected point. <b>Length</b> can exceed
the initial edge's length or be negative to extrapolate existing edge
along its curve (except bezier and b-spline curves).
<b>TUI Command:</b> <em>geompy.MakeEdgeOnCurveByLength(Edge, Length, StartPoint = None)</em><br>
<b>Arguments:</b> Name + 1 edge + Length + 1 Vertex
(StartPoint parameter is optional, it allows switching from one end of
initial edge to another. Length can exceed the initial edge's length or be negative).
\image html edge3.png "Create edge on curve"
<b>Example:</b>
\image html edgesn.png "Edge"

View File

@ -34,11 +34,14 @@ position of the point on the given edge.
\image html point3.png
Alternatively, it is possible to define the point by \b Edge and \b Length,
the given length must not exceed the length of the edge. The orientation of the edge can be reversed.
\n <b>TUI Command:</b> <em>geompy.MakeVertexOnCurveByLength(Edge,Length,Reverse).</em>
\n <b>Arguments:</b> Name + 1 edge + 1 Length defining the
position of the point on the given edge + 1 Reverse flag defining the direction for the
calculation of the length (False = forward, True = reversed).
the given length can exceed the length of the edge or be negative
(except bezier and b-spline curves). The orientation of the edge can
be reversed by the \b StartPoint selection.
\n <b>TUI Command:</b> <em>geompy.MakeVertexOnCurveByLength(Edge,Length,StartPoint=None).</em>
\n <b>Arguments:</b> Name + 1 edge + 1 Length defining the position
of the point on the given edge + 1 Point defining the direction for
the calculation of the length (if not defined, the first vertex of
Edge is used, else the vertex of Edge closest to StartPoint is used).
\image html point3_3.png
It is also possible to define 3D coordinates of the point

View File

@ -46,6 +46,22 @@ id_edge = geompy.addToStudy(edge,"Edge_2")
# display an edge
gg.createAndDisplayGO(id_edge)
#
# create edge from existing curve and a length
#
# create a circle
c = geompy.MakeCircle(None, None, 100)
# create an edge of length 25.0 from the circle
edge = geompy.MakeEdgeOnCurveByLength(c, 25.0)
# add object in the study
id_edge = geompy.addToStudy(edge,"Edge_3")
# display an edge
gg.createAndDisplayGO(id_edge)
\endcode
\anchor tui_creation_wire

View File

@ -428,13 +428,15 @@ module GEOM
/*!
* Create a point, corresponding to the given length on the given curve.
* \param theRefCurve The referenced curve.
* \param theLength Length on the referenced curve.
* \param theReverse Direction for the calculation of the length (false = forward or true = reversed).
* \param theLength Length on the referenced curve. It can be negative.
* \param theStartPoint Any vertex close to one of edge's
* ends to select start point among them.
* If NULL, fist vertex is used.
* \return New GEOM_Object, containing the created point.
*/
GEOM_Object MakePointOnCurveByLength (in GEOM_Object theRefCurve,
in double theLength,
in boolean theReverse);
in double theLength,
in GEOM_Object theStartPoint);
/*!
* Create a point on the given curve, projecting given point
@ -1379,6 +1381,20 @@ module GEOM
*/
GEOM_Object MakeEdge (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
/*!
* Create an edge on another edge, corresponding to the given length on the given edge.
* \param theRefCurve The referenced edge.
* \param theLength Length on the referenced edge. It can be
* negative for extrapolation on base curve.
* \param theStartPoint Any vertex close to one of edge's
* ends to select start point among them.
* If NULL, fist vertex is used.
* \return New GEOM_Object, containing the created edge.
*/
GEOM_Object MakeEdgeOnCurveByLength (in GEOM_Object theRefCurve,
in double theLength,
in GEOM_Object theStartPoint);
/*!
* Create an edge from specified wire.
* \param theWire source Wire.
@ -3158,6 +3174,13 @@ module GEOM
boolean CheckShapeWithGeometry (in GEOM_Object theShape,
out string theDescription);
/*!
* Check if the given shape can be an argument for MakeSolid operation
* \param theShape Shape to be described.
* \return Empty string if a solid can be made on this shape, error code otherwise.
*/
string IsGoodForSolid (in GEOM_Object theShape);
/*!
* Obtain description of the given shape
* \param theShape Shape to be described.
@ -3193,6 +3216,13 @@ module GEOM
*/
double GetAngle (in GEOM_Object theShape1, in GEOM_Object theShape2);
/*!
* Get angle between the given vectors.
* \param theShape1,theShape2 Vectors to find angle between.
* \return Value of the angle between the given vectors.
*/
double GetAngleBtwVectors (in GEOM_Object theShape1, in GEOM_Object theShape2);
/*!
* Get point coordinates
*/

View File

@ -65,13 +65,16 @@ module GEOM
//-----------------------------------------------------------//
GEOM_Object MakePointXYZ (in double theX,
in double theY,
in double theZ) ;
in double theZ);
GEOM_Object MakePointWithReference (in GEOM_Object theReference,
in double theX,
in double theY,
in double theZ) ;
in double theZ);
GEOM_Object MakePointOnCurve (in GEOM_Object theRefCurve,
in double theParameter) ;
in double theParameter);
GEOM_Object MakePointOnCurveByLength (in GEOM_Object theRefCurve,
in double theLength,
in GEOM_Object theStartPoint);
GEOM_Object MakeTangentOnCurve (in GEOM_Object theRefCurve,
in double theParameter);
@ -368,6 +371,9 @@ module GEOM
//-----------------------------------------------------------//
GEOM_Object MakeEdge (in GEOM_Object thePnt1,
in GEOM_Object thePnt2) ;
GEOM_Object MakeEdgeOnCurveByLength (in GEOM_Object theRefCurve,
in double theLength,
in GEOM_Object theStartPoint);
GEOM_Object MakeWire (in GEOM_List theEdgesAndWires,
in double theTolerance) ;
GEOM_Object MakeFace (in GEOM_Object theWire,

View File

@ -47,7 +47,8 @@ box2points.png \
boxdxyz.png \
build_compound.png \
build_edge.png \
build_edge_wire.png \
build_edge_wire.png \
build_edge_curve.png \
build_face.png \
build_shell.png \
build_solid.png \

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

File diff suppressed because it is too large Load Diff

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : BasicGUI_PointDlg.h
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#ifndef BASICGUI_POINTDLG_H
#define BASICGUI_POINTDLG_H
@ -31,7 +30,7 @@
#include "GEOM_GenericObjPtr.h"
#include <QMap>
class DlgRef_1Sel1Spin1Check;
class DlgRef_2Sel1Spin;
class DlgRef_3Spin;
class DlgRef_2Sel;
class DlgRef_1Sel3Spin;
@ -87,7 +86,7 @@ private:
DlgRef_3Spin* GroupXYZ;
DlgRef_1Sel3Spin* GroupRefPoint;
DlgRef_1Sel1Spin1Check* GroupOnCurve;
DlgRef_2Sel1Spin* GroupOnCurve;
DlgRef_2Sel* GroupLineIntersection;
DlgRef_1Sel2Spin* GroupOnSurface;

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : BuildGUI_EdgeDlg.cxx
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#include "BuildGUI_EdgeDlg.h"
#include <DlgRef.h>
@ -48,9 +47,11 @@
BuildGUI_EdgeDlg::BuildGUI_EdgeDlg (GeometryGUI* theGeometryGUI, QWidget* parent)
: GEOMBase_Skeleton(theGeometryGUI, parent)
{
QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BUILD_EDGE")));
QPixmap image2 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BUILD_EDGE_WIRE")));
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_BUILD_EDGE")));
QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_BUILD_EDGE_WIRE")));
QPixmap image3 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_BUILD_EDGE_CURVE")));
setWindowTitle(tr("GEOM_EDGE_TITLE"));
@ -58,8 +59,7 @@ BuildGUI_EdgeDlg::BuildGUI_EdgeDlg (GeometryGUI* theGeometryGUI, QWidget* parent
mainFrame()->GroupConstructors->setTitle(tr("GEOM_EDGE"));
mainFrame()->RadioButton1->setIcon(image1);
mainFrame()->RadioButton2->setIcon(image2);
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
mainFrame()->RadioButton3->close();
mainFrame()->RadioButton3->setIcon(image3);
// two points
@ -79,22 +79,38 @@ BuildGUI_EdgeDlg::BuildGUI_EdgeDlg (GeometryGUI* theGeometryGUI, QWidget* parent
GroupWire->TextLabel1->setText(tr("GEOM_WIRE"));
GroupWire->PushButton1->setIcon(image0);
GroupWire->LineEdit1->setReadOnly(true);
GroupWire->TextLabel2->setText( tr( "GEOM_LINEAR_TOLERANCE" ) );
GroupWire->TextLabel3->setText( tr( "GEOM_ANGULAR_TOLERANCE" ) );
GroupWire->TextLabel2->setText(tr("GEOM_LINEAR_TOLERANCE"));
GroupWire->TextLabel3->setText(tr("GEOM_ANGULAR_TOLERANCE"));
double SpecificStep = 0.0001;
double prec1 = Precision::Confusion();
double prec2 = Precision::Angular();
initSpinBox(GroupWire->SpinBox_DX, prec1, MAX_NUMBER, SpecificStep, "len_tol_precision" );
initSpinBox(GroupWire->SpinBox_DY, prec2, MAX_NUMBER, SpecificStep, "ang_tol_precision" );
initSpinBox(GroupWire->SpinBox_DX, prec1, MAX_NUMBER, SpecificStep, "len_tol_precision");
initSpinBox(GroupWire->SpinBox_DY, prec2, MAX_NUMBER, SpecificStep, "ang_tol_precision");
GroupWire->SpinBox_DX->setValue(prec1);
GroupWire->SpinBox_DY->setValue(prec2);
// on curve
GroupOnCurve = new DlgRef_2Sel1Spin(centralWidget());
GroupOnCurve->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
GroupOnCurve->TextLabel1->setText(tr("GEOM_EDGE"));
GroupOnCurve->PushButton1->setIcon(image0);
GroupOnCurve->LineEdit1->setReadOnly(true);
GroupOnCurve->TextLabel2->setText(tr("GEOM_START_POINT"));
GroupOnCurve->PushButton2->setIcon(image0);
GroupOnCurve->LineEdit2->setReadOnly(true);
GroupOnCurve->TextLabel3->setText(tr("GEOM_LENGTH"));
double step = aResMgr->doubleValue("Geometry", "SettingsGeomStep", 100.0);
initSpinBox(GroupOnCurve->SpinBox_DX, COORD_MIN, COORD_MAX, step, "length_precision");
GroupOnCurve->SpinBox_DX->setValue(step);
// layout
QVBoxLayout* layout = new QVBoxLayout(centralWidget());
layout->setMargin(0); layout->setSpacing(6);
layout->addWidget(GroupPoints);
layout->addWidget(GroupWire);
layout->addWidget(GroupOnCurve);
/***************************************************************/
setHelpFileName("create_edge_page.html");
@ -122,30 +138,37 @@ void BuildGUI_EdgeDlg::Init()
myPoint1.nullify();
myPoint2.nullify();
myWire.nullify();
myCurve.nullify();
myStartPoint.nullify();
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->PushButton1->setDown(true);
globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
// signals and slots connections
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupWire->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupWire->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupOnCurve->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupOnCurve->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
this, SLOT( SelectionIntoArgument() ) );
connect(GroupOnCurve->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
this, SLOT(SelectionIntoArgument()));
initName(tr("GEOM_EDGE"));
ConstructorsClicked( 0 );
ConstructorsClicked(0);
}
//=================================================================================
@ -170,8 +193,8 @@ bool BuildGUI_EdgeDlg::ClickOnApply()
initName();
myEditCurrentArgument->setText( "" );
ConstructorsClicked( getConstructorId() );
myEditCurrentArgument->setText("");
ConstructorsClicked(getConstructorId());
return true;
}
@ -180,17 +203,17 @@ bool BuildGUI_EdgeDlg::ClickOnApply()
// function : ConstructorsClicked()
// purpose : Radio button management
//=================================================================================
void BuildGUI_EdgeDlg::ConstructorsClicked( int constructorId )
void BuildGUI_EdgeDlg::ConstructorsClicked(int constructorId)
{
switch ( constructorId ) {
switch (constructorId) {
case 0:
{
globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->LineEdit1->setText( "" );
GroupPoints->LineEdit2->setText( "" );
GroupPoints->LineEdit1->setText("");
GroupPoints->LineEdit2->setText("");
myPoint1.nullify();
myPoint2.nullify();
GroupPoints->PushButton1->setDown(true);
@ -199,12 +222,13 @@ void BuildGUI_EdgeDlg::ConstructorsClicked( int constructorId )
GroupPoints->LineEdit2->setEnabled(false);
GroupPoints->show();
GroupWire->hide();
GroupOnCurve->hide();
break;
}
case 1:
{
globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_WIRE );
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_WIRE);
myEditCurrentArgument = GroupWire->LineEdit1;
GroupWire->LineEdit1->setText("");
@ -212,14 +236,34 @@ void BuildGUI_EdgeDlg::ConstructorsClicked( int constructorId )
GroupWire->PushButton1->setDown(true);
GroupWire->LineEdit1->setEnabled(true);
GroupPoints->hide();
GroupOnCurve->hide();
GroupWire->show();
break;
}
case 2:
{
globalSelection(); // close local contexts, if any
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
myEditCurrentArgument = GroupOnCurve->LineEdit1;
GroupOnCurve->LineEdit1->setText("");
GroupOnCurve->LineEdit2->setText("");
myCurve.nullify();
myStartPoint.nullify();
GroupOnCurve->PushButton1->setDown(true);
GroupOnCurve->PushButton2->setDown(false);
GroupOnCurve->LineEdit1->setEnabled(true);
GroupOnCurve->LineEdit2->setEnabled(false);
GroupPoints->hide();
GroupWire->hide();
GroupOnCurve->show();
break;
}
}
qApp->processEvents();
updateGeometry();
resize( minimumSizeHint() );
resize(minimumSizeHint());
SelectionIntoArgument();
}
@ -237,36 +281,51 @@ void BuildGUI_EdgeDlg::SelectionIntoArgument()
aSelMgr->selectedObjects(aSelList);
if (aSelList.Extent() != 1) {
if (myEditCurrentArgument == GroupPoints->LineEdit1) myPoint1.nullify();
else if (myEditCurrentArgument == GroupPoints->LineEdit2) myPoint2.nullify();
else if (myEditCurrentArgument == GroupWire->LineEdit1) myWire.nullify();
if (myEditCurrentArgument == GroupPoints->LineEdit1) myPoint1.nullify();
else if (myEditCurrentArgument == GroupPoints->LineEdit2) myPoint2.nullify();
else if (myEditCurrentArgument == GroupWire->LineEdit1) myWire.nullify();
else if (myEditCurrentArgument == GroupOnCurve->LineEdit1) myCurve.nullify();
else if (myEditCurrentArgument == GroupOnCurve->LineEdit2) myStartPoint.nullify();
displayPreview(true);
return;
}
TopAbs_ShapeEnum aNeedType = myEditCurrentArgument == GroupWire->LineEdit1 ? TopAbs_WIRE : TopAbs_VERTEX;
GEOM::GeomObjPtr aSelectedObject = getSelected( aNeedType );
TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
if (myEditCurrentArgument == GroupWire->LineEdit1) aNeedType = TopAbs_WIRE;
else if (myEditCurrentArgument == GroupOnCurve->LineEdit1) aNeedType = TopAbs_EDGE;
GEOM::GeomObjPtr aSelectedObject = getSelected(aNeedType);
TopoDS_Shape aShape;
if ( aSelectedObject && GEOMBase::GetShape( aSelectedObject.get(), aShape ) && !aShape.IsNull() ) {
QString aName = GEOMBase::GetName( aSelectedObject.get() );
myEditCurrentArgument->setText( aName );
if (aSelectedObject && GEOMBase::GetShape(aSelectedObject.get(), aShape) && !aShape.IsNull()) {
QString aName = GEOMBase::GetName(aSelectedObject.get());
myEditCurrentArgument->setText(aName);
globalSelection();
localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
localSelection(GEOM::GEOM_Object::_nil(), aNeedType);
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
myPoint1 = aSelectedObject;
if ( myPoint1 && !myPoint2 )
if (myPoint1 && !myPoint2)
GroupPoints->PushButton2->click();
}
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
myPoint2 = aSelectedObject;
if ( myPoint2 && !myPoint1 )
if (myPoint2 && !myPoint1)
GroupPoints->PushButton1->click();
}
else if ( myEditCurrentArgument == GroupWire->LineEdit1 ) {
else if (myEditCurrentArgument == GroupWire->LineEdit1) {
myWire = aSelectedObject;
}
else if (myEditCurrentArgument == GroupOnCurve->LineEdit1) {
myCurve = aSelectedObject;
if (myCurve && !myStartPoint)
GroupOnCurve->PushButton2->click();
}
else if (myEditCurrentArgument == GroupOnCurve->LineEdit2) {
myStartPoint = aSelectedObject;
if (myStartPoint && !myCurve)
GroupOnCurve->PushButton1->click();
}
}
displayPreview(true);
@ -293,6 +352,22 @@ void BuildGUI_EdgeDlg::SetEditCurrentArgument()
else if (send == GroupWire->PushButton1) {
myEditCurrentArgument = GroupWire->LineEdit1;
}
else if (send == GroupOnCurve->PushButton1) {
myEditCurrentArgument = GroupOnCurve->LineEdit1;
GroupOnCurve->PushButton2->setDown(false);
GroupOnCurve->LineEdit2->setEnabled(false);
globalSelection(); // close local contexts, if any
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
}
else if (send == GroupOnCurve->PushButton2) {
myEditCurrentArgument = GroupOnCurve->LineEdit2;
GroupOnCurve->PushButton1->setDown(false);
GroupOnCurve->LineEdit1->setEnabled(false);
globalSelection(); // close local contexts, if any
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
}
// enable line edit
myEditCurrentArgument->setEnabled(true);
@ -309,10 +384,10 @@ void BuildGUI_EdgeDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
this, SLOT( SelectionIntoArgument() ) );
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
this, SLOT(SelectionIntoArgument()));
ConstructorsClicked( getConstructorId() );
ConstructorsClicked(getConstructorId());
}
//=================================================================================
@ -325,6 +400,15 @@ void BuildGUI_EdgeDlg::enterEvent (QEvent*)
ActivateThisDialog();
}
//=================================================================================
// function : ValueChangedInSpinBox()
// purpose :
//=================================================================================
void BuildGUI_EdgeDlg::ValueChangedInSpinBox(double newValue)
{
displayPreview(true);
}
//=================================================================================
// function : createOperation
// purpose :
@ -341,15 +425,19 @@ GEOM::GEOM_IOperations_ptr BuildGUI_EdgeDlg::createOperation()
bool BuildGUI_EdgeDlg::isValid (QString& msg)
{
bool ok = false;
switch ( getConstructorId() ) {
switch (getConstructorId()) {
case 0:
ok = myPoint1 && myPoint2;
break;
case 1:
ok = GroupWire->SpinBox_DX->isValid( msg, !IsPreview() ) &&
GroupWire->SpinBox_DY->isValid( msg, !IsPreview() ) &&
ok = GroupWire->SpinBox_DX->isValid(msg, !IsPreview()) &&
GroupWire->SpinBox_DY->isValid(msg, !IsPreview()) &&
myWire;
break;
case 2:
ok = GroupOnCurve->SpinBox_DX->isValid(msg, !IsPreview()) &&
myCurve;
break;
default:
break;
}
@ -365,12 +453,12 @@ bool BuildGUI_EdgeDlg::execute (ObjectList& objects)
bool res = false;
GEOM::GEOM_Object_var anObj;
GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
switch ( getConstructorId() ) {
case 0 :
switch (getConstructorId()) {
case 0:
{
anObj = anOper->MakeEdge( myPoint1.get(), myPoint2.get() );
anObj = anOper->MakeEdge(myPoint1.get(), myPoint2.get());
res = true;
break;
}
@ -383,17 +471,29 @@ bool BuildGUI_EdgeDlg::execute (ObjectList& objects)
aParameters << GroupWire->SpinBox_DX->text();
aParameters << GroupWire->SpinBox_DY->text();
anObj = anOper->MakeEdgeWire( myWire.get(), aLinearTolerance, anAngularTolerance );
anObj = anOper->MakeEdgeWire(myWire.get(), aLinearTolerance, anAngularTolerance);
if ( !anObj->_is_nil() && !IsPreview() )
anObj->SetParameters( aParameters.join(":").toLatin1().constData() );
if (!anObj->_is_nil() && !IsPreview())
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
res = true;
break;
}
case 2:
{
double aLength = GroupOnCurve->SpinBox_DX->value();
anObj = anOper->MakeEdgeOnCurveByLength(myCurve.get(), aLength, myStartPoint.get());
if (!anObj->_is_nil() && !IsPreview())
anObj->SetParameters(GroupOnCurve->SpinBox_DX->text().toLatin1().constData());
res = true;
break;
}
}
if ( !anObj->_is_nil() ) objects.push_back( anObj._retn() );
if (!anObj->_is_nil()) objects.push_back(anObj._retn());
return res;
}
@ -404,13 +504,17 @@ bool BuildGUI_EdgeDlg::execute (ObjectList& objects)
//=================================================================================
void BuildGUI_EdgeDlg::addSubshapesToStudy()
{
switch ( getConstructorId() ) {
case 0 :
GEOMBase::PublishSubObject( myPoint1.get() );
GEOMBase::PublishSubObject( myPoint2.get() );
switch (getConstructorId()) {
case 0:
GEOMBase::PublishSubObject(myPoint1.get());
GEOMBase::PublishSubObject(myPoint2.get());
break;
case 1 :
GEOMBase::PublishSubObject( myWire.get() );
case 1:
GEOMBase::PublishSubObject(myWire.get());
break;
case 2:
GEOMBase::PublishSubObject(myCurve.get());
GEOMBase::PublishSubObject(myStartPoint.get());
break;
default:
break;

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : BuildGUI_EdgeDlg.h
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
#ifndef BUILDGUI_EDGEDLG_H
#define BUILDGUI_EDGEDLG_H
@ -32,6 +31,7 @@
class DlgRef_1Sel2Spin;
class DlgRef_2Sel;
class DlgRef_2Sel1Spin;
//=================================================================================
// class : BuildGUI_EdgeDlg
@ -42,34 +42,38 @@ class BuildGUI_EdgeDlg : public GEOMBase_Skeleton
Q_OBJECT
public:
BuildGUI_EdgeDlg( GeometryGUI*, QWidget* = 0 );
BuildGUI_EdgeDlg (GeometryGUI*, QWidget* = 0);
~BuildGUI_EdgeDlg();
protected:
// redefined from GEOMBase_Helper
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
virtual bool isValid (QString&);
virtual bool execute (ObjectList&);
virtual void addSubshapesToStudy();
private:
void Init();
void enterEvent( QEvent* );
void enterEvent (QEvent*);
private:
GEOM::GeomObjPtr myPoint1, myPoint2; /* Points containing the edge */
GEOM::GeomObjPtr myPoint1, myPoint2; /* Points */
GEOM::GeomObjPtr myWire; /* Wire */
GEOM::GeomObjPtr myCurve; /* Edge */
GEOM::GeomObjPtr myStartPoint; /* Point */
DlgRef_2Sel* GroupPoints;
DlgRef_1Sel2Spin* GroupWire;
DlgRef_2Sel1Spin* GroupOnCurve;
private slots:
void ConstructorsClicked( int );
void ConstructorsClicked (int);
void ClickOnOk();
bool ClickOnApply();
void ActivateThisDialog();
void SelectionIntoArgument();
void SetEditCurrentArgument();
void ValueChangedInSpinBox (double);
};
#endif // BUILDGUI_EDGEDLG_H

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : BuildGUI_SolidDlg.cxx
// Author : Damien COQUERET, Open CASCADE S.A.S.
//
#include "BuildGUI_SolidDlg.h"
#include <DlgRef.h>
@ -38,6 +37,8 @@
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
#include <TColStd_MapOfInteger.hxx>
//=================================================================================
// class : BuildGUI_SolidDlg()
// purpose : Constructs a BuildGUI_SolidDlg which is a child of 'parent', with the
@ -104,7 +105,13 @@ void BuildGUI_SolidDlg::Init()
myShells.clear();
globalSelection( GEOM_SHELL );
//globalSelection( GEOM_SHELL );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_SHELL );
aMap.Add( GEOM_COMPOUNDFILTER );
QList<int> aSubShapes;
aSubShapes.append( GEOM_SHELL );
globalSelection( aMap, aSubShapes );
/* signals and slots connections */
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
@ -154,7 +161,10 @@ void BuildGUI_SolidDlg::SelectionIntoArgument()
{
myEditCurrentArgument->setText( "" );
myShells = getSelected( TopAbs_SHELL, -1 );
//myShells = getSelected( TopAbs_SHELL, -1 );
QList<TopAbs_ShapeEnum> types;
types << TopAbs_SHELL << TopAbs_COMPOUND;
myShells = getSelected( types, -1 );
if ( !myShells.isEmpty() ) {
QString aName = myShells.count() > 1 ? QString( "%1_objects").arg( myShells.count() ) : GEOMBase::GetName( myShells[0].get() );
@ -172,7 +182,14 @@ void BuildGUI_SolidDlg::SetEditCurrentArgument()
if ( send != GroupSolid->PushButton1 )
return;
globalSelection( GEOM_SHELL );
//globalSelection( GEOM_SHELL );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_SHELL );
aMap.Add( GEOM_COMPOUNDFILTER );
QList<int> aSubShapes;
aSubShapes.append( GEOM_SHELL );
globalSelection( aMap, aSubShapes );
myEditCurrentArgument = GroupSolid->LineEdit1;
myEditCurrentArgument->setFocus();
@ -189,7 +206,14 @@ void BuildGUI_SolidDlg::ActivateThisDialog()
GEOMBase_Skeleton::ActivateThisDialog();
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
globalSelection( GEOM_SHELL );
//globalSelection( GEOM_SHELL );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_SHELL );
aMap.Add( GEOM_COMPOUNDFILTER );
QList<int> aSubShapes;
aSubShapes.append( GEOM_SHELL );
globalSelection( aMap, aSubShapes );
}
@ -226,17 +250,24 @@ GEOM::GEOM_IOperations_ptr BuildGUI_SolidDlg::createOperation()
// function : isValid
// purpose :
//=================================================================================
bool BuildGUI_SolidDlg::isValid( QString& msg )
bool BuildGUI_SolidDlg::isValid (QString& msg)
{
bool ok = !myShells.isEmpty();
GEOM::MeasureOpPtr anOp;
anOp.take(myGeomGUI->GetGeomGen()->GetIMeasureOperations(getStudyId()));
for ( int i = 0, n = myShells.count(); i < n && ok; i++ ) {
ok = isClosed( myShells[i].get() );
if ( !ok )
msg = QObject::tr("WRN_SHAPE_UNCLOSED").arg( GEOMBase::GetName( myShells[i].get() ) );
CORBA::String_var aRes = anOp->IsGoodForSolid(myShells[i].get());
if (strlen(aRes.in())) {
msg = QObject::tr(aRes.in()).arg(GEOMBase::GetName(myShells[i].get()));
ok = false;
}
}
return ok;
}
/*
//=================================================================================
// function : isClosed
// purpose : Check the object 'i' in myShells list is closed or unclosed
@ -258,9 +289,9 @@ bool BuildGUI_SolidDlg::isClosed( GEOM::GEOM_Object_ptr shell )
if ( anOp->IsDone() ) {
if ( anInts[0] == 1 )
ok = true;
ok = true;
else if ( anInts[0] == 2 )
ok = false;
ok = false;
}
else {
MESSAGE ("KindOfShape Operation is NOT DONE!!!");
@ -272,6 +303,7 @@ bool BuildGUI_SolidDlg::isClosed( GEOM::GEOM_Object_ptr shell )
return ok;
}
*/
//=================================================================================
// function : execute
@ -303,4 +335,3 @@ bool BuildGUI_SolidDlg::execute( ObjectList& objects )
return true;
}

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : BuildGUI_SolidDlg.h
// Author : Damien COQUERET, Open CASCADE S.A.S.
//
#ifndef BUILDGUI_SOLIDDLG_H
#define BUILDGUI_SOLIDDLG_H
@ -52,7 +51,7 @@ protected:
private:
void Init();
bool isClosed( GEOM::GEOM_Object_ptr shell );
//bool isClosed( GEOM::GEOM_Object_ptr shell );
void enterEvent( QEvent* );
private:

View File

@ -18,7 +18,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : EntityGUI_SubShapeDlg.cxx
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.

View File

@ -113,6 +113,10 @@
<source>ICON_DLG_BUILD_EDGE_WIRE</source>
<translation>build_edge_wire.png</translation>
</message>
<message>
<source>ICON_DLG_BUILD_EDGE_CURVE</source>
<translation>build_edge_curve.png</translation>
</message>
<message>
<source>ICON_DLG_BUILD_FACE</source>
<translation>build_face.png</translation>

View File

@ -1205,6 +1205,10 @@ Please, select face, shell or solid and try again</translation>
<source>GEOM_POINT_TITLE</source>
<translation>Point Construction</translation>
</message>
<message>
<source>GEOM_START_POINT</source>
<translation>Start Point</translation>
</message>
<message>
<source>GEOM_POLYLINE</source>
<translation>Polyline</translation>
@ -2085,6 +2089,14 @@ Please, select face, shell or solid and try again</translation>
<source>WRN_SHAPE_UNCLOSED</source>
<translation>Unable to create solid from unclosed shape %1</translation>
</message>
<message>
<source>WRN_SHAPE_NOT_SHELL</source>
<translation>Unable to create solid from shape %1 as it is not a shell</translation>
</message>
<message>
<source>WRN_NULL_OBJECT_OR_SHAPE</source>
<translation>Shape %1 for solid creation is null</translation>
</message>
<message>
<source>GEOM_X</source>
<translation>X :</translation>

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx>
@ -192,7 +191,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::makePointOnGeom
double theParam2,
double theParam3,
const PointLocation theLocation,
bool theReverse)
Handle(GEOM_Object) theRefPoint)
{
SetErrorCode(KO);
@ -231,7 +230,10 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::makePointOnGeom
case PointOn_CurveByLength:
aPI.SetCurve(aRefFunction);
aPI.SetLength(theParam1);
aPI.SetReversed(theReverse);
if (!theRefPoint.IsNull()) {
Handle(GEOM_Function) aRefPoint = theRefPoint->GetLastFunction();
aPI.SetRef(aRefPoint);
}
break;
case PointOn_CurveByCoord:
aPI.SetCurve(aRefFunction);
@ -277,7 +279,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::makePointOnGeom
break;
case PointOn_CurveByLength:
GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnCurveByLength("
<< theGeomObj << ", " << theParam1 << ", " << theReverse << ")";
<< theGeomObj << ", " << theParam1 << ", " << theRefPoint << ")";
break;
case PointOn_CurveByCoord:
GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnCurveByCoord("
@ -332,10 +334,10 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurveByCoord
//=============================================================================
Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurveByLength
(Handle(GEOM_Object) theCurve,
double theLength,
bool theReverse)
double theLength,
Handle(GEOM_Object) theStartPoint)
{
return makePointOnGeom(theCurve, theLength, 0.0, 0.0, PointOn_CurveByLength, theReverse);
return makePointOnGeom(theCurve, theLength, 0.0, 0.0, PointOn_CurveByLength, theStartPoint);
}
//=============================================================================

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _GEOMImpl_IBasicOperations_HXX_
#define _GEOMImpl_IBasicOperations_HXX_
@ -44,8 +43,8 @@ class GEOMImpl_IBasicOperations : public GEOM_IOperations {
double theParameter);
Standard_EXPORT Handle(GEOM_Object) MakePointOnCurveByLength (Handle(GEOM_Object) theCurve,
double theLength,
bool theReverse);
double theLength,
Handle(GEOM_Object) theStartPoint);
Standard_EXPORT Handle(GEOM_Object) MakePointOnCurveByCoord (Handle(GEOM_Object) theCurve,
double theXParam,
@ -136,7 +135,7 @@ class GEOMImpl_IBasicOperations : public GEOM_IOperations {
double theParam2,
double theParam3,
const PointLocation theLocation,
bool theReverse = false);
Handle(GEOM_Object) theRefPoint = 0);
};
#endif

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifdef WNT
#pragma warning( disable:4786 )
@ -35,6 +34,7 @@
#include <GEOMImpl_IBlockTrsf.hxx>
#include <GEOMImpl_CopyDriver.hxx>
#include <GEOMImpl_Block6Explorer.hxx>
#include <GEOMImpl_IShapesOperations.hxx>
#include <GEOM_Function.hxx>
#include <GEOM_PythonDump.hxx>
@ -3283,6 +3283,10 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IBlocksOperations::Propagate
TopTools_MapOfShape mapAcceptedEdges;
TCollection_AsciiString aListRes, anEntry;
// Sort shapes in current chain (Mantis issue 21053)
TopTools_DataMapOfShapeListOfShape aMapChains;
TopTools_ListOfShape aFirstInChains;
for (ie = 1; ie <= nbEdges; ie++) {
TopoDS_Shape curE = MEW.FindKey(ie);
@ -3343,6 +3347,21 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IBlocksOperations::Propagate
listPrevEdges = listCurEdges;
} // while (listPrevEdges.Extent() > 0)
// Sort shapes in current chain (Mantis issue 21053)
GEOMImpl_IShapesOperations::SortShapes(currentChain, Standard_False);
aFirstInChains.Append(currentChain.First());
aMapChains.Bind(currentChain.First(), currentChain);
}
// Sort chains (Mantis issue 21053)
GEOMImpl_IShapesOperations::SortShapes(aFirstInChains, Standard_False);
// Store sorted chains in the document
TopTools_ListIteratorOfListOfShape aChainsIt (aFirstInChains);
for (; aChainsIt.More(); aChainsIt.Next()) {
TopoDS_Shape aFirstInChain = aChainsIt.Value();
const TopTools_ListOfShape& currentChain = aMapChains.Find(aFirstInChain);
// Store the chain in the document
Handle(TColStd_HArray1OfInteger) anArray =
new TColStd_HArray1OfInteger (1, currentChain.Extent());

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx>
@ -60,6 +59,7 @@
#include <GProp_PrincipalProps.hxx>
#include <TopAbs.hxx>
#include <TopExp.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
@ -1299,6 +1299,53 @@ bool GEOMImpl_IMeasureOperations::CheckShape (Handle(GEOM_Object) theShape,
return isValid;
}
//=============================================================================
/*!
* IsGoodForSolid
*/
//=============================================================================
TCollection_AsciiString GEOMImpl_IMeasureOperations::IsGoodForSolid (Handle(GEOM_Object) theShape)
{
SetErrorCode(KO);
TCollection_AsciiString aRes = "";
if (theShape.IsNull()) {
aRes = "WRN_NULL_OBJECT_OR_SHAPE";
}
else {
Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
if (aRefShape.IsNull()) {
aRes = "WRN_NULL_OBJECT_OR_SHAPE";
}
else {
TopoDS_Shape aShape = aRefShape->GetValue();
if (aShape.IsNull()) {
aRes = "WRN_NULL_OBJECT_OR_SHAPE";
}
else {
if (aShape.ShapeType() == TopAbs_COMPOUND) {
TopoDS_Iterator It (aShape, Standard_True, Standard_True);
if (It.More()) aShape = It.Value();
}
if (aShape.ShapeType() == TopAbs_SHELL) {
if (!aShape.Closed()) {
aRes = "WRN_SHAPE_UNCLOSED";
}
}
else {
aRes = "WRN_SHAPE_NOT_SHELL";
}
}
}
}
if (aRes.IsEmpty())
SetErrorCode(OK);
return aRes;
}
//=============================================================================
/*!
* WhatIs
@ -1686,8 +1733,8 @@ static bool CheckSingularCase(const TopoDS_Shape& aSh1,
*/
//=============================================================================
std::vector<bool> GEOMImpl_IMeasureOperations::AreCoordsInside(Handle(GEOM_Object) theShape,
const std::vector<double>& coords,
double tolerance)
const std::vector<double>& coords,
double tolerance)
{
std::vector<bool> res;
if (!theShape.IsNull()) {
@ -1695,16 +1742,16 @@ std::vector<bool> GEOMImpl_IMeasureOperations::AreCoordsInside(Handle(GEOM_Objec
if (!aRefShape.IsNull()) {
TopoDS_Shape aShape = aRefShape->GetValue();
if (!aShape.IsNull()) {
BRepClass3d_SolidClassifier SC(aShape);
unsigned int nb_points = coords.size()/3;
for (int i = 0; i < nb_points; i++) {
double x = coords[3*i];
double y = coords[3*i+1];
double z = coords[3*i+2];
gp_Pnt aPnt(x, y, z);
SC.Perform(aPnt, tolerance);
res.push_back( ( SC.State() == TopAbs_IN ) || ( SC.State() == TopAbs_ON ) );
}
BRepClass3d_SolidClassifier SC(aShape);
unsigned int nb_points = coords.size()/3;
for (int i = 0; i < nb_points; i++) {
double x = coords[3*i];
double y = coords[3*i+1];
double z = coords[3*i+2];
gp_Pnt aPnt(x, y, z);
SC.Perform(aPnt, tolerance);
res.push_back( ( SC.State() == TopAbs_IN ) || ( SC.State() == TopAbs_ON ) );
}
}
}
}
@ -1912,6 +1959,72 @@ Standard_Real GEOMImpl_IMeasureOperations::GetAngle (Handle(GEOM_Object) theLine
anAngle = aLin1.Angle(aLin2);
anAngle /= PI180; // convert radians into degrees
if (anAngle > 90.0) {
anAngle = 180.0 - anAngle;
}
SetErrorCode(OK);
}
catch (Standard_Failure)
{
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString());
}
return anAngle;
}
//=======================================================================
/*!
* Compute angle (in degrees) between two vectors
*/
//=======================================================================
Standard_Real GEOMImpl_IMeasureOperations::GetAngleBtwVectors (Handle(GEOM_Object) theVec1,
Handle(GEOM_Object) theVec2)
{
SetErrorCode(KO);
Standard_Real anAngle = -1.0;
if (theVec1.IsNull() || theVec2.IsNull())
return anAngle;
Handle(GEOM_Function) aRefVec1 = theVec1->GetLastFunction();
Handle(GEOM_Function) aRefVec2 = theVec2->GetLastFunction();
if (aRefVec1.IsNull() || aRefVec2.IsNull())
return anAngle;
TopoDS_Shape aVec1 = aRefVec1->GetValue();
TopoDS_Shape aVec2 = aRefVec2->GetValue();
if (aVec1.IsNull() || aVec2.IsNull() ||
aVec1.ShapeType() != TopAbs_EDGE ||
aVec2.ShapeType() != TopAbs_EDGE)
{
SetErrorCode("Two edges must be given");
return anAngle;
}
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
TopoDS_Edge aE1 = TopoDS::Edge(aVec1);
TopoDS_Edge aE2 = TopoDS::Edge(aVec2);
TopoDS_Vertex aP11, aP12, aP21, aP22;
TopExp::Vertices(aE1, aP11, aP12, Standard_True);
TopExp::Vertices(aE2, aP21, aP22, Standard_True);
if (aP11.IsNull() || aP12.IsNull() || aP21.IsNull() || aP22.IsNull()) {
SetErrorCode("Bad edge given");
return anAngle;
}
gp_Vec aV1 (BRep_Tool::Pnt(aP11), BRep_Tool::Pnt(aP12));
gp_Vec aV2 (BRep_Tool::Pnt(aP21), BRep_Tool::Pnt(aP22)) ;
anAngle = aV1.Angle(aV2);
anAngle /= PI180; // convert radians into degrees
SetErrorCode(OK);
}
catch (Standard_Failure)

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _GEOMImpl_IMeasureOperations_HXX_
#define _GEOMImpl_IMeasureOperations_HXX_
@ -127,11 +126,13 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
const Standard_Boolean theIsCheckGeom,
TCollection_AsciiString& theDump);
Standard_EXPORT TCollection_AsciiString IsGoodForSolid (Handle(GEOM_Object) theShape);
Standard_EXPORT TCollection_AsciiString WhatIs (Handle(GEOM_Object) theShape);
Standard_EXPORT std::vector<bool> AreCoordsInside (Handle(GEOM_Object) theShape,
const std::vector<double>& coords,
double tolerance = Precision::Confusion());
const std::vector<double>& coords,
double tolerance = Precision::Confusion());
Standard_EXPORT Standard_Real GetMinDistance (Handle(GEOM_Object) theShape1,
Handle(GEOM_Object) theShape2,
@ -143,6 +144,8 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
Standard_EXPORT Standard_Real GetAngle (Handle(GEOM_Object) theLine1, Handle(GEOM_Object) theLine2);
Standard_EXPORT Standard_Real GetAngleBtwVectors (Handle(GEOM_Object) theVec1, Handle(GEOM_Object) theVec2);
// Methods for recieving radiuses of curvature of curves and surfaces
// in the given point

View File

@ -18,10 +18,9 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//NOTE: This is an intreface to a function for the point creation.
//
//NOTE: This is an interface to a function for the point creation.
#include "GEOM_Function.hxx"
#define ARG_X 1
@ -40,7 +39,7 @@
#define ARG_LENGTH 11
#define ARG_FLAG 12
//#define ARG_FLAG 12
class GEOMImpl_IPoint
{
@ -73,12 +72,12 @@ class GEOMImpl_IPoint
void SetParameter(double theParam) { _func->SetReal(ARG_PARAM, theParam); }
void SetParameter2(double theParam) { _func->SetReal(ARG_PARAM2, theParam); }
void SetLength(double theLength) { _func->SetReal(ARG_LENGTH, theLength); }
void SetReversed(bool theReversed) { _func->SetInteger(ARG_FLAG, theReversed); }
//void SetReversed(bool theReversed) { _func->SetInteger(ARG_FLAG, theReversed); }
double GetParameter() { return _func->GetReal(ARG_PARAM); }
double GetParameter2() { return _func->GetReal(ARG_PARAM2); }
double GetLength() { return _func->GetReal(ARG_LENGTH); }
bool GetReversed() { return _func->GetInteger(ARG_FLAG); }
//bool GetReversed() { return _func->GetInteger(ARG_FLAG); }
private:

View File

@ -18,11 +18,10 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NOTE: This is an intreface to a function for the Shapes
// (Wire, Face, Shell, Solid and Compound) creation.
//
// NOTE: This is an interface to a function for the Shapes
// (Edge, Wire, Face, Shell, Solid and Compound) creation.
#include "GEOM_Function.hxx"
#include "TColStd_HSequenceOfTransient.hxx"

View File

@ -18,7 +18,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : GEOMImpl_IShapesOperations.cxx
// Created :
// Author : modified by Lioka RAZAFINDRAZAKA (CEA) 22/06/2007
@ -209,6 +209,67 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeEdge
return anEdge;
}
//=============================================================================
/*!
* MakeEdgeOnCurveByLength
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeEdgeOnCurveByLength
(Handle(GEOM_Object) theRefCurve,
const Standard_Real theLength,
Handle(GEOM_Object) theStartPoint)
{
SetErrorCode(KO);
if (theRefCurve.IsNull()) return NULL;
//Add a new Edge object
Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE);
//Add a new Vector function
Handle(GEOM_Function) aFunction =
anEdge->AddFunction(GEOMImpl_ShapeDriver::GetID(), EDGE_CURVE_LENGTH);
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) return NULL;
GEOMImpl_IVector aPI (aFunction);
Handle(GEOM_Function) aRef1 = theRefCurve->GetLastFunction();
if (aRef1.IsNull()) return NULL;
aPI.SetPoint1(aRef1);
if (!theStartPoint.IsNull()) {
Handle(GEOM_Function) aRef2 = theStartPoint->GetLastFunction();
aPI.SetPoint2(aRef2);
}
aPI.SetParameter(theLength);
//Compute the Edge value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Vector driver failed");
return NULL;
}
}
catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString());
return NULL;
}
//Make a Python command
GEOM::TPythonDump(aFunction) << anEdge << " = geompy.MakeEdgeOnCurveByLength("
<< theRefCurve << ", " << theLength << ", " << theStartPoint << ")";
SetErrorCode(OK);
return anEdge;
}
//=============================================================================
/*!
* MakeEdgeWire
@ -4089,7 +4150,17 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetSame(const Handle(GEOM_Object
TopoDS_Shape aSubShape;
TopTools_MapOfShape aMap;
switch(aWhat.ShapeType()) {
if (aWhat.ShapeType() == TopAbs_COMPOUND || aWhat.ShapeType() == TopAbs_COMPSOLID) {
TopoDS_Iterator It (aWhat, Standard_True, Standard_True);
if (It.More()) aWhat = It.Value();
It.Next();
if (It.More()) {
SetErrorCode("Compounds of two or more shapes are not allowed for aWhat argument");
return NULL;
}
}
switch (aWhat.ShapeType()) {
case TopAbs_VERTEX: {
gp_Pnt P = BRep_Tool::Pnt(TopoDS::Vertex(aWhat));
TopExp_Explorer E(aWhere, TopAbs_VERTEX);
@ -4104,12 +4175,12 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetSame(const Handle(GEOM_Object
}
break;
}
case TopAbs_FACE: {
TopoDS_Face aFace = TopoDS::Face(aWhat);
TopExp_Explorer E(aWhere, TopAbs_FACE);
case TopAbs_EDGE: {
TopoDS_Edge anEdge = TopoDS::Edge(aWhat);
TopExp_Explorer E(aWhere, TopAbs_EDGE);
for(; E.More(); E.Next()) {
if(!aMap.Add(E.Current())) continue;
if(isSameFace(aFace, TopoDS::Face(E.Current()))) {
if(isSameEdge(anEdge, TopoDS::Edge(E.Current()))) {
aSubShape = E.Current();
isFound = true;
break;
@ -4117,12 +4188,12 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetSame(const Handle(GEOM_Object
}
break;
}
case TopAbs_EDGE: {
TopoDS_Edge anEdge = TopoDS::Edge(aWhat);
TopExp_Explorer E(aWhere, TopAbs_EDGE);
case TopAbs_FACE: {
TopoDS_Face aFace = TopoDS::Face(aWhat);
TopExp_Explorer E(aWhere, TopAbs_FACE);
for(; E.More(); E.Next()) {
if(!aMap.Add(E.Current())) continue;
if(isSameEdge(anEdge, TopoDS::Edge(E.Current()))) {
if(isSameFace(aFace, TopoDS::Face(E.Current()))) {
aSubShape = E.Current();
isFound = true;
break;
@ -4147,14 +4218,14 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetSame(const Handle(GEOM_Object
return NULL;
}
if(isFound) {
if (isFound) {
TopTools_IndexedMapOfShape anIndices;
TopExp::MapShapes(aWhere, anIndices);
if (anIndices.Contains(aSubShape))
anIndex = anIndices.FindIndex(aSubShape);
}
if(anIndex < 0) return NULL;
if (anIndex < 0) return NULL;
Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger(1,1);

View File

@ -54,6 +54,11 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
Standard_EXPORT Handle(GEOM_Object) MakeEdge (Handle(GEOM_Object) thePoint1,
Handle(GEOM_Object) thePoint2);
Standard_EXPORT Handle(GEOM_Object) MakeEdgeOnCurveByLength (Handle(GEOM_Object) theCurve,
const Standard_Real theLength,
Handle(GEOM_Object) theStartPoint);
Standard_EXPORT Handle(GEOM_Object) MakeEdgeWire (Handle(GEOM_Object) theWire,
const Standard_Real theLinearTolerance,
const Standard_Real theAngularTolerance);

View File

@ -18,10 +18,9 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//NOTE: This is an intreface to a function for the vector creation.
//
//NOTE: This is an interface to a function for the vector creation.
#include "GEOM_Function.hxx"
#define VEC_ARG_DX 1

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx>
@ -27,28 +26,35 @@
#include <GEOMImpl_Types.hxx>
#include <GEOM_Function.hxx>
#include <ShapeAnalysis.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
#include <BRep_Builder.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <Precision.hxx>
#include <TopAbs.hxx>
#include <TopExp.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Compound.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <gp_Pnt.hxx>
#include <TopoDS_Face.hxx>
#include <ShapeAnalysis.hxx>
#include <GCPnts_AbscissaPoint.hxx>
#include <IntTools.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <gp_Pnt.hxx>
#include <Precision.hxx>
#include <Standard_NullObject.hxx>
//=======================================================================
//function : GetID
//purpose :
@ -73,23 +79,22 @@ GEOMImpl_PointDriver::GEOMImpl_PointDriver()
//purpose : local function
//=======================================================================
static Standard_Boolean getExtremaSolution
(GEOMImpl_IPoint& thePI,
TopoDS_Shape& theRefShape,
(const gp_Pnt& theInitPnt,
const TopoDS_Shape& theRefShape,
gp_Pnt& thePnt)
{
gp_Pnt anInitPnt( thePI.GetX(), thePI.GetY(), thePI.GetZ() );
BRepBuilderAPI_MakeVertex mkVertex (anInitPnt);
BRepBuilderAPI_MakeVertex mkVertex (theInitPnt);
TopoDS_Vertex anInitV = TopoDS::Vertex(mkVertex.Shape());
BRepExtrema_DistShapeShape anExt( anInitV, theRefShape );
BRepExtrema_DistShapeShape anExt (anInitV, theRefShape);
if ( !anExt.IsDone() || anExt.NbSolution() < 1 )
return Standard_False;
thePnt = anExt.PointOnShape2(1);
Standard_Real aMinDist2 = anInitPnt.SquareDistance( thePnt );
Standard_Real aMinDist2 = theInitPnt.SquareDistance( thePnt );
for ( Standard_Integer j = 2, jn = anExt.NbSolution(); j <= jn; j++ )
{
gp_Pnt aPnt = anExt.PointOnShape2(j);
Standard_Real aDist2 = anInitPnt.SquareDistance( aPnt );
Standard_Real aDist2 = theInitPnt.SquareDistance( aPnt );
if ( aDist2 > aMinDist2)
continue;
aMinDist2 = aDist2;
@ -116,10 +121,8 @@ Standard_Integer GEOMImpl_PointDriver::Execute(TFunction_Logbook& log) const
if (aType == POINT_XYZ) {
aPnt = gp_Pnt(aPI.GetX(), aPI.GetY(), aPI.GetZ());
}
else if (aType == POINT_XYZ_REF) {
Handle(GEOM_Function) aRefPoint = aPI.GetRef();
TopoDS_Shape aRefShape = aRefPoint->GetValue();
if (aRefShape.ShapeType() != TopAbs_VERTEX) {
@ -148,35 +151,72 @@ Standard_Integer GEOMImpl_PointDriver::Execute(TFunction_Logbook& log) const
Standard_TypeMismatch::Raise
("Point On Curve creation aborted : curve shape is not an edge");
}
if (!getExtremaSolution( aPI, aRefShape, aPnt ) ) {
gp_Pnt anInitPnt (aPI.GetX(), aPI.GetY(), aPI.GetZ());
if (!getExtremaSolution(anInitPnt, aRefShape, aPnt)) {
Standard_ConstructionError::Raise
("Point On Curve creation aborted : cannot project point");
}
}
else if (aType == POINT_CURVE_LENGTH) {
// RefCurve
Handle(GEOM_Function) aRefCurve = aPI.GetCurve();
Standard_Real theLength = aPI.GetLength();
Standard_Integer theReversed = aPI.GetReversed();
TopoDS_Shape aRefShape = aRefCurve->GetValue();
Standard_Real UFirst = 0;
Standard_Real ULast = 0;
if (aRefShape.ShapeType() != TopAbs_EDGE) {
if (aRefCurve.IsNull()) {
Standard_NullObject::Raise
("Point On Curve creation aborted : curve object is null");
}
TopoDS_Shape aRefShape1 = aRefCurve->GetValue();
if (aRefShape1.ShapeType() != TopAbs_EDGE) {
Standard_TypeMismatch::Raise
("Point On Curve creation aborted : curve shape is not an edge");
}
Standard_Real theCurveLength = IntTools::Length(TopoDS::Edge(aRefShape));
if (theLength > theCurveLength) {
Standard_ConstructionError::Raise
("Point On Curve creation aborted : given length is greater than edges length");
TopoDS_Edge aRefEdge = TopoDS::Edge(aRefShape1);
TopoDS_Vertex V1, V2;
TopExp::Vertices(aRefEdge, V1, V2, Standard_True);
// RefPoint
TopoDS_Vertex aRefVertex;
Handle(GEOM_Function) aRefPoint = aPI.GetRef();
if (aRefPoint.IsNull()) {
aRefVertex = V1;
}
Handle(Geom_Curve) EdgeCurve = BRep_Tool::Curve(TopoDS::Edge(aRefShape), UFirst, ULast);
else {
TopoDS_Shape aRefShape2 = aRefPoint->GetValue();
if (aRefShape2.ShapeType() != TopAbs_VERTEX) {
Standard_TypeMismatch::Raise
("Point On Curve creation aborted : start point shape is not a vertex");
}
aRefVertex = TopoDS::Vertex(aRefShape2);
}
gp_Pnt aRefPnt = BRep_Tool::Pnt(aRefVertex);
// Length
Standard_Real aLength = aPI.GetLength();
//Standard_Real theCurveLength = IntTools::Length(aRefEdge);
//if (aLength > theCurveLength) {
// Standard_ConstructionError::Raise
// ("Point On Curve creation aborted : given length is greater than edges length");
//}
// Check orientation
Standard_Real UFirst, ULast;
Handle(Geom_Curve) EdgeCurve = BRep_Tool::Curve(aRefEdge, UFirst, ULast);
Handle(Geom_Curve) ReOrientedCurve = EdgeCurve;
if ( theReversed ) {
ReOrientedCurve = EdgeCurve -> Reversed();
UFirst = EdgeCurve -> ReversedParameter(ULast);
Standard_Real dU = ULast - UFirst;
Standard_Real par1 = UFirst + 0.1 * dU;
Standard_Real par2 = ULast - 0.1 * dU;
gp_Pnt P1 = EdgeCurve->Value(par1);
gp_Pnt P2 = EdgeCurve->Value(par2);
if (aRefPnt.SquareDistance(P2) < aRefPnt.SquareDistance(P1)) {
ReOrientedCurve = EdgeCurve->Reversed();
UFirst = EdgeCurve->ReversedParameter(ULast);
}
// Get the point by length
GeomAdaptor_Curve AdapCurve = GeomAdaptor_Curve(ReOrientedCurve);
GCPnts_AbscissaPoint anAbsPnt(AdapCurve, theLength, UFirst);
GCPnts_AbscissaPoint anAbsPnt (AdapCurve, aLength, UFirst);
Standard_Real aParam = anAbsPnt.Parameter();
aPnt = AdapCurve.Value(aParam);
}
@ -203,7 +243,8 @@ Standard_Integer GEOMImpl_PointDriver::Execute(TFunction_Logbook& log) const
Standard_TypeMismatch::Raise
("Point On Surface creation aborted : surface shape is not a face");
}
if (!getExtremaSolution( aPI, aRefShape, aPnt ) ) {
gp_Pnt anInitPnt (aPI.GetX(), aPI.GetY(), aPI.GetZ());
if (!getExtremaSolution(anInitPnt, aRefShape, aPnt)) {
Standard_ConstructionError::Raise
("Point On Surface creation aborted : cannot project point");
}

View File

@ -18,11 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <GEOMImpl_ShapeDriver.hxx>
#include <GEOMImpl_IShapes.hxx>
#include <GEOMImpl_IVector.hxx>
#include <GEOMImpl_Types.hxx>
#include <GEOMImpl_Block6Explorer.hxx>
@ -33,26 +33,27 @@
#include <ShapeFix_Edge.hxx>
#include <ShapeFix_Shape.hxx>
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAlgo_FaceRestrictor.hxx>
#include <BRepBuilderAPI_Sewing.hxx>
#include <BRepBuilderAPI_Copy.hxx>
#include <BRepBuilderAPI_Sewing.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepCheck.hxx>
#include <BRepCheck_Analyzer.hxx>
#include <BRepCheck_Shell.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_Sewing.hxx>
#include <BRepLib.hxx>
#include <BRepLib_MakeEdge.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <ShapeAnalysis_FreeBounds.hxx>
#include <ElCLib.hxx>
#include <TopAbs.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Edge.hxx>
@ -61,12 +62,20 @@
#include <TopoDS_Solid.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_HSequenceOfShape.hxx>
#include <ElCLib.hxx>
#include <GCPnts_AbscissaPoint.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <GeomAbs_CurveType.hxx>
#include <GeomConvert_CompCurveToBSplineCurve.hxx>
#include <GeomConvert.hxx>
#include <GeomLProp.hxx>
#include <TColStd_SequenceOfReal.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <TColStd_Array1OfReal.hxx>
@ -74,13 +83,8 @@
#include <TColGeom_Array1OfBSplineCurve.hxx>
#include <TColGeom_HArray1OfBSplineCurve.hxx>
#include <GeomAbs_CurveType.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <GeomConvert_CompCurveToBSplineCurve.hxx>
#include <GeomConvert.hxx>
#include <GeomLProp.hxx>
#include <Precision.hxx>
#include <Standard_NullObject.hxx>
#include <Standard_TypeMismatch.hxx>
#include <Standard_ConstructionError.hxx>
@ -204,7 +208,7 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
if (!MW.IsDone()) {
Standard_ConstructionError::Raise("Wire construction failed");
}
W = MW;
W = MW;
}
else {
Standard_NullObject::Raise
@ -370,12 +374,16 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
else if (aType == SOLID_SHELL) {
Handle(GEOM_Function) aRefShell = aCI.GetBase();
TopoDS_Shape aShapeShell = aRefShell->GetValue();
if (!aShapeShell.IsNull() && aShapeShell.ShapeType() == TopAbs_COMPOUND) {
TopoDS_Iterator It (aShapeShell, Standard_True, Standard_True);
if (It.More()) aShapeShell = It.Value();
}
if (aShapeShell.IsNull() || aShapeShell.ShapeType() != TopAbs_SHELL) {
Standard_NullObject::Raise("Shape for solid construction is null or not a shell");
}
BRepCheck_Shell chkShell(TopoDS::Shell(aShapeShell));
if(chkShell.Closed() == BRepCheck_NotClosed) return 0;
if (chkShell.Closed() == BRepCheck_NotClosed) return 0;
TopoDS_Solid Sol;
B.MakeSolid(Sol);
@ -404,12 +412,16 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
if (aShapeShell.IsNull()) {
Standard_NullObject::Raise("Shell for solid construction is null");
}
if (aShapeShell.ShapeType() == TopAbs_COMPOUND) {
TopoDS_Iterator It (aShapeShell, Standard_True, Standard_True);
if (It.More()) aShapeShell = It.Value();
}
if (aShapeShell.ShapeType() == TopAbs_SHELL) {
B.Add(Sol, aShapeShell);
ish++;
}
}
if ( ish == 0 ) return 0;
if (ish == 0) return 0;
BRepClass3d_SolidClassifier SC (Sol);
SC.PerformInfinitePoint(Precision::Confusion());
if (SC.State() == TopAbs_IN)
@ -794,6 +806,83 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
aShape = ResEdge;
}
else if (aType == EDGE_CURVE_LENGTH) {
GEOMImpl_IVector aVI (aFunction);
// RefCurve
Handle(GEOM_Function) aRefCurve = aVI.GetPoint1();
if (aRefCurve.IsNull()) Standard_NullObject::Raise("Argument Curve is null");
TopoDS_Shape aRefShape1 = aRefCurve->GetValue();
if (aRefShape1.ShapeType() != TopAbs_EDGE) {
Standard_TypeMismatch::Raise
("Edge On Curve creation aborted : curve shape is not an edge");
}
TopoDS_Edge aRefEdge = TopoDS::Edge(aRefShape1);
TopoDS_Vertex V1, V2;
TopExp::Vertices(aRefEdge, V1, V2, Standard_True);
// RefPoint
TopoDS_Vertex aRefVertex;
Handle(GEOM_Function) aRefPoint = aVI.GetPoint2();
if (aRefPoint.IsNull()) {
aRefVertex = V1;
}
else {
TopoDS_Shape aRefShape2 = aRefPoint->GetValue();
if (aRefShape2.ShapeType() != TopAbs_VERTEX) {
Standard_TypeMismatch::Raise
("Edge On Curve creation aborted : start point shape is not a vertex");
}
aRefVertex = TopoDS::Vertex(aRefShape2);
}
gp_Pnt aRefPnt = BRep_Tool::Pnt(aRefVertex);
// Length
Standard_Real aLength = aVI.GetParameter();
//Standard_Real aCurveLength = IntTools::Length(aRefEdge);
//if (aLength > aCurveLength) {
// Standard_ConstructionError::Raise
// ("Edge On Curve creation aborted : given length is greater than edges length");
//}
if (fabs(aLength) < Precision::Confusion()) {
Standard_ConstructionError::Raise
("Edge On Curve creation aborted : given length is smaller than Precision::Confusion()");
}
// Check orientation
Standard_Real UFirst, ULast;
Handle(Geom_Curve) EdgeCurve = BRep_Tool::Curve(aRefEdge, UFirst, ULast);
Handle(Geom_Curve) ReOrientedCurve = EdgeCurve;
Standard_Real dU = ULast - UFirst;
Standard_Real par1 = UFirst + 0.1 * dU;
Standard_Real par2 = ULast - 0.1 * dU;
gp_Pnt P1 = EdgeCurve->Value(par1);
gp_Pnt P2 = EdgeCurve->Value(par2);
if (aRefPnt.SquareDistance(P2) < aRefPnt.SquareDistance(P1)) {
ReOrientedCurve = EdgeCurve->Reversed();
UFirst = EdgeCurve->ReversedParameter(ULast);
}
// Get the point by length
GeomAdaptor_Curve AdapCurve = GeomAdaptor_Curve(ReOrientedCurve);
GCPnts_AbscissaPoint anAbsPnt (AdapCurve, aLength, UFirst);
Standard_Real aParam = anAbsPnt.Parameter();
if (AdapCurve.IsClosed() && aLength < 0.0) {
Standard_Real aTmp = aParam;
aParam = UFirst;
UFirst = aTmp;
}
BRepBuilderAPI_MakeEdge aME (ReOrientedCurve, UFirst, aParam);
if (aME.IsDone())
aShape = aME.Shape();
}
else {
}
if (aShape.IsNull()) return 0;

View File

@ -18,10 +18,9 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//GEOM_Object types
//
#define GEOM_COPY 0
#define GEOM_IMPORT 1
@ -259,6 +258,7 @@
#define FACE_WIRES 9
#define REVERSE_ORIENTATION 10
#define EDGE_WIRE 11
#define EDGE_CURVE_LENGTH 12
#define ARCHIMEDE_TYPE 1

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx>

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx>
@ -162,8 +161,8 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurve
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurveByLength
(GEOM::GEOM_Object_ptr theCurve,
CORBA::Double theLength,
CORBA::Boolean theReverse)
CORBA::Double theLength,
GEOM::GEOM_Object_ptr theStartPoint)
{
GEOM::GEOM_Object_var aGEOMObject;
@ -174,10 +173,15 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurveByLength
Handle(GEOM_Object) aReference = GetObjectImpl(theCurve);
if (aReference.IsNull()) return aGEOMObject._retn();
//Get the reference point (can be NULL)
Handle(GEOM_Object) aRefPoint;
if (!CORBA::is_nil(theStartPoint)) {
aRefPoint = GetObjectImpl(theStartPoint);
}
//Create the point
Handle(GEOM_Object) anObject =
GetOperations()->MakePointOnCurveByLength(aReference, theLength,
theReverse);
GetOperations()->MakePointOnCurveByLength(aReference, theLength, aRefPoint);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _GEOM_IBasicOperations_i_HeaderFile
#define _GEOM_IBasicOperations_i_HeaderFile
@ -56,8 +55,8 @@ class GEOM_I_EXPORT GEOM_IBasicOperations_i :
CORBA::Double theParameter);
GEOM::GEOM_Object_ptr MakePointOnCurveByLength (GEOM::GEOM_Object_ptr theCurve,
CORBA::Double theLength,
CORBA::Boolean theReverse);
CORBA::Double theLength,
GEOM::GEOM_Object_ptr theStartPoint);
GEOM::GEOM_Object_ptr MakePointOnCurveByCoord (GEOM::GEOM_Object_ptr theCurve,
CORBA::Double theXParameter,

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <Standard_Stream.hxx>
@ -367,6 +366,25 @@ CORBA::Boolean GEOM_IMeasureOperations_i::CheckShapeWithGeometry (GEOM::GEOM_Obj
return 0;
}
//=============================================================================
/*!
* IsGoodForSolid
*/
//=============================================================================
char* GEOM_IMeasureOperations_i::IsGoodForSolid (GEOM::GEOM_Object_ptr theShape)
{
//Set a not done flag
GetOperations()->SetNotDone();
//Get the reference shape
Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
if (aShape.IsNull()) return CORBA::string_dup("WRN_NULL_OBJECT_OR_SHAPE");
// Get shape parameters
TCollection_AsciiString aDescription = GetOperations()->IsGoodForSolid(aShape);
return CORBA::string_dup(aDescription.ToCString());
}
//=============================================================================
/*!
* WhatIs
@ -392,8 +410,8 @@ char* GEOM_IMeasureOperations_i::WhatIs (GEOM::GEOM_Object_ptr theShape)
*/
//=============================================================================
GEOM::ListOfBool* GEOM_IMeasureOperations_i::AreCoordsInside (GEOM::GEOM_Object_ptr theShape,
const GEOM::ListOfDouble& theCoords,
CORBA::Double tolerance)
const GEOM::ListOfDouble& theCoords,
CORBA::Double tolerance)
{
//Set a not done flag
GetOperations()->SetNotDone();
@ -477,6 +495,26 @@ CORBA::Double GEOM_IMeasureOperations_i::GetAngle (GEOM::GEOM_Object_ptr theShap
return GetOperations()->GetAngle(aShape1, aShape2);
}
//=============================================================================
/*!
* GetAngle
*/
//=============================================================================
CORBA::Double GEOM_IMeasureOperations_i::GetAngleBtwVectors (GEOM::GEOM_Object_ptr theShape1,
GEOM::GEOM_Object_ptr theShape2)
{
//Set a not done flag
GetOperations()->SetNotDone();
//Get the reference shapes
Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
if (aShape1.IsNull() || aShape2.IsNull()) return -1.0;
// Get the angle
return GetOperations()->GetAngleBtwVectors(aShape1, aShape2);
}
//=============================================================================
/*!

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _GEOM_IMeasureOperations_i_HeaderFile
#define _GEOM_IMeasureOperations_i_HeaderFile
@ -39,91 +38,96 @@ class GEOM_I_EXPORT GEOM_IMeasureOperations_i :
{
public:
GEOM_IMeasureOperations_i (PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine,
::GEOMImpl_IMeasureOperations* theImpl);
::GEOMImpl_IMeasureOperations* theImpl);
~GEOM_IMeasureOperations_i();
GEOM::GEOM_IKindOfShape::shape_kind KindOfShape (GEOM::GEOM_Object_ptr theShape,
GEOM::ListOfLong_out theIntegers,
GEOM::ListOfDouble_out theDoubles);
GEOM::ListOfLong_out theIntegers,
GEOM::ListOfDouble_out theDoubles);
void GetPosition (GEOM::GEOM_Object_ptr theShape,
CORBA::Double& Ox, CORBA::Double& Oy, CORBA::Double& Oz,
CORBA::Double& Zx, CORBA::Double& Zy, CORBA::Double& Zz,
CORBA::Double& Xx, CORBA::Double& Xy, CORBA::Double& Xz);
CORBA::Double& Ox, CORBA::Double& Oy, CORBA::Double& Oz,
CORBA::Double& Zx, CORBA::Double& Zy, CORBA::Double& Zz,
CORBA::Double& Xx, CORBA::Double& Xy, CORBA::Double& Xz);
void GetBasicProperties (GEOM::GEOM_Object_ptr theShape,
CORBA::Double& theLength,
CORBA::Double& theSurfArea,
CORBA::Double& theVolume);
CORBA::Double& theLength,
CORBA::Double& theSurfArea,
CORBA::Double& theVolume);
GEOM::GEOM_Object_ptr GetCentreOfMass (GEOM::GEOM_Object_ptr theShape);
GEOM::GEOM_Object_ptr GetNormal (GEOM::GEOM_Object_ptr theFace,
GEOM::GEOM_Object_ptr theOptionalPoint);
GEOM::GEOM_Object_ptr theOptionalPoint);
GEOM::GEOM_Object_ptr GetVertexByIndex (GEOM::GEOM_Object_ptr theObject,
CORBA::Long theIndex);
void GetInertia (GEOM::GEOM_Object_ptr theShape,
CORBA::Double& I11, CORBA::Double& I12, CORBA::Double& I13,
CORBA::Double& I21, CORBA::Double& I22, CORBA::Double& I23,
CORBA::Double& I31, CORBA::Double& I32, CORBA::Double& I33,
CORBA::Double& Ix , CORBA::Double& Iy , CORBA::Double& Iz);
CORBA::Double& I11, CORBA::Double& I12, CORBA::Double& I13,
CORBA::Double& I21, CORBA::Double& I22, CORBA::Double& I23,
CORBA::Double& I31, CORBA::Double& I32, CORBA::Double& I33,
CORBA::Double& Ix , CORBA::Double& Iy , CORBA::Double& Iz);
void GetBoundingBox (GEOM::GEOM_Object_ptr theShape,
CORBA::Double& Xmin, CORBA::Double& Xmax,
CORBA::Double& Ymin, CORBA::Double& Ymax,
CORBA::Double& Zmin, CORBA::Double& Zmax);
CORBA::Double& Xmin, CORBA::Double& Xmax,
CORBA::Double& Ymin, CORBA::Double& Ymax,
CORBA::Double& Zmin, CORBA::Double& Zmax);
void GetTolerance (GEOM::GEOM_Object_ptr theShape,
CORBA::Double& FaceMin, CORBA::Double& FaceMax,
CORBA::Double& EdgeMin, CORBA::Double& EdgeMax,
CORBA::Double& VertMin, CORBA::Double& VertMax);
CORBA::Double& FaceMin, CORBA::Double& FaceMax,
CORBA::Double& EdgeMin, CORBA::Double& EdgeMax,
CORBA::Double& VertMin, CORBA::Double& VertMax);
CORBA::Boolean CheckShape (GEOM::GEOM_Object_ptr theShape,
CORBA::String_out theDescription);
CORBA::String_out theDescription);
CORBA::Boolean CheckShapeWithGeometry (GEOM::GEOM_Object_ptr theShape,
CORBA::String_out theDescription);
CORBA::String_out theDescription);
char* IsGoodForSolid (GEOM::GEOM_Object_ptr theShape);
char* WhatIs (GEOM::GEOM_Object_ptr theShape);
GEOM::ListOfBool* AreCoordsInside (GEOM::GEOM_Object_ptr theShape,
const GEOM::ListOfDouble& theCoords,
CORBA::Double theTolerance);
const GEOM::ListOfDouble& theCoords,
CORBA::Double theTolerance);
CORBA::Double GetMinDistance (GEOM::GEOM_Object_ptr theShape1,
GEOM::GEOM_Object_ptr theShape2,
GEOM::GEOM_Object_ptr theShape2,
CORBA::Double& X1, CORBA::Double& Y1, CORBA::Double& Z1,
CORBA::Double& X2, CORBA::Double& Y2, CORBA::Double& Z2);
void PointCoordinates (GEOM::GEOM_Object_ptr theShape,
CORBA::Double& X, CORBA::Double& Y, CORBA::Double& Z);
CORBA::Double& X, CORBA::Double& Y, CORBA::Double& Z);
CORBA::Double GetAngle (GEOM::GEOM_Object_ptr theShape1,
GEOM::GEOM_Object_ptr theShape2);
GEOM::GEOM_Object_ptr theShape2);
CORBA::Double GetAngleBtwVectors (GEOM::GEOM_Object_ptr theShape1,
GEOM::GEOM_Object_ptr theShape2);
// Methods for recieving radiuses of curvature of curves and surfaces
// in the given point
CORBA::Double CurveCurvatureByParam (GEOM::GEOM_Object_ptr theCurve,
CORBA::Double theParam);
CORBA::Double theParam);
CORBA::Double CurveCurvatureByPoint (GEOM::GEOM_Object_ptr theCurve,
GEOM::GEOM_Object_ptr thePoint);
GEOM::GEOM_Object_ptr thePoint);
CORBA::Double MaxSurfaceCurvatureByParam (GEOM::GEOM_Object_ptr theSurf,
CORBA::Double theUParam,
CORBA::Double theVParam);
CORBA::Double theUParam,
CORBA::Double theVParam);
CORBA::Double MaxSurfaceCurvatureByPoint (GEOM::GEOM_Object_ptr theSurf,
GEOM::GEOM_Object_ptr thePoint);
GEOM::GEOM_Object_ptr thePoint);
CORBA::Double MinSurfaceCurvatureByParam (GEOM::GEOM_Object_ptr theSurf,
CORBA::Double theUParam,
CORBA::Double theVParam);
CORBA::Double theUParam,
CORBA::Double theVParam);
CORBA::Double MinSurfaceCurvatureByPoint (GEOM::GEOM_Object_ptr theSurf,
GEOM::GEOM_Object_ptr thePoint);
GEOM::GEOM_Object_ptr thePoint);
::GEOMImpl_IMeasureOperations* GetOperations()
{ return (::GEOMImpl_IMeasureOperations*)GetImpl(); }

View File

@ -85,6 +85,40 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeEdge
return GetObject(anObject);
}
//=============================================================================
/*!
* MakeEdgeOnCurveByLength
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeEdgeOnCurveByLength
(GEOM::GEOM_Object_ptr theCurve,
CORBA::Double theLength,
GEOM::GEOM_Object_ptr theStartPoint)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
//Get the reference curve
Handle(GEOM_Object) aRefCurve = GetObjectImpl(theCurve);
if (aRefCurve.IsNull()) return aGEOMObject._retn();
//Get the reference point (can be NULL)
Handle(GEOM_Object) aRefPoint;
if (!CORBA::is_nil(theStartPoint)) {
aRefPoint = GetObjectImpl(theStartPoint);
}
//Create the point
Handle(GEOM_Object) anObject =
GetOperations()->MakeEdgeOnCurveByLength(aRefCurve, theLength, aRefPoint);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
return GetObject(anObject);
}
//=============================================================================
/*!
* MakeEdgeWire

View File

@ -44,6 +44,11 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i :
GEOM::GEOM_Object_ptr MakeEdge (GEOM::GEOM_Object_ptr thePnt1,
GEOM::GEOM_Object_ptr thePnt2);
GEOM::GEOM_Object_ptr MakeEdgeOnCurveByLength (GEOM::GEOM_Object_ptr theCurve,
CORBA::Double theLength,
GEOM::GEOM_Object_ptr theStartPoint);
GEOM::GEOM_Object_ptr MakeEdgeWire (GEOM::GEOM_Object_ptr theWire,
const CORBA::Double theLinearTolerance,
const CORBA::Double theAngularTolerance);

View File

@ -591,12 +591,12 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointOnCurve (GEOM::GEOM_Object_ptr the
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointOnCurveByLength (GEOM::GEOM_Object_ptr theRefCurve,
CORBA::Double theLength,
CORBA::Boolean theReverse)
GEOM::GEOM_Object_ptr theStartPoint)
{
beginService( " GEOM_Superv_i::MakePointOnCurveByLength" );
MESSAGE("GEOM_Superv_i::MakePointOnCurveByLength");
getBasicOp();
GEOM::GEOM_Object_ptr anObj = myBasicOp->MakePointOnCurveByLength(theRefCurve, theLength, theReverse);
GEOM::GEOM_Object_ptr anObj = myBasicOp->MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint);
endService( " GEOM_Superv_i::MakePointOnCurveByLength" );
return anObj;
}
@ -2010,6 +2010,21 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeEdge (GEOM::GEOM_Object_ptr thePnt1,
return anObj;
}
//=============================================================================
// MakeEdgeOnCurveByLength:
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeEdgeOnCurveByLength (GEOM::GEOM_Object_ptr theRefCurve,
CORBA::Double theLength,
GEOM::GEOM_Object_ptr theStartPoint)
{
beginService( " GEOM_Superv_i::MakeEdgeOnCurveByLength" );
MESSAGE("GEOM_Superv_i::MakeEdgeOnCurveByLength");
getShapesOp();
GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint);
endService( " GEOM_Superv_i::MakeEdgeOnCurveByLength" );
return anObj;
}
//=============================================================================
// MakeWire:
//=============================================================================

View File

@ -151,7 +151,7 @@ public:
CORBA::Double theParameter);
GEOM::GEOM_Object_ptr MakePointOnCurveByLength (GEOM::GEOM_Object_ptr theRefCurve,
CORBA::Double theLength,
CORBA::Boolean theReverse);
GEOM::GEOM_Object_ptr theStartPoint);
GEOM::GEOM_Object_ptr MakePointOnCurveByCoord (GEOM::GEOM_Object_ptr theRefCurve,
CORBA::Double theXParameter,
CORBA::Double theYParameter,
@ -465,6 +465,9 @@ public:
//-----------------------------------------------------------//
GEOM::GEOM_Object_ptr MakeEdge (GEOM::GEOM_Object_ptr thePnt1,
GEOM::GEOM_Object_ptr thePnt2);
GEOM::GEOM_Object_ptr MakeEdgeOnCurveByLength (GEOM::GEOM_Object_ptr theRefCurve,
CORBA::Double theLength,
GEOM::GEOM_Object_ptr theStartPoint);
GEOM::GEOM_Object_ptr MakeWire (GEOM::GEOM_List_ptr theEdgesAndWires,
CORBA::Double theTolerance);
GEOM::GEOM_Object_ptr MakeFace (GEOM::GEOM_Object_ptr theWire,

View File

@ -62,63 +62,63 @@ def TestAll (geompy, math):
precision = 0.00001
#Create base points
p0 = geompy.MakeVertex(0. , 0. , 0. ) #(3 Doubles)->GEOM_Object_ptr
p0 = geompy.MakeVertex(0. , 0. , 0. ) #(3 Doubles)->GEOM_Object
px = geompy.MakeVertex(100., 0. , 0. )
py = geompy.MakeVertex(0. , 100., 0. )
pz = geompy.MakeVertex(0. , 0. , 100.)
pxyz = geompy.MakeVertex(100., 100., 100.)
p200 = geompy.MakeVertexWithRef(pxyz, 100., 100., 100.) #(GEOM_Object_ptr, 3 Doubles)->GEOM_Object_ptr
p200 = geompy.MakeVertexWithRef(pxyz, 100., 100., 100.) #(GEOM_Object, 3 Doubles)->GEOM_Object
#Create base directions
vx = geompy.MakeVector(p0, px) #(GEOM_Object_ptr, GEOM_Object_ptr)->GEOM_Object_ptr
vx = geompy.MakeVector(p0, px) #(GEOM_Object, GEOM_Object)->GEOM_Object
vy = geompy.MakeVector(p0, py)
vz = geompy.MakeVector(p0, pz)
vxy = geompy.MakeVector(px, py)
vxyz = geompy.MakeVectorDXDYDZ(100., 100., 100.) #(3 Doubles)->GEOM_Object_ptr
vxyz = geompy.MakeVectorDXDYDZ(100., 100., 100.) #(3 Doubles)->GEOM_Object
#Create local coordinate systems
cs1 = geompy.MakeMarker(50,50,50, 1,0,0, 0,1,0) #(9 Doubles)->GEOM_Object_ptr
cs2 = geompy.MakeMarker(70,80,10, 1,0,1, 1,1,0) #(9 Doubles)->GEOM_Object_ptr
cs3 = geompy.MakeMarkerPntTwoVec(pz, vxy, vz) #(3 GEOM_Object_ptr)->GEOM_Object_ptr
cs1 = geompy.MakeMarker(50,50,50, 1,0,0, 0,1,0) #(9 Doubles)->GEOM_Object
cs2 = geompy.MakeMarker(70,80,10, 1,0,1, 1,1,0) #(9 Doubles)->GEOM_Object
cs3 = geompy.MakeMarkerPntTwoVec(pz, vxy, vz) #(3 GEOM_Object)->GEOM_Object
#Create base geometry 2D
Line = geompy.MakeLineTwoPnt(p0, pxyz) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
Line1 = geompy.MakeLine(pz, vxy) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
Line2 = geompy.MakeLineTwoPnt(pxyz, pz) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
Plane = geompy.MakePlane(pz, vxyz, trimsize) #(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
Plane1 = geompy.MakePlaneThreePnt(px, pz, p200, trimsize) #(4 Doubles)->GEOM_Object_ptr
Plane2 = geompy.MakePlane2Vec(vx, vz, trimsize) #(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
Plane3 = geompy.MakePlaneLCS(cs1, trimsize, 3) #(1 GEOM_Object_ptr, 2 Double)->GEOM_Object_ptr
Line = geompy.MakeLineTwoPnt(p0, pxyz) #(2 GEOM_Object)->GEOM_Object
Line1 = geompy.MakeLine(pz, vxy) #(2 GEOM_Object)->GEOM_Object
Line2 = geompy.MakeLineTwoPnt(pxyz, pz) #(2 GEOM_Object)->GEOM_Object
Plane = geompy.MakePlane(pz, vxyz, trimsize) #(2 GEOM_Object, Double)->GEOM_Object
Plane1 = geompy.MakePlaneThreePnt(px, pz, p200, trimsize) #(4 Doubles)->GEOM_Object
Plane2 = geompy.MakePlane2Vec(vx, vz, trimsize) #(2 GEOM_Object, Double)->GEOM_Object
Plane3 = geompy.MakePlaneLCS(cs1, trimsize, 3) #(1 GEOM_Object, 2 Double)->GEOM_Object
Arc = geompy.MakeArc(py, pz, px) #(3 GEOM_Object_ptr)->GEOM_Object_ptr
Arc2 = geompy.MakeArcCenter(py, pz, px,0) #(3 GEOM_Object_ptr,Boolean)->GEOM_Object_ptr
Arc3 = geompy.MakeArcOfEllipse(p0, px, pz) #(3 GEOM_Object_ptr,Boolean)->GEOM_Object_ptr
Circle = geompy.MakeCircle(p0, vz, radius1) #(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
Circle1 = geompy.MakeCircleThreePnt(p0, pxyz, px) #(3 GEOM_Object_ptr)->GEOM_Object_ptr
Circle2 = geompy.MakeCircleCenter2Pnt(p0, pxyz, py) #(3 GEOM_Object_ptr)->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
Bezier = geompy.MakeBezier([p0, pz, p200, px]) #(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
Arc = geompy.MakeArc(py, pz, px) #(3 GEOM_Object)->GEOM_Object
Arc2 = geompy.MakeArcCenter(py, pz, px,0) #(3 GEOM_Object,Boolean)->GEOM_Object
Arc3 = geompy.MakeArcOfEllipse(p0, px, pz) #(3 GEOM_Object,Boolean)->GEOM_Object
Circle = geompy.MakeCircle(p0, vz, radius1) #(2 GEOM_Object, Double)->GEOM_Object
Circle1 = geompy.MakeCircleThreePnt(p0, pxyz, px) #(3 GEOM_Object)->GEOM_Object
Circle2 = geompy.MakeCircleCenter2Pnt(p0, pxyz, py) #(3 GEOM_Object)->GEOM_Object
Ellipse = geompy.MakeEllipse(p0, vy, radius2, radius1) #(2 GEOM_Object, 2 Doubles)->GEOM_Object
Polyline = geompy.MakePolyline([p0, pz, py, p200]) #(List of GEOM_Object)->GEOM_Object
Bezier = geompy.MakeBezier([p0, pz, p200, px]) #(List of GEOM_Object)->GEOM_Object
Interpol = geompy.MakeInterpol([px, py, p200, pxyz], True) #(List of GEOM_Object,Boolean)->GEOM_Object
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
Sketcher3d = geompy.Make3DSketcher([0,0,0, 50,50,50, 0,50,50, 10,0,0])
#Create local coordinate system from shape
cs4 = geompy.MakeMarkerFromShape(Plane)
#Test point on curve creation
p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25) #(GEOM_Object_ptr, Double)->GEOM_Object_ptr
p_on_arc2 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10 ) #(GEOM_Object_ptr, Double)->GEOM_Object_ptr
p_on_arc3 = geompy.MakeVertexOnCurveByLength(Arc, 50, True) #(GEOM_Object_ptr, Double, Boolean)->GEOM_Object_ptr
p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25) #(GEOM_Object, Double)->GEOM_Object
p_on_arc2 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10 ) #(GEOM_Object, Double)->GEOM_Object
p_on_arc3 = geompy.MakeVertexOnCurveByLength(Arc, 50, py) #(GEOM_Object, Double, GEOM_Object)->GEOM_Object
#Test point on lines intersection
p_on_l1l2 = geompy.MakeVertexOnLinesIntersection(Line1, Line2) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
p_on_l1l2 = geompy.MakeVertexOnLinesIntersection(Line1, Line2) #(2 GEOM_Object)->GEOM_Object
#Test tangent on curve creation
tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7) #(GEOM_Object_ptr, Double)->GEOM_Object_ptr
tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7) #(GEOM_Object, Double)->GEOM_Object
#Test tangent on face creation
tan_vertex_1 = geompy.MakeVertex(0, 0, 0)
@ -130,45 +130,46 @@ def TestAll (geompy, math):
tan_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
#Create base geometry 3D
Box = geompy.MakeBoxTwoPnt(p0, p200) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
Box1 = geompy.MakeBoxDXDYDZ(10, 20, 30) #(3 Doubles)->GEOM_Object_ptr
Box2 = geompy.MakeBox(10,20,30, 15,25,35) #(6 Doubles)->GEOM_Object_ptr
Cylinder = geompy.MakeCylinder(p0, vz, radius1, height) #(2 GEOM_Object_ptr, 2 Doubles)->GEOM_Object_ptr
Cyl1 = geompy.MakeCylinderRH(radius2, height) #(2 Doubles)->GEOM_Object_ptr
Sphere = geompy.MakeSpherePntR(p0, radius1) #(GEOM_Object_ptr, Double)->GEOM_Object_ptr
Sphere1 = geompy.MakeSphereR(radius) #(Double)->GEOM_Object_ptr
Sphere2 = geompy.MakeSphere(50, 70, 30, radius) #(4 Doubles)->GEOM_Object_ptr
Cone = geompy.MakeCone(p0, vz, radius2, radius, height) #(2 GEOM_Object_ptr, 3 Doubles)->GEOM_Object_ptr
Cone1 = geompy.MakeConeR1R2H(radius1, radius, height) #(3 Doubles)->GEOM_Object_ptr
Torus = geompy.MakeTorus(p0, vz, radius2, radius) #(2 GEOM_Object_ptr, 2 Doubles)->GEOM_Object_ptr
Torus1 = geompy.MakeTorusRR(radius2, radius1) #(2 Doubles)->GEOM_Object_ptr
Box = geompy.MakeBoxTwoPnt(p0, p200) #(2 GEOM_Object)->GEOM_Object
Box1 = geompy.MakeBoxDXDYDZ(10, 20, 30) #(3 Doubles)->GEOM_Object
Box2 = geompy.MakeBox(10,20,30, 15,25,35) #(6 Doubles)->GEOM_Object
Cylinder = geompy.MakeCylinder(p0, vz, radius1, height) #(2 GEOM_Object, 2 Doubles)->GEOM_Object
Cyl1 = geompy.MakeCylinderRH(radius2, height) #(2 Doubles)->GEOM_Object
Sphere = geompy.MakeSpherePntR(p0, radius1) #(GEOM_Object, Double)->GEOM_Object
Sphere1 = geompy.MakeSphereR(radius) #(Double)->GEOM_Object
Sphere2 = geompy.MakeSphere(50, 70, 30, radius) #(4 Doubles)->GEOM_Object
Cone = geompy.MakeCone(p0, vz, radius2, radius, height) #(2 GEOM_Object, 3 Doubles)->GEOM_Object
Cone1 = geompy.MakeConeR1R2H(radius1, radius, height) #(3 Doubles)->GEOM_Object
Torus = geompy.MakeTorus(p0, vz, radius2, radius) #(2 GEOM_Object, 2 Doubles)->GEOM_Object
Torus1 = geompy.MakeTorusRR(radius2, radius1) #(2 Doubles)->GEOM_Object
#Boolean (Common, Cut, Fuse, Section)
Common = geompy.MakeBoolean(Box, Sphere, 1) #(2 GEOM_Object_ptr, Short)->GEOM_Object_ptr
Common = geompy.MakeBoolean(Box, Sphere, 1) #(2 GEOM_Object, Short)->GEOM_Object
Cut = geompy.MakeBoolean(Box, Sphere, 2)
Fuse = geompy.MakeBoolean(Box, Sphere, 3)
Section = geompy.MakeBoolean(Box, Sphere, 4)
#Create base objects
Edge = geompy.MakeEdge(p0, pxyz) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
Wire = geompy.MakeWire([vxy, Arc]) #(List Of GEOM_Object_ptr)->GEOM_Object_ptr
Face = geompy.MakeFace(Wire, WantPlanarFace) #(GEOM_Object_ptr, Boolean)->GEOM_Object_ptr
Edge = geompy.MakeEdge(p0, pxyz) #(2 GEOM_Object)->GEOM_Object
Edge1 = geompy.MakeEdgeOnCurveByLength(Arc, 50, px) #(GEOM_Object, Double, GEOM_Object)->GEOM_Object
Wire = geompy.MakeWire([vxy, Arc]) #(List Of GEOM_Object)->GEOM_Object
Face = geompy.MakeFace(Wire, WantPlanarFace) #(GEOM_Object, Boolean)->GEOM_Object
Face1 = geompy.MakeFaceWires([Wire, Sketcher],
WantPlanarFace) #(List of GEOM_Object_ptr, Boolean)->GEOM_Object_ptr
WantPlanarFace) #(List of GEOM_Object, Boolean)->GEOM_Object
Face2 = geompy.MakeFace(Sketcher, WantPlanarFace)
Face3 = geompy.MakeFaceHW (100., 200., 1) #(2 Doubles, 1 Int)->GEOM_Object_ptr
Face4 = geompy.MakeFaceObjHW (vz, 200., 100.) #(1 GEOM_Object_ptr, 2 Doubles)->GEOM_Object_ptr
Disk = geompy.MakeDiskPntVecR (p0, vz, radius) #(2 GEOM_Object_ptr, 1 Double)->GEOM_Object_ptr
Disk2 = geompy.MakeDiskThreePnt(p0, p200, pz) #(3 GEOM_Object_ptr)->GEOM_Object_ptr
Disk3 = geompy.MakeDiskR(100., 1) #(1 Doubles, 1 Int)->GEOM_Object_ptr
Shell = geompy.MakeShell([Face, Face1]) #(List of GEOM_Object_ptr)->GEOM_Object_ptr
Face3 = geompy.MakeFaceHW (100., 200., 1) #(2 Doubles, 1 Int)->GEOM_Object
Face4 = geompy.MakeFaceObjHW (vz, 200., 100.) #(1 GEOM_Object, 2 Doubles)->GEOM_Object
Disk = geompy.MakeDiskPntVecR (p0, vz, radius) #(2 GEOM_Object, 1 Double)->GEOM_Object
Disk2 = geompy.MakeDiskThreePnt(p0, p200, pz) #(3 GEOM_Object)->GEOM_Object
Disk3 = geompy.MakeDiskR(100., 1) #(1 Doubles, 1 Int)->GEOM_Object
Shell = geompy.MakeShell([Face, Face1]) #(List of GEOM_Object)->GEOM_Object
Prism1 = geompy.MakePrism(Face2, p0, pxyz) #(3 GEOM_Object_ptr)->GEOM_Object_ptr
Prism1 = geompy.MakePrism(Face2, p0, pxyz) #(3 GEOM_Object)->GEOM_Object
prism1_faces = geompy.SubShapeAllSortedCentres(Prism1, geompy.ShapeType["FACE"])
Shell1 = geompy.MakeShell([prism1_faces[0], prism1_faces[1],
prism1_faces[3], prism1_faces[4],
prism1_faces[5], prism1_faces[2]])
Solid = geompy.MakeSolid([Shell1]) #(List of GEOM_Object_ptr)->GEOM_Object_ptr
Solid = geompy.MakeSolid([Shell1]) #(List of GEOM_Object)->GEOM_Object
ShapeListCompound = []
i = 0
@ -176,58 +177,58 @@ def TestAll (geompy, math):
S = geompy.MakeTranslation(Arc, i * 100., i * 100., i * 100.)
ShapeListCompound.append(S)
i = i + 1
Compound = geompy.MakeCompound(ShapeListCompound) #(List of GEOM_Object_ptr)->GEOM_Object_ptr
Compound = geompy.MakeCompound(ShapeListCompound) #(List of GEOM_Object)->GEOM_Object
#Test point on surface creation
p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8) #(GEOM_Object_ptr, Double, Double)->GEOM_Object_ptr
p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.) #(GEOM_Object_ptr, Double, Double, Double)->GEOM_Object_ptr
p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8) #(GEOM_Object, Double, Double)->GEOM_Object
p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.) #(GEOM_Object, Double, Double, Double)->GEOM_Object
# Test plane from existing face creation
Plane2 = geompy.MakePlaneFace(Face, trimsize) #(GEOM_Object_ptr, Double)->GEOM_Object_ptr
Plane2 = geompy.MakePlaneFace(Face, trimsize) #(GEOM_Object, Double)->GEOM_Object
#ShapeList for Sewing
S = geompy.MakeRotation(Face, vxy, angle1)
#Test Line on Faces Intersection
Line3 = geompy.MakeLineTwoFaces(prism1_faces[0], prism1_faces[1]) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
Line3 = geompy.MakeLineTwoFaces(prism1_faces[0], prism1_faces[1]) #(2 GEOM_Object)->GEOM_Object
#Create advanced objects
Copy = geompy.MakeCopy(Box) #(GEOM_Object_ptr)->GEOM_Object_ptr
Prism = geompy.MakePrismVecH(Face, vz, 100.0) #(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
Prism2Ways = geompy.MakePrismVecH2Ways(Face, vz, 10.0) #(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
PrismTwoPnt = geompy.MakePrism(Face2, p0, pxyz) #(3 GEOM_Object_ptr)->GEOM_Object_ptr
PrismTwoPnt2Ways = geompy.MakePrism2Ways(Face2, p0, pxyz) #(3 GEOM_Object_ptr)->GEOM_Object_ptr
PrismDXDYDZ = geompy.MakePrismDXDYDZ(Face2, 10, 20, 100)#(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
PrismDXDYDZ2Ways = geompy.MakePrismDXDYDZ2Ways(Face, 30, -20, 200)#(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
Copy = geompy.MakeCopy(Box) #(GEOM_Object)->GEOM_Object
Prism = geompy.MakePrismVecH(Face, vz, 100.0) #(2 GEOM_Object, Double)->GEOM_Object
Prism2Ways = geompy.MakePrismVecH2Ways(Face, vz, 10.0) #(2 GEOM_Object, Double)->GEOM_Object
PrismTwoPnt = geompy.MakePrism(Face2, p0, pxyz) #(3 GEOM_Object)->GEOM_Object
PrismTwoPnt2Ways = geompy.MakePrism2Ways(Face2, p0, pxyz) #(3 GEOM_Object)->GEOM_Object
PrismDXDYDZ = geompy.MakePrismDXDYDZ(Face2, 10, 20, 100)#(2 GEOM_Object, Double)->GEOM_Object
PrismDXDYDZ2Ways = geompy.MakePrismDXDYDZ2Ways(Face, 30, -20, 200)#(2 GEOM_Object, Double)->GEOM_Object
Revolution = geompy.MakeRevolution(Face, vz, angle2) #
Revolution2Ways = geompy.MakeRevolution(Face, vz, angle1) #
Filling = geompy.MakeFilling(Compound, mindeg, maxdeg,
tol2d, tol3d, nbiter) #(GEOM_Object_ptr, 4 Doubles, Short)->GEOM_Object_ptr
Pipe = geompy.MakePipe(Wire, Edge) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
Sewing = geompy.MakeSewing([Face, S], precision) #(List Of GEOM_Object_ptr, Double)->GEOM_Object_ptr
tol2d, tol3d, nbiter) #(GEOM_Object, 4 Doubles, Short)->GEOM_Object
Pipe = geompy.MakePipe(Wire, Edge) #(2 GEOM_Object)->GEOM_Object
Sewing = geompy.MakeSewing([Face, S], precision) #(List Of GEOM_Object, Double)->GEOM_Object
#Transform objects
Translation = geompy.MakeTranslationTwoPoints(Box, px, pz) #(3 GEOM_Object_ptr)->GEOM_Object_ptr
TranslVect = geompy.MakeTranslationVector(Box, vxyz) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
TranslVectD = geompy.MakeTranslationVectorDistance(Box, vxyz, 50.0) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
Rotation = geompy.MakeRotation(Box, vz, angle1) #(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
RotatPnt = geompy.MakeRotationThreePoints(Box, px, py, pz) #(4 GEOM_Object_ptr)->GEOM_Object_ptr
Translation = geompy.MakeTranslationTwoPoints(Box, px, pz) #(3 GEOM_Object)->GEOM_Object
TranslVect = geompy.MakeTranslationVector(Box, vxyz) #(2 GEOM_Object)->GEOM_Object
TranslVectD = geompy.MakeTranslationVectorDistance(Box, vxyz, 50.0) #(2 GEOM_Object)->GEOM_Object
Rotation = geompy.MakeRotation(Box, vz, angle1) #(2 GEOM_Object, Double)->GEOM_Object
RotatPnt = geompy.MakeRotationThreePoints(Box, px, py, pz) #(4 GEOM_Object)->GEOM_Object
#Scale by factor relatively given point
Scale1 = geompy.MakeScaleTransform(Box, pxyz, factor) #(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
Scale1 = geompy.MakeScaleTransform(Box, pxyz, factor) #(2 GEOM_Object, Double)->GEOM_Object
#Scale by factor relatively the origin of global CS
Scale2 = geompy.MakeScaleTransform(Box, None, factor) #
#Scale along axes of global CS by different factors. Scale relatively given point
Scale3 = geompy.MakeScaleAlongAxes(Box, pxyz, 1.5, 0.5, 3) #(2 GEOM_Object_ptr, 3 Doubles)->GEOM_Object_ptr
Scale3 = geompy.MakeScaleAlongAxes(Box, pxyz, 1.5, 0.5, 3) #(2 GEOM_Object, 3 Doubles)->GEOM_Object
#Scale along axes of global CS by different factors. Scale relatively the origin of global CS
Scale4 = geompy.MakeScaleAlongAxes(Box, None, 1.5, 0.5, 3) #
Mirror = geompy.MakeMirrorByPlane(Box, Plane) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
Mirror = geompy.MakeMirrorByPlane(Box, Plane) #(2 GEOM_Object)->GEOM_Object
MirrorAxis = geompy.MakeMirrorByAxis(Box, Line1) #
MirrorPnt = geompy.MakeMirrorByPoint(Box, p200) #
Position = geompy.MakePosition(Box, cs1, cs2) #(3 GEOM_Object_ptr)->GEOM_Object_ptr
Position2 = geompy.PositionAlongPath(Box, Arc, 0.5, 1, 0) #(2 GEOM_Object_ptr, 1 Double, 2 Bool)->GEOM_Object_ptr
Offset = geompy.MakeOffset(Box, 10.) #(GEOM_Object_ptr, Double)->GEOM_Object_ptr
Position = geompy.MakePosition(Box, cs1, cs2) #(3 GEOM_Object)->GEOM_Object
Position2 = geompy.PositionAlongPath(Box, Arc, 0.5, 1, 0) #(2 GEOM_Object, 1 Double, 2 Bool)->GEOM_Object
Offset = geompy.MakeOffset(Box, 10.) #(GEOM_Object, Double)->GEOM_Object
Orientation = geompy.ChangeOrientation(Box)
#IDList for Fillet/Chamfer
@ -254,19 +255,19 @@ def TestAll (geompy, math):
IDlist_f = [f_ind_1, f_ind_2]
#Local operations
Fillet2d = geompy.MakeFillet2D(Face3, radius, [4, 7, 9]) #(GEOM_Object_ptr, Double, ListOfLong)->GEOM_Object_ptr
Fillet2d = geompy.MakeFillet2D(Face3, radius, [4, 7, 9]) #(GEOM_Object, Double, ListOfLong)->GEOM_Object
Fillet = geompy.MakeFillet (Prism, radius, geompy.ShapeType["EDGE"],
IDlist_e) #(GEOM_Object_ptr, Double, Short, ListOfLong)->GEOM_Object_ptr
IDlist_e) #(GEOM_Object, Double, Short, ListOfLong)->GEOM_Object
Fillet2 = geompy.MakeFilletR1R2 (Prism, 7., 13., geompy.ShapeType["EDGE"],
IDlist_e) #(GEOM_Object_ptr, Double, Double, Short, ListOfLong)->GEOM_Object_ptr
IDlist_e) #(GEOM_Object, Double, Double, Short, ListOfLong)->GEOM_Object
Chamfer = geompy.MakeChamferEdge(Prism, d1, d2,
f_ind_1, f_ind_2) #(GEOM_Object_ptr, 2 Doubles, 2 Long)->GEOM_Object_ptr
f_ind_1, f_ind_2) #(GEOM_Object, 2 Doubles, 2 Long)->GEOM_Object
Chamfer2 = geompy.MakeChamferFaces(Prism, d1, d2,
IDlist_f) #(GEOM_Object_ptr, 2 Doubles, ListOfLong)->GEOM_Object_ptr
IDlist_f) #(GEOM_Object, 2 Doubles, ListOfLong)->GEOM_Object
Chamfer3 = geompy.MakeChamferEdges(Prism, d1, d2,
IDlist_e) #(GEOM_Object_ptr, 2 Doubles, ListOfLong)->GEOM_Object_ptr
IDlist_e) #(GEOM_Object, 2 Doubles, ListOfLong)->GEOM_Object
Chamfer4 = geompy.MakeChamferFacesAD(Prism, d1, 20. * math.pi / 180.,
IDlist_f) #(GEOM_Object_ptr, 2 Doubles, ListOfLong)->GEOM_Object_ptr
IDlist_f) #(GEOM_Object, 2 Doubles, ListOfLong)->GEOM_Object
#End of Local operations
#Create Patterns
@ -277,18 +278,18 @@ def TestAll (geompy, math):
MultiRot2D = geompy.MultiRotate2D(Chamfer, vx, angle, nbtimes1, step1, nbtimes2)
#Create Informations objects
CDG = geompy.MakeCDG(Prism) #(GEOM_Object_ptr)->GEOM_Object_ptr
CDG = geompy.MakeCDG(Prism) #(GEOM_Object)->GEOM_Object
Archimede = geompy.Archimede(Box, weight, waterdensity,
meshingdeflection) #(GEOM_Object_ptr, 3 Doubles)->GEOM_Object_ptr
mindist = geompy.MinDistanceComponents(TranslVect, Mirror) #(2 GEOM_Object_ptr)->4 Doubles
meshingdeflection) #(GEOM_Object, 3 Doubles)->GEOM_Object
mindist = geompy.MinDistanceComponents(TranslVect, Mirror) #(2 GEOM_Object)->4 Doubles
print "Minumal distance between TranslVect and Mirror is", mindist[0],
print "by components:", mindist[1], ",", mindist[2], ",", mindist[3]
CheckShape = geompy.CheckShape(Prism) #(GEOM_Object_ptr)->Boolean
CheckShape = geompy.CheckShape(Prism) #(GEOM_Object)->Boolean
print "CheckShape(Prism) = ", CheckShape
#Partition objects
Partition = geompy.MakePartition([Box], [Plane]) #(2 Lists Of GEOM_Object_ptr)->GEOM_Object_ptr
Partition1 = geompy.MakeHalfPartition(Box, Plane) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
Partition = geompy.MakePartition([Box], [Plane]) #(2 Lists Of GEOM_Object)->GEOM_Object
Partition1 = geompy.MakeHalfPartition(Box, Plane) #(2 GEOM_Object)->GEOM_Object
#Add In Study
id_p0 = geompy.addToStudy(p0, "Vertex 0")
@ -331,7 +332,8 @@ def TestAll (geompy, math):
id_Sketcher3d = geompy.addToStudy(Sketcher3d, "Sketcher 3D")
id_p_on_arc = geompy.addToStudy(p_on_arc, "Vertex on Arc (0.25)")
id_p_on_arc2 = geompy.addToStudy(p_on_arc2, "Vertex on Arc at(100, -10, 10)" )
id_p_on_arc2 = geompy.addToStudy(p_on_arc2, "Vertex on Arc at(100, -10, 10)" )
id_p_on_arc3 = geompy.addToStudy(p_on_arc3, "Vertex on Arc length 50 from Vertex X" )
id_p_on_l1l2 = geompy.addToStudy(p_on_l1l2, "Vertex on Lines Intersection")
@ -357,6 +359,7 @@ def TestAll (geompy, math):
id_Section = geompy.addToStudy(Section, "Section")
id_Edge = geompy.addToStudy(Edge, "Edge")
id_Edge1 = geompy.addToStudy(Edge1, "Edge on Arc length 50 from Vertex Y")
id_Wire = geompy.addToStudy(Wire, "Wire")
id_Face = geompy.addToStudy(Face, "Face")
id_Face1 = geompy.addToStudy(Face1, "Face from two wires")

View File

@ -514,15 +514,16 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Create a point, corresponding to the given length on the given curve.
# @param theRefCurve The referenced curve.
# @param theLength Length on the referenced curve.
# @param theReverse Flag allowing to choose the direction for the calculation of the length (False = forward or True = reversed).
# @param theLength Length on the referenced curve. It can be negative.
# @param theStartPoint Point allowing to choose the direction for the calculation
# of the length. If None, start from the first point of theRefCurve.
# @return New GEOM_Object, containing the created point.
#
# @ref tui_creation_point "Example"
def MakeVertexOnCurveByLength(self,theRefCurve, theLength, theReverse = False):
def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
# Example: see GEOM_TestAll.py
theLength, Parameters = ParseParameters(theLength)
anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theReverse)
anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
anObj.SetParameters(Parameters)
return anObj
@ -1636,6 +1637,23 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakeEdge", self.ShapesOp)
return anObj
## Create a new edge, corresponding to the given length on the given curve.
# @param theRefCurve The referenced curve (edge).
# @param theLength Length on the referenced curve. It can be negative.
# @param theStartPoint Any point can be selected for it, the new edge will begin
# at the end of \a theRefCurve, close to the selected point.
# If None, start from the first point of \a theRefCurve.
# @return New GEOM_Object, containing the created edge.
#
# @ref tui_creation_edge "Example"
def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
# Example: see GEOM_TestAll.py
theLength, Parameters = ParseParameters(theLength)
anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
RaiseIfFailed("MakeEdgeOnCurveByLength", self.BasicOp)
anObj.SetParameters(Parameters)
return anObj
## Create an edge from specified wire.
# @param theWire source Wire.
# @param theLinearTolerance linear tolerance value.