Back to index

salome-geom  6.5.0
Functions
Basic Operations
Transforming geometrical objects
Collaboration diagram for Basic Operations:

Functions

def geompyDC.geompyDC.MakePartition
 Perform partition operation.
def geompyDC.geompyDC.MakePartitionNonSelfIntersectedShape
 Perform partition operation.
def geompyDC.geompyDC.Partition
 See method MakePartition() for more information.
def geompyDC.geompyDC.MakeHalfPartition
 Perform partition of the Shape with the Plane.
def geompyDC.geompyDC.Archimede
 Perform an Archimde operation on the given shape with given parameters.

Function Documentation

def geompyDC.geompyDC.Archimede (   self,
  theShape,
  theWeight,
  theWaterDensity,
  theMeshDeflection 
)

Perform an Archimde operation on the given shape with given parameters.

The object presenting the resulting face is returned.

Parameters:
theShapeShape to be put in water.
theWeightWeight og the shape.
theWaterDensityDensity of the water.
theMeshDeflectionDeflection of the mesh, using to compute the section.
Returns:
New GEOM.GEOM_Object, containing a section of theShape by a plane, corresponding to water level.

Example

Perform an Archimde operation on the given shape with given parameters.
The object presenting the resulting face is returned.

Parameters: 
    theShape Shape to be put in water.
    theWeight Weight og the shape.
    theWaterDensity Density of the water.
    theMeshDeflection Deflection of the mesh, using to compute the section.

Returns: 
    New GEOM.GEOM_Object, containing a section of theShape
    by a plane, corresponding to water level.

Definition at line 6335 of file geompyDC.py.

06335 
06336         def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
06337             """
06338             Perform an Archimde operation on the given shape with given parameters.
06339             The object presenting the resulting face is returned.
06340 
06341             Parameters: 
06342                 theShape Shape to be put in water.
06343                 theWeight Weight og the shape.
06344                 theWaterDensity Density of the water.
06345                 theMeshDeflection Deflection of the mesh, using to compute the section.
06346 
06347             Returns: 
06348                 New GEOM.GEOM_Object, containing a section of theShape
06349                 by a plane, corresponding to water level.
06350             """
06351             # Example: see GEOM_TestAll.py
06352             theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
06353               theWeight,theWaterDensity,theMeshDeflection)
06354             anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
06355             RaiseIfFailed("MakeArchimede", self.LocalOp)
06356             anObj.SetParameters(Parameters)
06357             return anObj

Here is the call graph for this function:

def geompyDC.geompyDC.MakeHalfPartition (   self,
  theShape,
  thePlane 
)

Perform partition of the Shape with the Plane.

Parameters:
theShapeShape to be intersected.
thePlaneTool shape, to intersect theShape.
Returns:
New GEOM.GEOM_Object, containing the result shape.

Example

Perform partition of the Shape with the Plane

Parameters: 
    theShape Shape to be intersected.
    thePlane Tool shape, to intersect theShape.

Returns:  
    New GEOM.GEOM_Object, containing the result shape.

Definition at line 5143 of file geompyDC.py.

05143 
05144         def MakeHalfPartition(self,theShape, thePlane):
05145             """
05146             Perform partition of the Shape with the Plane
05147 
05148             Parameters: 
05149                 theShape Shape to be intersected.
05150                 thePlane Tool shape, to intersect theShape.
05151 
05152             Returns:  
05153                 New GEOM.GEOM_Object, containing the result shape.
05154             """
05155             # Example: see GEOM_TestAll.py
05156             anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
05157             RaiseIfFailed("MakeHalfPartition", self.BoolOp)
05158             return anObj

Here is the call graph for this function:

def geompyDC.geompyDC.MakePartition (   self,
  ListShapes,
  ListTools = [],
  ListKeepInside = [],
  ListRemoveInside = [],
  Limit = ShapeType["AUTO"],
  RemoveWebs = 0,
  ListMaterials = [],
  KeepNonlimitShapes = 0 
)

Perform partition operation.

Parameters:
ListShapesShapes to be intersected.
ListToolsShapes to intersect theShapes.
LimitType of resulting shapes (see ShapeType()).
If this parameter is set to -1 ("Auto"), most appropriate shape limit type will be detected automatically.
KeepNonlimitShapesif this parameter == 0, then only shapes of target type (equal to Limit) are kept in the result, else standalone shapes of lower dimension are kept also (if they exist).
Note:
Each compound from ListShapes and ListTools will be exploded in order to avoid possible intersection between shapes from this compound.

After implementation new version of PartitionAlgo (October 2006) other parameters are ignored by current functionality. They are kept in this function only for support old versions.

Parameters:
ListKeepInsideShapes, outside which the results will be deleted. Each shape from theKeepInside must belong to theShapes also.
ListRemoveInsideShapes, inside which the results will be deleted. Each shape from theRemoveInside must belong to theShapes also.
RemoveWebsIf TRUE, perform Glue 3D algorithm.
ListMaterialsMaterial indices for each shape. Make sence, only if theRemoveWebs is TRUE.
Returns:
New GEOM.GEOM_Object, containing the result shapes.

Example

Perform partition operation.

Parameters: 
    ListShapes Shapes to be intersected.
    ListTools Shapes to intersect theShapes.
    Limit Type of resulting shapes (see geompy.ShapeType)
          If this parameter is set to -1 ("Auto"), most appropriate shape limit
          type will be detected automatically.
    KeepNonlimitShapes if this parameter == 0, then only shapes of
            target type (equal to Limit) are kept in the result,
            else standalone shapes of lower dimension
            are kept also (if they exist).
Note:
        Each compound from ListShapes and ListTools will be exploded
        in order to avoid possible intersection between shapes from
        this compound.
        
After implementation new version of PartitionAlgo (October 2006) other
parameters are ignored by current functionality. They are kept in this
function only for support old versions.

Ignored parameters:
    ListKeepInside Shapes, outside which the results will be deleted.
       Each shape from theKeepInside must belong to theShapes also.
    ListRemoveInside Shapes, inside which the results will be deleted.
         Each shape from theRemoveInside must belong to theShapes also.
    RemoveWebs If TRUE, perform Glue 3D algorithm.
    ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.

Returns:   
    New GEOM.GEOM_Object, containing the result shapes.

Definition at line 5026 of file geompyDC.py.

05026 
05027                           KeepNonlimitShapes=0):
05028             """
05029             Perform partition operation.
05030 
05031             Parameters: 
05032                 ListShapes Shapes to be intersected.
05033                 ListTools Shapes to intersect theShapes.
05034                 Limit Type of resulting shapes (see geompy.ShapeType)
05035                       If this parameter is set to -1 ("Auto"), most appropriate shape limit
05036                       type will be detected automatically.
05037                 KeepNonlimitShapes if this parameter == 0, then only shapes of
05038                                     target type (equal to Limit) are kept in the result,
05039                                     else standalone shapes of lower dimension
05040                                     are kept also (if they exist).
05041             Note:
05042                     Each compound from ListShapes and ListTools will be exploded
05043                     in order to avoid possible intersection between shapes from
05044                     this compound.
05045                     
05046             After implementation new version of PartitionAlgo (October 2006) other
05047             parameters are ignored by current functionality. They are kept in this
05048             function only for support old versions.
05049             
05050             Ignored parameters:
05051                 ListKeepInside Shapes, outside which the results will be deleted.
05052                                Each shape from theKeepInside must belong to theShapes also.
05053                 ListRemoveInside Shapes, inside which the results will be deleted.
05054                                  Each shape from theRemoveInside must belong to theShapes also.
05055                 RemoveWebs If TRUE, perform Glue 3D algorithm.
05056                 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
05057 
05058             Returns:   
05059                 New GEOM.GEOM_Object, containing the result shapes.
05060             """
05061             # Example: see GEOM_TestAll.py
05062             if Limit == ShapeType["AUTO"]:
05063                 # automatic detection of the most appropriate shape limit type
05064                 lim = GEOM.SHAPE
05065                 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
05066                 Limit = EnumToLong(lim)
05067                 pass
05068             anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
05069                                               ListKeepInside, ListRemoveInside,
05070                                               Limit, RemoveWebs, ListMaterials,
05071                                               KeepNonlimitShapes);
05072             RaiseIfFailed("MakePartition", self.BoolOp)
05073             return anObj

