## to a lot of duplicated items in the study.
## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
-## - Not that some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
+## - Some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
## \a theName parameter (and, thus, do not support automatic publication).
## For example, some transformation operations like
## \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
## Refer to the documentation to check if some function has such possibility.
##
+## It is possible to customize the representation of the geometrical
+## data in the data tree; this can be done by using folders. A folder can
+## be created in the study tree using function
+## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
+## (by default it is created under the "Geometry" root object).
+## As soon as folder is created, any published geometry object
+## can be moved into it.
+##
+## For example:
+##
+## @code
+## import salome
+## from salome.geom import geomBuilder
+## geompy = geomBuilder.New(salome.myStudy)
+## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
+## # the box was created and published in the study
+## folder = geompy.NewFolder("Primitives")
+## # an empty "Primitives" folder was created under default "Geometry" root object
+## geompy.PutToFolder(box, folder)
+## # the box was moved into "Primitives" folder
+## @endcode
+##
+## Subfolders are also can be created by specifying another folder as a parent:
+##
+## @code
+## subfolder = geompy.NewFolder("3D", folder)
+## # "3D" folder was created under "Primitives" folder
+## @endcode
+##
+## @note
+## - Folder container is just a representation layer object that
+## deals with already published objects only. So, any geometry object
+## should be published in the study (for example, with
+## \ref geomBuilder.geomBuilder.PutToFolder() "addToStudy()" function)
+## BEFORE moving it into any existing folder.
+## - \ref geomBuilder.geomBuilder.PutToFolder() "PutToFolder()" function
+## does not change physical position of geometry object in the study tree,
+## it only affects on the representation of the data tree.
+## - It is impossible to publish geometry object using any folder as father.
+##
## @}
self._autoPublish(anObj, theName, "curve")
return anObj
+ ## Create an isoline curve on a face.
+ # @param theFace the face for which an isoline is created.
+ # @param IsUIsoline True for U-isoline creation; False for V-isoline
+ # creation.
+ # @param theParameter the U parameter for U-isoline or V parameter
+ # for V-isoline.
+ # @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.
+ #
+ # @return New GEOM.GEOM_Object, containing the created isoline edge or
+ # a compound of edges.
+ #
+ # @ref tui_creation_curve "Example"
+ def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
+ """
+ Create an isoline curve on a face.
+
+ Parameters:
+ theFace the face for which an isoline is created.
+ IsUIsoline True for U-isoline creation; False for V-isoline
+ creation.
+ theParameter the U parameter for U-isoline or V parameter
+ for V-isoline.
+ 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.
+
+ Returns:
+ New GEOM.GEOM_Object, containing the created isoline edge or a
+ compound of edges.
+ """
+ # Example: see GEOM_TestAll.py
+ anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
+ RaiseIfFailed("MakeIsoline", self.CurvesOp)
+ if IsUIsoline:
+ self._autoPublish(anObj, theName, "U-Isoline")
+ else:
+ self._autoPublish(anObj, theName, "V-Isoline")
+ return anObj
+
# end of l4_curves
## @}
# @param theShape2 Second argument for boolean operation.
# @param theOperation Indicates the operation to be done:\n
# 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @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.
# @return New GEOM.GEOM_Object, containing the result shape.
#
# @ref tui_fuse "Example"
- def MakeBoolean(self, theShape1, theShape2, theOperation, theName=None):
+ def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
"""
Perform one of boolean operations on two given shapes.
theShape2 Second argument for boolean operation.
theOperation Indicates the operation to be done:
1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
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.
New GEOM.GEOM_Object, containing the result shape.
"""
# Example: see GEOM_TestAll.py
- anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
+ anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
RaiseIfFailed("MakeBoolean", self.BoolOp)
def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
self._autoPublish(anObj, theName, def_names[theOperation])
## Perform Common boolean operation on two given shapes.
# @param theShape1 First argument for boolean operation.
# @param theShape2 Second argument for boolean operation.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @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.
#
# @ref tui_common "Example 1"
# \n @ref swig_MakeCommon "Example 2"
- def MakeCommon(self, theShape1, theShape2, theName=None):
+ def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
"""
Perform Common boolean operation on two given shapes.
Parameters:
theShape1 First argument for boolean operation.
theShape2 Second argument for boolean operation.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
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.
"""
# Example: see GEOM_TestOthers.py
# note: auto-publishing is done in self.MakeBoolean()
- return self.MakeBoolean(theShape1, theShape2, 1, theName)
+ return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
## Perform Cut boolean operation on two given shapes.
# @param theShape1 First argument for boolean operation.
# @param theShape2 Second argument for boolean operation.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @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.
#
# @ref tui_cut "Example 1"
# \n @ref swig_MakeCommon "Example 2"
- def MakeCut(self, theShape1, theShape2, theName=None):
+ def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
"""
Perform Cut boolean operation on two given shapes.
Parameters:
theShape1 First argument for boolean operation.
theShape2 Second argument for boolean operation.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
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.
"""
# Example: see GEOM_TestOthers.py
# note: auto-publishing is done in self.MakeBoolean()
- return self.MakeBoolean(theShape1, theShape2, 2, theName)
+ return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
## Perform Fuse boolean operation on two given shapes.
# @param theShape1 First argument for boolean operation.
# @param theShape2 Second argument for boolean operation.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @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.
#
# @ref tui_fuse "Example 1"
# \n @ref swig_MakeCommon "Example 2"
- def MakeFuse(self, theShape1, theShape2, theName=None):
+ def MakeFuse(self, theShape1, theShape2, checkSelfInte=False, theName=None):
"""
Perform Fuse boolean operation on two given shapes.
Parameters:
theShape1 First argument for boolean operation.
theShape2 Second argument for boolean operation.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
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.
"""
# Example: see GEOM_TestOthers.py
# note: auto-publishing is done in self.MakeBoolean()
- return self.MakeBoolean(theShape1, theShape2, 3, theName)
+ return self.MakeBoolean(theShape1, theShape2, 3, checkSelfInte, theName)
## Perform Section boolean operation on two given shapes.
# @param theShape1 First argument for boolean operation.
# @param theShape2 Second argument for boolean operation.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @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.
#
# @ref tui_section "Example 1"
# \n @ref swig_MakeCommon "Example 2"
- def MakeSection(self, theShape1, theShape2, theName=None):
+ def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
"""
Perform Section boolean operation on two given shapes.
Parameters:
theShape1 First argument for boolean operation.
theShape2 Second argument for boolean operation.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
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.
"""
# Example: see GEOM_TestOthers.py
# note: auto-publishing is done in self.MakeBoolean()
- return self.MakeBoolean(theShape1, theShape2, 4, theName)
+ return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
## Perform Fuse boolean operation on the list of shapes.
# @param theShapesList Shapes to be fused.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @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.
#
# @ref tui_fuse "Example 1"
# \n @ref swig_MakeCommon "Example 2"
- def MakeFuseList(self, theShapesList, theName=None):
+ def MakeFuseList(self, theShapesList, checkSelfInte=False, theName=None):
"""
Perform Fuse boolean operation on the list of shapes.
Parameters:
theShapesList Shapes to be fused.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
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.
"""
# Example: see GEOM_TestOthers.py
- anObj = self.BoolOp.MakeFuseList(theShapesList)
+ anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte)
RaiseIfFailed("MakeFuseList", self.BoolOp)
self._autoPublish(anObj, theName, "fuse")
return anObj
## Perform Common boolean operation on the list of shapes.
# @param theShapesList Shapes for Common operation.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @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.
#
# @ref tui_common "Example 1"
# \n @ref swig_MakeCommon "Example 2"
- def MakeCommonList(self, theShapesList, theName=None):
+ def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
"""
Perform Common boolean operation on the list of shapes.
Parameters:
theShapesList Shapes for Common operation.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
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.
"""
# Example: see GEOM_TestOthers.py
- anObj = self.BoolOp.MakeCommonList(theShapesList)
+ anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
RaiseIfFailed("MakeCommonList", self.BoolOp)
self._autoPublish(anObj, theName, "common")
return anObj
## Perform Cut boolean operation on one object and the list of tools.
# @param theMainShape The object of the operation.
# @param theShapesList The list of tools of the operation.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @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.
#
# @ref tui_cut "Example 1"
# \n @ref swig_MakeCommon "Example 2"
- def MakeCutList(self, theMainShape, theShapesList, theName=None):
+ def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
"""
Perform Cut boolean operation on one object and the list of tools.
Parameters:
theMainShape The object of the operation.
theShapesList The list of tools of the operation.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
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.
"""
# Example: see GEOM_TestOthers.py
- anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList)
+ anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
RaiseIfFailed("MakeCutList", self.BoolOp)
self._autoPublish(anObj, theName, "cut")
return anObj
# target type (equal to Limit) are kept in the result,
# else standalone shapes of lower dimension
# are kept also (if they exist).
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @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.
# @ref tui_partition "Example"
def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
- KeepNonlimitShapes=0, theName=None):
+ KeepNonlimitShapes=0, checkSelfInte=False, theName=None):
"""
Perform partition operation.
target type (equal to Limit) are kept in the result,
else standalone shapes of lower dimension
are kept also (if they exist).
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
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.
anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
ListKeepInside, ListRemoveInside,
Limit, RemoveWebs, ListMaterials,
- KeepNonlimitShapes);
+ KeepNonlimitShapes, checkSelfInte);
RaiseIfFailed("MakePartition", self.BoolOp)
self._autoPublish(anObj, theName, "partition")
return anObj
ListKeepInside=[], ListRemoveInside=[],
Limit=ShapeType["AUTO"], RemoveWebs=0,
ListMaterials=[], KeepNonlimitShapes=0,
- theName=None):
+ checkSelfInte=False, theName=None):
"""
Perform partition operation.
This method may be useful if it is needed to make a partition for
anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
ListKeepInside, ListRemoveInside,
Limit, RemoveWebs, ListMaterials,
- KeepNonlimitShapes);
+ KeepNonlimitShapes, checkSelfInte);
RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
self._autoPublish(anObj, theName, "partition")
return anObj
# \n @ref swig_Partition "Example 2"
def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
- KeepNonlimitShapes=0, theName=None):
+ KeepNonlimitShapes=0, checkSelfInte=False, theName=None):
"""
See method geompy.MakePartition for more information.
"""
anObj = self.MakePartition(ListShapes, ListTools,
ListKeepInside, ListRemoveInside,
Limit, RemoveWebs, ListMaterials,
- KeepNonlimitShapes, theName);
+ KeepNonlimitShapes, checkSelfInte,
+ theName);
return anObj
## Perform partition of the Shape with the Plane
# @param theShape Shape to be intersected.
# @param thePlane Tool shape, to intersect theShape.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @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.
# @return New GEOM.GEOM_Object, containing the result shape.
#
# @ref tui_partition "Example"
- def MakeHalfPartition(self, theShape, thePlane, theName=None):
+ def MakeHalfPartition(self, theShape, thePlane, checkSelfInte=False, theName=None):
"""
Perform partition of the Shape with the Plane
Parameters:
theShape Shape to be intersected.
thePlane Tool shape, to intersect theShape.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
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.
New GEOM.GEOM_Object, containing the result shape.
"""
# Example: see GEOM_TestAll.py
- anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
+ anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane, checkSelfInte)
RaiseIfFailed("MakeHalfPartition", self.BoolOp)
self._autoPublish(anObj, theName, "partition")
return anObj
RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
self._autoPublish(anObj, theName, "projection")
return anObj
+
+ ## Create a projection projection of the given point on a wire or an edge.
+ # If there are no solutions or there are 2 or more solutions It throws an
+ # exception.
+ # @param thePoint the point to be projected.
+ # @param theWire the wire. The edge is accepted as well.
+ # @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.
+ #
+ # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
+ # \n \a u: The parameter of projection point on edge.
+ # \n \a PointOnEdge: The projection point.
+ # \n \a EdgeInWireIndex: The index of an edge in a wire.
+ #
+ # @ref tui_projection "Example"
+ def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
+ """
+ Create a projection projection of the given point on a wire or an edge.
+ If there are no solutions or there are 2 or more solutions It throws an
+ exception.
+
+ Parameters:
+ thePoint the point to be projected.
+ theWire the wire. The edge is accepted as well.
+ 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.
+
+ Returns:
+ [u, PointOnEdge, EdgeInWireIndex]
+ u: The parameter of projection point on edge.
+ PointOnEdge: The projection point.
+ EdgeInWireIndex: The index of an edge in a wire.
+ """
+ # Example: see GEOM_TestAll.py
+ anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
+ RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
+ self._autoPublish(anObj[1], theName, "projection")
+ return anObj
# -----------------------------------------------------------------------------
# Patterns
# @param Father parent object. If None,
# folder under 'Geometry' root object will be created.
# @return a new created folder
+ # @ingroup l1_publish_data
def NewFolder(self, Name, Father=None):
"""
Create a new folder object. It is an auxiliary container for any GEOM objects.
## Move object to the specified folder
# @param Object object to move
# @param Folder target folder
+ # @ingroup l1_publish_data
def PutToFolder(self, Object, Folder):
"""
Move object to the specified folder
## Move list of objects to the specified folder
# @param ListOfSO list of objects to move
# @param Folder target folder
+ # @ingroup l1_publish_data
def PutListToFolder(self, ListOfSO, Folder):
"""
Move list of objects to the specified folder
## Remove a time step from the field
def removeStep(self,step):
"Remove a time step from the field"
+ stepSO = None
+ try:
+ stepObj = self.field.GetStep( self, step )
+ if stepObj:
+ stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
+ except:
+ #import traceback
+ #traceback.print_exc()
+ pass
self.field.RemoveStep( self, step )
+ if stepSO:
+ geom.myBuilder.RemoveObjectWithChildren( stepSO )
return
## Returns number of time steps in the field