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 # create a new object as offset of the given object
offset = geompy.MakeOffset(box, 70.) offset = geompy.MakeOffset(box, 70.)
offset2 = geompy.MakeOffsetIntersectionJoin(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 # add objects in the study
id_box = geompy.addToStudy(box, "Box") id_box = geompy.addToStudy(box, "Box")

View File

@ -47,11 +47,11 @@ the offset.
\n \ref restore_presentation_parameters_page "Advanced options". \n \ref restore_presentation_parameters_page "Advanced options".
\n <b>TUI Command:</b> \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, 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 Our <b>TUI Scripts</b> provide you with useful examples of the use of
\ref tui_offset "Transformation Operations". \ref tui_offset "Transformation Operations".

View File

@ -1349,13 +1349,13 @@ module GEOM
* \brief Create new object as offset of the given one. * \brief Create new object as offset of the given one.
* Only indexed faces are offset, others keep they original location. * Only indexed faces are offset, others keep they original location.
* \param theObject The base object for the offset. * \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 theOffset Offset value.
* \param theFacesIDs The list of face IDs indicating faces to be offset.
* \return New GEOM_Object, containing the offset object. * \return New GEOM_Object, containing the offset object.
*/ */
GEOM_Object OffsetShapePartialCopy (in GEOM_Object theObject, 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. * \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 { else {
GEOM::TPythonDump pd (aFunction); GEOM::TPythonDump pd (aFunction);
pd << aCopy << " = geompy.MakeOffsetPartial(" pd << aCopy << " = geompy.MakeOffsetPartial("
<< theObject << ", ["; << theObject << ", " << theOffset << ", [";
// Dump faces IDs. // Dump faces IDs.
for (Standard_Integer i = theFacesIDs->Lower(); i <= theFacesIDs->Upper(); ++i) { for (Standard_Integer i = theFacesIDs->Lower(); i <= theFacesIDs->Upper(); ++i) {
pd << theFacesIDs->Value(i) << ((i == theFacesIDs->Upper()) ? "" : ", "); pd << theFacesIDs->Value(i) << ((i == theFacesIDs->Upper()) ? "" : ", ");
} }
pd << "], " << theOffset << ")"; pd << "])";
} }
SetErrorCode(OK); SetErrorCode(OK);

View File

@ -675,8 +675,8 @@ GEOM_ITransformOperations_i::OffsetShapeCopy (GEOM::GEOM_Object_ptr theObject,
//============================================================================= //=============================================================================
GEOM::GEOM_Object_ptr GEOM::GEOM_Object_ptr
GEOM_ITransformOperations_i::OffsetShapePartialCopy (GEOM::GEOM_Object_ptr theObject, 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; GEOM::GEOM_Object_var aGEOMObject;

View File

@ -143,8 +143,8 @@ class GEOM_I_EXPORT GEOM_ITransformOperations_i :
CORBA::Boolean theJoinByPipes); CORBA::Boolean theJoinByPipes);
GEOM::GEOM_Object_ptr OffsetShapePartialCopy (GEOM::GEOM_Object_ptr theObject, 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 ProjectShapeCopy (GEOM::GEOM_Object_ptr theSource,
GEOM::GEOM_Object_ptr theTarget); GEOM::GEOM_Object_ptr theTarget);

View File

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

View File

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