Here is the call graph for this function:

Here is the caller graph for this function:

def geompyDC.geompyDC.MakePartitionNonSelfIntersectedShape (   self,
  ListShapes,
  ListTools = [],
  ListKeepInside = [],
  ListRemoveInside = [],
  Limit = ShapeType["AUTO"],
  RemoveWebs = 0,
  ListMaterials = [],
  KeepNonlimitShapes = 0 
)

Perform partition operation.

This method may be useful if it is needed to make a partition for compound contains nonintersected shapes. Performance will be better since intersection between shapes from compound is not performed.

Description of all parameters as in previous method MakePartition()

Note:
Passed compounds (via ListShapes or via ListTools) have to consist of nonintersecting shapes.
Returns:
New GEOM.GEOM_Object, containing the result shapes.

Example

Perform partition operation.
This method may be useful if it is needed to make a partition for
compound contains nonintersected shapes. Performance will be better
since intersection between shapes from compound is not performed.

Parameters: 
    Description of all parameters as in method geompy.MakePartition
        
NOTE:
    Passed compounds (via ListShapes or via ListTools)
    have to consist of nonintersecting shapes.

Returns:   
    New GEOM.GEOM_Object, containing the result shapes.

Definition at line 5090 of file geompyDC.py.

05090 
05091                                                  ListMaterials=[], KeepNonlimitShapes=0):
05092             """
05093             Perform partition operation.
05094             This method may be useful if it is needed to make a partition for
05095             compound contains nonintersected shapes. Performance will be better
05096             since intersection between shapes from compound is not performed.
05097 
05098             Parameters: 
05099                 Description of all parameters as in method geompy.MakePartition
05100         
05101             NOTE:
05102                 Passed compounds (via ListShapes or via ListTools)
05103                 have to consist of nonintersecting shapes.
05104 
05105             Returns:   
05106                 New GEOM.GEOM_Object, containing the result shapes.
05107             """
05108             if Limit == ShapeType["AUTO"]:
05109                 # automatic detection of the most appropriate shape limit type
05110                 lim = GEOM.SHAPE
05111                 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
05112                 Limit = EnumToLong(lim)
05113                 pass
05114             anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
05115                                                                      ListKeepInside, ListRemoveInside,
05116                                                                      Limit, RemoveWebs, ListMaterials,
05117                                                                      KeepNonlimitShapes);
05118             RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
05119             return anObj

Here is the call graph for this function:

Here is the caller graph for this function:

def geompyDC.geompyDC.Partition (   self,
  ListShapes,
  ListTools = [],
  ListKeepInside = [],
  ListRemoveInside = [],
  Limit = ShapeType["AUTO"],
  RemoveWebs = 0,
  ListMaterials = [],
  KeepNonlimitShapes = 0 
)

See method MakePartition() for more information.

Example 1
Example 2

See method geompy.MakePartition for more information.

Definition at line 5126 of file geompyDC.py.

05126 
05127                       KeepNonlimitShapes=0):
05128             """
05129             See method geompy.MakePartition for more information.
05130             """
05131             # Example: see GEOM_TestOthers.py
05132             anObj = self.MakePartition(ListShapes, ListTools,
05133                                        ListKeepInside, ListRemoveInside,
05134                                        Limit, RemoveWebs, ListMaterials,
05135                                        KeepNonlimitShapes);
05136             return anObj

Here is the call graph for this function:

Here is the caller graph for this function: