# Example: see GEOM_TestAll.py
def MakeTorus(thePnt, theVec, theRMajor, theRMinor):
anObj = PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
- RaiseIfFailed("MakeTourusPntVecRR", PrimOp)
+ RaiseIfFailed("MakeTorusPntVecRR", PrimOp)
return anObj
## Create a torus with given radiuses at the origin of coordinate system.
# Example: see GEOM_TestAll.py
def MakeTorusRR(theRMajor, theRMinor):
anObj = PrimOp.MakeTorusRR(theRMajor, theRMinor)
- RaiseIfFailed("MakeTourusRR", PrimOp)
+ RaiseIfFailed("MakeTorusRR", PrimOp)
return anObj
## Create a shape by extrusion of the base shape along a vector, defined by two points.
# Example: see GEOM_TestOthers.py
def MakeFaces(theWires, isPlanarWanted):
anObj = MakeFaceWires(theWires, isPlanarWanted)
- RaiseIfFailed("MakeFaceWires", ShapesOp)
return anObj
## Create a shell from the set of faces and shells.
# Example: see GEOM_TestOthers.py
def GetInPlaceByHistory(theShapeWhere, theShapeWhat):
anObj = ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
- RaiseIfFailed("GetInPlace", ShapesOp)
+ RaiseIfFailed("GetInPlaceByHistory", ShapesOp)
return anObj
## Get sub-shape of theShapeWhere, which is
# @return List of IDs of sub-shapes.
def SubShapeAllSortedIDs(aShape, aType):
ListIDs = ShapesOp.SubShapeAllIDs(aShape,aType,1)
- RaiseIfFailed("SubShapeAllSortedIDs", ShapesOp)
+ RaiseIfFailed("SubShapeAllIDs", ShapesOp)
return ListIDs
## Obtain a compound of sub-shapes of <aShape>,
# Example: see GEOM_TestHealing.py
def SuppressInternalWires(theObject, theWires):
anObj = HealOp.RemoveIntWires(theObject, theWires)
- RaiseIfFailed("SuppressInternalWires", HealOp)
+ RaiseIfFailed("SuppressIntWires", HealOp)
return anObj
## Remove internal closed contours (holes) from the given object.
# Example: see GEOM_TestHealing.py
def SuppressHoles(theObject, theWires):
anObj = HealOp.FillHoles(theObject, theWires)
- RaiseIfFailed("SuppressHoles", HealOp)
+ RaiseIfFailed("FillHoles", HealOp)
return anObj
## Close an open wire.
# @return New GEOM_Object, containing processed shape.
def ChangeOrientationShellCopy(theObject):
anObj = HealOp.ChangeOrientationCopy(theObject)
- RaiseIfFailed("ChangeOrientation", HealOp)
+ RaiseIfFailed("ChangeOrientationCopy", HealOp)
return anObj
## Get a list of wires (wrapped in GEOM_Object-s),
# Example: see GEOM_TestHealing.py
def GetFreeBoundary(theObject):
anObj = HealOp.GetFreeBoundary(theObject)
- RaiseIfFailed("GetFreeBoundaries", HealOp)
+ RaiseIfFailed("GetFreeBoundary", HealOp)
return anObj
# -----------------------------------------------------------------------------
# Example: see GEOM_TestAll.py
def MakeMultiTranslation1D(theObject, theVector, theStep, theNbTimes):
anObj = TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
- RaiseIfFailed("Multitranslate1D", TrsfOp)
+ RaiseIfFailed("MultiTranslate1D", TrsfOp)
return anObj
## Conseqently apply two specified translations to theObject specified number of times.
theVector2, theStep2, theNbTimes2):
anObj = TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
theVector2, theStep2, theNbTimes2)
- RaiseIfFailed("Multitranslate2D", TrsfOp)
+ RaiseIfFailed("MultiTranslate2D", TrsfOp)
return anObj
## Rotate the given object around the given axis a given number times.
anObj = None
if theShapeType == ShapeType["EDGE"]:
anObj = LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
+ RaiseIfFailed("MakeFilletEdges", LocalOp)
else:
anObj = LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
- RaiseIfFailed("MakeFillet", LocalOp)
+ RaiseIfFailed("MakeFilletFaces", LocalOp)
return anObj
## The same but with two Fillet Radius R1 and R2
anObj = None
if theShapeType == ShapeType["EDGE"]:
anObj = LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
+ RaiseIfFailed("MakeFilletEdgesR1R2", LocalOp)
else:
anObj = LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
- RaiseIfFailed("MakeFilletR1R2", LocalOp)
+ RaiseIfFailed("MakeFilletFacesR1R2", LocalOp)
return anObj
## Perform a symmetric chamfer on all edges of the given shape.
# Example: see GEOM_TestMeasures.py
def BasicProperties(theShape):
aTuple = MeasuOp.GetBasicProperties(theShape)
- RaiseIfFailed("BasicProperties", MeasuOp)
+ RaiseIfFailed("GetBasicProperties", MeasuOp)
return aTuple
## Get parameters of bounding box of the given shape
# Example: see GEOM_TestMeasures.py
def BoundingBox(theShape):
aTuple = MeasuOp.GetBoundingBox(theShape)
- RaiseIfFailed("BoundingBox", MeasuOp)
+ RaiseIfFailed("GetBoundingBox", MeasuOp)
return aTuple
## Get inertia matrix and moments of inertia of theShape.
# Example: see GEOM_TestMeasures.py
def Inertia(theShape):
aTuple = MeasuOp.GetInertia(theShape)
- RaiseIfFailed("Inertia", MeasuOp)
+ RaiseIfFailed("GetInertia", MeasuOp)
return aTuple
## Get minimal distance between the given shapes.
# Example: see GEOM_TestMeasures.py
def MinDistanceComponents(theShape1, theShape2):
aTuple = MeasuOp.GetMinDistance(theShape1, theShape2)
- RaiseIfFailed("MinDistanceComponents", MeasuOp)
+ RaiseIfFailed("GetMinDistance", MeasuOp)
aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
return aRes
# Example: see GEOM_TestMeasures.py
def Tolerance(theShape):
aTuple = MeasuOp.GetTolerance(theShape)
- RaiseIfFailed("Tolerance", MeasuOp)
+ RaiseIfFailed("GetTolerance", MeasuOp)
return aTuple
## Obtain description of the given shape (number of sub-shapes of each type)
def CheckShape(theShape, theIsCheckGeom = 0):
if theIsCheckGeom:
(IsValid, Status) = MeasuOp.CheckShapeWithGeometry(theShape)
+ RaiseIfFailed("CheckShapeWithGeometry", MeasuOp)
else:
(IsValid, Status) = MeasuOp.CheckShape(theShape)
-
- if MeasuOp.IsDone() == 0:
- raise RuntimeError, "CheckShape : " + MeasuOp.GetErrorCode()
- else:
- if IsValid == 0:
+ RaiseIfFailed("CheckShape", MeasuOp)
+ if IsValid == 0:
print Status
return IsValid
# Example: see GEOM_TestOthers.py
def Export(theObject, theFileName, theFormatName):
InsertOp.Export(theObject, theFileName, theFormatName)
- RaiseIfFailed("Export :", InsertOp)
+ RaiseIfFailed("Export", InsertOp)
## Shortcut to Export() for BREP format
#
# Example: see GEOM_TestOthers.py
def MakeBlockExplode(theCompound, theMinNbFaces, theMaxNbFaces):
aList = BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
- RaiseIfFailed("MakeBlockExplode", BlocksOp)
+ RaiseIfFailed("ExplodeCompoundOfBlocks", BlocksOp)
return aList
## Find block, containing the given point inside its volume or on boundary.
# Example: see GEOM_TestOthers.py
def GetObjectIDs(theGroup):
ListIDs = GroupOp.GetObjects(theGroup)
- RaiseIfFailed("GetObjectIDs", GroupOp)
+ RaiseIfFailed("GetObject", GroupOp)
return ListIDs
## Returns a type of sub objects stored in the group