Change order of arguments for MakeOffsetPartial

This commit is contained in:
jfa 2024-08-14 12:03:43 +01:00
parent d4358a0c9c
commit 4905a23be0
8 changed files with 19 additions and 19 deletions

View File

@ -13,7 +13,7 @@ box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
# create a new object as offset of the given object
offset = geompy.MakeOffset(box, 70.)
offset2 = geompy.MakeOffsetIntersectionJoin(box, 70.)
offset3 = geompy.MakeOffsetPartial(box, [13, 33], 70.)
offset3 = geompy.MakeOffsetPartial(box, 70., [13, 33])
# add objects in the study
id_box = geompy.addToStudy(box, "Box")

View File

@ -47,11 +47,11 @@ the offset.
\n \ref restore_presentation_parameters_page "Advanced options".
\n <b>TUI Command:</b>
- <em>geompy.MakeOffsetPartial(Shape, ListOfFacesIDs, Offset),</em>
- <em>geompy.MakeOffsetPartial(Shape, Offset, ListOfFacesIDs),</em>
where \b Shape is a shape(s) which has to be an offset,
\b ListOfFacesIDs is a list of integer IDs of sub-faces and
\b Offset is a value of the offset.
\b Offset is a value of the offset,
\b ListOfFacesIDs is a list of integer IDs of sub-faces.
Our <b>TUI Scripts</b> provide you with useful examples of the use of
\ref tui_offset "Transformation Operations".

View File

@ -1349,13 +1349,13 @@ module GEOM
* \brief Create new object as offset of the given one.
* Only indexed faces are offset, others keep they original location.
* \param theObject The base object for the offset.
* \param theFacesIDs The list of face IDs indicating faces to be offset.
* \param theOffset Offset value.
* \param theFacesIDs The list of face IDs indicating faces to be offset.
* \return New GEOM_Object, containing the offset object.
*/
GEOM_Object OffsetShapePartialCopy (in GEOM_Object theObject,
in ListOfLong theFacesIDs,
in double theOffset);
in double theOffset,
in ListOfLong theFacesIDs);
/*!
* \brief Create new object as projection of the given one on a 2D surface.

View File

@ -1148,14 +1148,14 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::OffsetShapeCopy
else {
GEOM::TPythonDump pd (aFunction);
pd << aCopy << " = geompy.MakeOffsetPartial("
<< theObject << ", [";
<< theObject << ", " << theOffset << ", [";
// Dump faces IDs.
for (Standard_Integer i = theFacesIDs->Lower(); i <= theFacesIDs->Upper(); ++i) {
pd << theFacesIDs->Value(i) << ((i == theFacesIDs->Upper()) ? "" : ", ");
}
pd << "], " << theOffset << ")";
pd << "])";
}
SetErrorCode(OK);

View File

@ -675,8 +675,8 @@ GEOM_ITransformOperations_i::OffsetShapeCopy (GEOM::GEOM_Object_ptr theObject,
//=============================================================================
GEOM::GEOM_Object_ptr
GEOM_ITransformOperations_i::OffsetShapePartialCopy (GEOM::GEOM_Object_ptr theObject,
const GEOM::ListOfLong& theFacesIDs,
CORBA::Double theOffset)
CORBA::Double theOffset,
const GEOM::ListOfLong& theFacesIDs)
{
GEOM::GEOM_Object_var aGEOMObject;

View File

@ -143,8 +143,8 @@ class GEOM_I_EXPORT GEOM_ITransformOperations_i :
CORBA::Boolean theJoinByPipes);
GEOM::GEOM_Object_ptr OffsetShapePartialCopy (GEOM::GEOM_Object_ptr theObject,
const GEOM::ListOfLong& theFacesIDs,
CORBA::Double theOffset);
CORBA::Double theOffset,
const GEOM::ListOfLong& theFacesIDs);
GEOM::GEOM_Object_ptr ProjectShapeCopy (GEOM::GEOM_Object_ptr theSource,
GEOM::GEOM_Object_ptr theTarget);

View File

@ -9628,8 +9628,8 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
# Gap between adjacent offset surfaces is filled
# by extending and intersecting them.
# @param theObject The base object for the offset.
# @param theFacesIDs The list of face IDs indicating faces to be offset.
# @param theOffset Offset value.
# @param theFacesIDs The list of face IDs indicating faces to be offset.
# @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
@ -9638,7 +9638,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
#
# @ref tui_offset "Example"
@ManageTransactions("TrsfOp")
def MakeOffsetPartial(self, theObject, theFacesIDs, theOffset, theName=None):
def MakeOffsetPartial(self, theObject, theOffset, theFacesIDs, theName=None):
"""
Create new object as partial offset of the given one.
Only indexed faces are offset, others keep they original location.
@ -9647,8 +9647,8 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
Parameters:
theObject The base object for the offset.
theFacesIDs The list of face IDs indicating faces to be offset.
theOffset Offset value.
theFacesIDs The list of face IDs indicating faces to be offset.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
@ -9659,10 +9659,10 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
Example of usage:
box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
# create a new object from the box, offsetting its top and front faces
offset = geompy.MakeOffsetPartial(box, [13, 33], 70.)
offset = geompy.MakeOffsetPartial(box, 70., [13, 33])
"""
theOffset, Parameters = ParseParameters(theOffset)
anObj = self.TrsfOp.OffsetShapePartialCopy(theObject, theFacesIDs, theOffset)
anObj = self.TrsfOp.OffsetShapePartialCopy(theObject, theOffset, theFacesIDs)
RaiseIfFailed("OffsetShapePartialCopy", self.TrsfOp)
anObj.SetParameters(Parameters)
self._autoPublish(anObj, theName, "offset")

View File

@ -401,7 +401,7 @@ bool TransformationGUI_OffsetDlg::execute( ObjectList& objects )
}
anObj = anOper->OffsetShapePartialCopy
(myObjects[0].get(), aFacesIDsList, GetOffset());
(myObjects[0].get(), GetOffset(), aFacesIDsList);
if (!anObj->_is_nil()) {
if (!IsPreview()) {
anObj->SetParameters(GroupPoints->SpinBox_DX->text().toUtf8().constData());