mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-29 01:30:47 +05:00
Fix for bug IPAL12474: "geompy.py" is not importable.
This commit is contained in:
parent
3d72ae1930
commit
6feb4ebf3e
@ -184,15 +184,11 @@ def MakeVertexOnCurve(theRefCurve, theParameter):
|
|||||||
print "MakePointOnCurve : ", BasicOp.GetErrorCode()
|
print "MakePointOnCurve : ", BasicOp.GetErrorCode()
|
||||||
return anObj
|
return anObj
|
||||||
|
|
||||||
|
## Create a tangent, corresponding to the given parameter on the given curve.
|
||||||
|
# @param theRefCurve The referenced curve.
|
||||||
|
# @param theParameter Value of parameter on the referenced curve.
|
||||||
|
# @return New GEOM_Object, containing the created tangent.
|
||||||
def MakeTangentOnCurve(theRefCurve, theParameter):
|
def MakeTangentOnCurve(theRefCurve, theParameter):
|
||||||
"""
|
|
||||||
* Create a tangent, corresponding to the given parameter on the given curve.
|
|
||||||
* \param theRefCurve The referenced curve.
|
|
||||||
* \param theParameter Value of parameter on the referenced curve.
|
|
||||||
* \return New GEOM_Object, containing the created tangent.
|
|
||||||
|
|
||||||
*
|
|
||||||
"""
|
|
||||||
anObj = BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
|
anObj = BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
|
||||||
if BasicOp.IsDone() == 0:
|
if BasicOp.IsDone() == 0:
|
||||||
print "MakeTangentOnCurve : ", BasicOp.GetErrorCode()
|
print "MakeTangentOnCurve : ", BasicOp.GetErrorCode()
|
||||||
@ -682,40 +678,36 @@ def MakeRevolution(theBase, theAxis, theAngle):
|
|||||||
print "MakeRevolutionAxisAngle : ", PrimOp.GetErrorCode()
|
print "MakeRevolutionAxisAngle : ", PrimOp.GetErrorCode()
|
||||||
return anObj
|
return anObj
|
||||||
|
|
||||||
|
## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
|
||||||
|
# @param theSeqSections - set of specified sections.
|
||||||
|
# @param theModeSolid - mode defining building solid or shell
|
||||||
|
# @param thePreci - precision 3D used for smoothing by default 1.e-6
|
||||||
|
# @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
|
||||||
|
# @return New GEOM_Object, containing the created shell or solid.
|
||||||
|
#
|
||||||
|
# Example: see GEOM_TestAll.py
|
||||||
def MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled):
|
def MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled):
|
||||||
"""
|
|
||||||
* Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
|
|
||||||
* \param theSeqSections - set of specified sections.
|
|
||||||
* \param theModeSolid - mode defining building solid or shell
|
|
||||||
* \param thePreci - precision 3D used for smoothing by default 1.e-6
|
|
||||||
* \param theRuled - mode defining type of the result surfaces (ruled or smoothed).
|
|
||||||
* \return New GEOM_Object, containing the created shell or solid.
|
|
||||||
|
|
||||||
* Example: see GEOM_TestAll.py
|
|
||||||
"""
|
|
||||||
anObj = PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
|
anObj = PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
|
||||||
if PrimOp.IsDone() == 0:
|
if PrimOp.IsDone() == 0:
|
||||||
print "MakeThruSections : ", PrimOp.GetErrorCode()
|
print "MakeThruSections : ", PrimOp.GetErrorCode()
|
||||||
return anObj
|
return anObj
|
||||||
|
|
||||||
|
## Create a shape by extrusion of the profile shape along
|
||||||
|
# the path shape. The path shape can be a wire or an edge.
|
||||||
|
# the several profiles can be specified in the several locations of path.
|
||||||
|
# @param theSeqBases - list of Bases shape to be extruded.
|
||||||
|
# @param theLocations - list of locations on the path corresponding
|
||||||
|
# specified list of the Bases shapes. Number of locations
|
||||||
|
# should be equal to number of bases or list of locations can be empty.
|
||||||
|
# @param thePath - Path shape to extrude the base shape along it.
|
||||||
|
# @param theWithContact - the mode defining that the section is translated to be in
|
||||||
|
# contact with the spine.
|
||||||
|
# @param - WithCorrection - defining that the section is rotated to be
|
||||||
|
# orthogonal to the spine tangent in the correspondent point
|
||||||
|
# @return New GEOM_Object, containing the created pipe.
|
||||||
|
#
|
||||||
|
# Example: see GEOM_TestAll.py
|
||||||
def MakePipeWithDifferentSections(theSeqBases, theLocations,thePath,theWithContact,theWithCorrection):
|
def MakePipeWithDifferentSections(theSeqBases, theLocations,thePath,theWithContact,theWithCorrection):
|
||||||
"""
|
|
||||||
* Create a shape by extrusion of the profile shape along
|
|
||||||
* the path shape. The path shape can be a wire or an edge.
|
|
||||||
* the several profiles can be specified in the several locations of path.
|
|
||||||
* \param theSeqBases - list of Bases shape to be extruded.
|
|
||||||
* \param theLocations - list of locations on the path corresponding
|
|
||||||
* specified list of the Bases shapes. Number of locations
|
|
||||||
* should be equal to number of bases or list of locations can be empty.
|
|
||||||
* \param thePath - Path shape to extrude the base shape along it.
|
|
||||||
* \param theWithContact - the mode defining that the section is translated to be in
|
|
||||||
* contact with the spine.
|
|
||||||
* \param - WithCorrection - defining that the section is rotated to be
|
|
||||||
* orthogonal to the spine tangent in the correspondent point
|
|
||||||
* \return New GEOM_Object, containing the created pipe.
|
|
||||||
|
|
||||||
* Example: see GEOM_TestAll.py
|
|
||||||
"""
|
|
||||||
anObj = PrimOp.MakePipeWithDifferentSections(theSeqBases, theLocations,thePath,theWithContact,theWithCorrection)
|
anObj = PrimOp.MakePipeWithDifferentSections(theSeqBases, theLocations,thePath,theWithContact,theWithCorrection)
|
||||||
if PrimOp.IsDone() == 0:
|
if PrimOp.IsDone() == 0:
|
||||||
print "MakePipeWithDifferentSections : ", PrimOp.GetErrorCode()
|
print "MakePipeWithDifferentSections : ", PrimOp.GetErrorCode()
|
||||||
@ -2275,12 +2267,9 @@ def GetMainShape(theGroup):
|
|||||||
print "GetMainShape : ", GroupOp.GetErrorCode()
|
print "GetMainShape : ", GroupOp.GetErrorCode()
|
||||||
return anObj
|
return anObj
|
||||||
|
|
||||||
|
## 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.
|
||||||
def GetEdgesByLength (theShape, min_length, max_length, include_min = 1, include_max = 1):
|
def GetEdgesByLength (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.
|
|
||||||
|
|
||||||
|
|
||||||
edges = SubShapeAll(theShape, ShapeType["EDGE"])
|
edges = SubShapeAll(theShape, ShapeType["EDGE"])
|
||||||
edges_in_range = []
|
edges_in_range = []
|
||||||
for edge in edges:
|
for edge in edges:
|
||||||
@ -2303,12 +2292,9 @@ def GetEdgesByLength (theShape, min_length, max_length, include_min = 1, include
|
|||||||
|
|
||||||
return group_edges
|
return group_edges
|
||||||
|
|
||||||
|
## 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.
|
||||||
def SelectEdges (min_length, max_length, include_min = 1, include_max = 1):
|
def SelectEdges (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.
|
|
||||||
|
|
||||||
|
|
||||||
nb_selected = sg.SelectedCount()
|
nb_selected = sg.SelectedCount()
|
||||||
if nb_selected < 1:
|
if nb_selected < 1:
|
||||||
print "Select a shape before calling this function, please."
|
print "Select a shape before calling this function, please."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user