Version: 9.12.0
Home

Functions

def MakePartition (self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[], Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[], KeepNonlimitShapes=0, theName=None)
 Perform partition operation. More...
 
def MakePartitionNonSelfIntersectedShape (self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[], Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[], KeepNonlimitShapes=0, checkSelfInte=False, theName=None)
 Perform partition operation. More...
 
def Partition (self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[], Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[], KeepNonlimitShapes=0, theName=None)
 See method MakePartition() for more information. More...
 
def MakeHalfPartition (self, theShape, thePlane, theName=None)
 Perform partition of the Shape with the Plane. More...
 
def Archimede (self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None)
 Perform an Archimde operation on the given shape with given parameters. More...
 

Detailed Description

Function Documentation

◆ MakePartition()

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

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).
theNameObject 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.
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 sense, only if theRemoveWebs is TRUE.
Returns
New GEOM.GEOM_Object, containing the result shapes.

Example

References geomBuilder._autoPublish(), geomBuilder.BoolOp, geomBuilder.EnumToLong(), geomBuilder.RaiseIfFailed(), and geomBuilder.ShapeType.

◆ MakePartitionNonSelfIntersectedShape()

def MakePartitionNonSelfIntersectedShape (   self,
  ListShapes,
  ListTools = [],
  ListKeepInside = [],
  ListRemoveInside = [],
  Limit = ShapeType["AUTO"],
  RemoveWebs = 0,
  ListMaterials = [],
  KeepNonlimitShapes = 0,
  checkSelfInte = False,
  theName = None 
)

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(). One additional parameter is provided:

Parameters
checkSelfInteThe flag that tells if the arguments should be checked for self-intersection prior to the operation.
Note
This algorithm doesn't find all types of self-intersections. It is tuned to detect vertex/vertex, vertex/edge, edge/edge, vertex/face and edge/face intersections. Face/face intersections detection is switched off as it is a time-consuming operation that gives an impact on performance. To find all self-intersections please use CheckSelfIntersections() method.
Passed compounds (via ListShapes or via ListTools) have to consist of nonintersecting shapes.
Returns
New GEOM.GEOM_Object, containing the result shapes.

Example

References geomBuilder._autoPublish(), geomBuilder.BoolOp, geomBuilder.EnumToLong(), geomBuilder.RaiseIfFailed(), and geomBuilder.ShapeType.

◆ Partition()

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

◆ MakeHalfPartition()

def MakeHalfPartition (   self,
  theShape,
  thePlane,
  theName = None 
)

Perform partition of the Shape with the Plane.

Parameters
theShapeShape to be intersected.
thePlaneTool shape, to intersect theShape.
theNameObject 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 result shape.
Note
This operation is a shortcut to the more general MakePartition operation, where theShape specifies single "object" (shape being partitioned) and thePlane specifies single "tool" (intersector shape). Other parameters of MakePartition operation have default values:
  • Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
  • KeepNonlimitShapes: 0
  • KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
I.e. the following two operations are equivalent:
Result = geompy.MakeHalfPartition(Object, Plane)
Result = geompy.MakePartition([Object], [Plane])
See also
MakePartition, MakePartitionNonSelfIntersectedShape

Example

References geomBuilder._autoPublish(), geomBuilder.BoolOp, and geomBuilder.RaiseIfFailed().

◆ Archimede()

def Archimede (   self,
  theShape,
  theWeight,
  theWaterDensity,
  theMeshDeflection,
  theName = None 
)

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 of the shape.
theWaterDensityDensity of the water.
theMeshDeflectionDeflection of the mesh, using to compute the section.
theNameObject 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 a section of theShape by a plane, corresponding to water level.

Example

References geomBuilder._autoPublish(), geomBuilder.LocalOp, geomBuilder.ParseParameters(), and geomBuilder.RaiseIfFailed().