Version: 6.5.0
Home
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions
Working with groups
Creating geometrical objects

Functions

def geompy.CreateGroup
 Creates a new group which will store sub-shapes of theMainShape.
def geompy.AddObject
 Adds a sub-object with ID theSubShapeId to the group.
def geompy.RemoveObject
 Removes a sub-object with ID theSubShapeId from the group.
def geompy.UnionList
 Adds to the group all the given shapes.
def geompy.UnionIDs
 Adds to the group all the given shapes.
def geompy.DifferenceList
 Removes from the group all the given shapes.
def geompy.DifferenceIDs
 Removes from the group all the given shapes.
def geompy.GetObjectIDs
 Returns a list of sub-objects ID stored in the group.
def geompy.GetType
 Returns a type of sub-objects stored in the group.
def geompy.ShapeIdToType
 Convert a type of geom object from id to string value.
def geompy.GetMainShape
 Returns a main shape associated with the group.
def geompy.GetEdgesByLength
 Create group of edges of theShape, whose length is in range [min_length, max_length].
def geompy.SelectEdges
 Create group of edges of selected shape, whose length is in range [min_length, max_length].

Detailed Description

Function Documentation

def geompy.CreateGroup (   self,
  theMainShape,
  theShapeType 
)

Creates a new group which will store sub-shapes of theMainShape.

Parameters
theMainShapeis a GEOM object on which the group is selected
theShapeTypedefines a shape type of the group (see GEOM::shape_type)
Returns
a newly created GEOM group

Example 1
Example 2

References geompy.RaiseIfFailed().

def geompy.AddObject (   self,
  theGroup,
  theSubShapeID 
)

Adds a sub-object with ID theSubShapeId to the group.

Parameters
theGroupis a GEOM group to which the new sub-shape is added
theSubShapeIDis a sub-shape ID in the main object.
Note
Use method GetSubShapeID() to get an unique ID of the sub-shape

Example

References geompy.RaiseIfFailed().

def geompy.RemoveObject (   self,
  theGroup,
  theSubShapeID 
)

Removes a sub-object with ID theSubShapeId from the group.

Parameters
theGroupis a GEOM group from which the new sub-shape is removed
theSubShapeIDis a sub-shape ID in the main object.
Note
Use method GetSubShapeID() to get an unique ID of the sub-shape

Example

References geompy.RaiseIfFailed().

def geompy.UnionList (   self,
  theGroup,
  theSubShapes 
)

Adds to the group all the given shapes.

No errors, if some shapes are alredy included.

Parameters
theGroupis a GEOM group to which the new sub-shapes are added.
theSubShapesis a list of sub-shapes to be added.

Example

References geompy.RaiseIfFailed().

def geompy.UnionIDs (   self,
  theGroup,
  theSubShapes 
)

Adds to the group all the given shapes.

No errors, if some shapes are alredy included.

Parameters
theGroupis a GEOM group to which the new sub-shapes are added.
theSubShapesis a list of indices of sub-shapes to be added.

Example

References geompy.RaiseIfFailed().

def geompy.DifferenceList (   self,
  theGroup,
  theSubShapes 
)

Removes from the group all the given shapes.

No errors, if some shapes are not included.

Parameters
theGroupis a GEOM group from which the sub-shapes are removed.
theSubShapesis a list of sub-shapes to be removed.

Example

References geompy.RaiseIfFailed().

def geompy.DifferenceIDs (   self,
  theGroup,
  theSubShapes 
)

Removes from the group all the given shapes.

No errors, if some shapes are not included.

Parameters
theGroupis a GEOM group from which the sub-shapes are removed.
theSubShapesis a list of indices of sub-shapes to be removed.

Example

References geompy.RaiseIfFailed().

def geompy.GetObjectIDs (   self,
  theGroup 
)

Returns a list of sub-objects ID stored in the group.

Parameters
theGroupis a GEOM group for which a list of IDs is requested

Example

References geompy.RaiseIfFailed().

def geompy.GetType (   self,
  theGroup 
)

Returns a type of sub-objects stored in the group.

Parameters
theGroupis a GEOM group which type is returned.

Example

References geompy.RaiseIfFailed().

def geompy.ShapeIdToType (   self,
  theId 
)

Convert a type of geom object from id to string value.

Parameters
theIdis a GEOM obect type id.
Returns
type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... ) Example
def geompy.GetMainShape (   self,
  theGroup 
)

Returns a main shape associated with the group.

Parameters
theGroupis a GEOM group for which a main shape object is requested
Returns
a GEOM object which is a main shape for theGroup

Example

References geompy.RaiseIfFailed().

def geompy.GetEdgesByLength (   self,
  theShape,
  min_length,
  max_length,
  include_min = 1,
  include_max = 1 
)

Create group of edges of theShape, whose length is in range [min_length, max_length].

If include_min/max == 0, edges with length == min/max_length will not be included in result.

Parameters
theShapegiven shape (see GEOM.GEOM_Object)
min_lengthminimum length of edges of theShape
max_lengthmaximum length of edges of theShape
include_maxindicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
include_minindicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
Returns
a newly created GEOM group of edges @ref swig_todo "Example"
def geompy.SelectEdges (   self,
  min_length,
  max_length,
  include_min = 1,
  include_max = 1 
)

Create group of edges of selected shape, whose length is in range [min_length, max_length].

If include_min/max == 0, edges with length == min/max_length will not be included in result.

Parameters
min_lengthminimum length of edges of selected shape
max_lengthmaximum length of edges of selected shape
include_maxindicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
include_minindicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
Returns
a newly created GEOM group of edges Example
Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS