OCC.Core.ShapeExtend module¶
ShapeExtend module, see official documentation at https://www.opencascade.com/doc/occt-7.4.0/refman/html/package_shapeextend.html
-
class
ShapeExtend_BasicMsgRegistrator
(*args)¶ Bases:
OCC.Core.Standard.Standard_Transient
- Empty constructor.
- rtype
None
-
static
DownCast
(t)¶
-
Send
()¶ - Sends a message to be attached to the object. Object can be of any type interpreted by redefined MsgRegistrator.
- param object
- type object
Standard_Transient
- param message
- type message
Message_Msg
- param gravity
- type gravity
Message_Gravity
- rtype
void* Sends a message to be attached to the shape.
- param shape
- type shape
TopoDS_Shape
- param message
- type message
Message_Msg
- param gravity
- type gravity
Message_Gravity
- rtype
void* Calls Send method with Null Transient.
- param message
- type message
Message_Msg
- param gravity
- type gravity
Message_Gravity
- rtype
void
-
property
thisown
¶ The membership flag
-
class
ShapeExtend_ComplexCurve
(*args, **kwargs)¶ Bases:
OCC.Core.Geom.Geom_Curve
Empty constructor
- Return type
None* Copy constructor – does nothing
- Parameters
& (Standard_Transient) –
- Return type
-
CheckConnectivity
()¶ - Checks geometrical connectivity of the curves, including closure (sets fields myClosed)
- param Preci
- type Preci
float
- rtype
bool
-
Curve
()¶ - Returns curve given by its index
- param index
- type index
int
- rtype
opencascade::handle<Geom_Curve>
-
static
DownCast
(t)¶
-
GetScaleFactor
()¶ - Returns scale factor for recomputing of deviatives.
- param ind
- type ind
int
- rtype
float
-
LocalToGlobal
()¶ - Returns global parameter for the whole curve according to the segment and local parameter on it
- param index
- type index
int
- param Ulocal
- type Ulocal
float
- rtype
float
-
LocateParameter
()¶ - Returns number of the curve for the given parameter U and local paramete r UOut for the found curve
- param U
- type U
float
- param UOut
- type UOut
float
- rtype
int
-
NbCurves
()¶ - Returns number of curves
- rtype
int
-
property
thisown
¶ The membership flag
-
class
ShapeExtend_CompositeSurface
(*args)¶ Bases:
OCC.Core.Geom.Geom_Surface
- Empty constructor.
- rtype
None* Initializes by a grid of surfaces (calls Init()).
- param GridSurf
- type GridSurf
TColGeom_HArray2OfSurface
- param param
default value is ShapeExtend_Natural
- type param
ShapeExtend_Parametrisation
- rtype
None* Initializes by a grid of surfaces (calls Init()).
- param GridSurf
- type GridSurf
TColGeom_HArray2OfSurface
- param UJoints
- type UJoints
TColStd_Array1OfReal
- param VJoints
- type VJoints
TColStd_Array1OfReal
- rtype
None
-
CheckConnectivity
()¶ - Checks geometrical connectivity of the patches, including closedness (sets fields muUClosed and myVClosed)
- param prec
- type prec
float
- rtype
bool
-
ComputeJointValues
()¶ - Computes Joint values according to parameter
- param param
default value is ShapeExtend_Natural
- type param
ShapeExtend_Parametrisation
- rtype
None
-
static
DownCast
(t)¶
-
GlobalToLocal
()¶ - Converts global parameters UV to local parameters uv on patch i,j
- param i
- type i
int
- param j
- type j
int
- param UV
- type UV
gp_Pnt2d
- rtype
gp_Pnt2d
-
GlobalToLocalTransformation
()¶ - Computes transformation operator and uFactor descrinbing affine transformation required to convert global parameters on composite surface to local parameters on patch (i,j): uv = ( uFactor, 1. ) X Trsf * UV; NOTE: Thus Trsf contains shift and scale by V, scale by U is stored in uFact. Returns True if transformation is not an identity
- param i
- type i
int
- param j
- type j
int
- param uFact
- type uFact
float
- param Trsf
- type Trsf
gp_Trsf2d
- rtype
bool
-
Init
()¶ - Initializes by a grid of surfaces. All the Surfaces of the grid must have geometrical connectivity as stated above. If geometrical connectivity is not satisfied, method returns False. However, class is initialized even in that case. //! Last parameter defines how global parametrisation (joint values) will be computed: ShapeExtend_Natural: U1 = u11min, Ui+1 = Ui + (ui1max-ui1min), etc. ShapeExtend_Uniform: Ui = i-1, Vj = j-1 ShapeExtend_Unitary: Ui = (i-1)/Nu, Vi = (j-1)/Nv
- param GridSurf
- type GridSurf
TColGeom_HArray2OfSurface
- param param
default value is ShapeExtend_Natural
- type param
ShapeExtend_Parametrisation
- rtype
bool* Initializes by a grid of surfaces with given global parametrisation defined by UJoints and VJoints arrays, each having langth equal to number of patches in corresponding direction + 1. Global joint values should be sorted in increasing order. All the Surfaces of the grid must have geometrical connectivity as stated above. If geometrical connectivity is not satisfied, method returns False. However, class is initialized even in that case.
- param GridSurf
- type GridSurf
TColGeom_HArray2OfSurface
- param UJoints
- type UJoints
TColStd_Array1OfReal
- param VJoints
- type VJoints
TColStd_Array1OfReal
- rtype
bool
-
LocalToGlobal
()¶ - Converts local parameters uv on patch i,j to global parameters UV
- param i
- type i
int
- param j
- type j
int
- param uv
- type uv
gp_Pnt2d
- rtype
gp_Pnt2d
-
LocateUParameter
()¶ - Returns number of col that contains given (global) parameter
- param U
- type U
float
- rtype
int
-
LocateUVPoint
()¶ - Returns number of row and col of surface that contains given point
- param pnt
- type pnt
gp_Pnt2d
- param i
- type i
int
- param j
- type j
int
- rtype
None
-
LocateVParameter
()¶ - Returns number of row that contains given (global) parameter
- param V
- type V
float
- rtype
int
-
NbUPatches
()¶ - Returns number of patches in U direction.
- rtype
int
-
NbVPatches
()¶ - Returns number of patches in V direction.
- rtype
int
-
Patch
()¶ - Returns one surface patch
- param i
- type i
int
- param j
- type j
int
- rtype
opencascade::handle<Geom_Surface>* Returns one surface patch that contains given (global) parameters
- param U
- type U
float
- param V
- type V
float
- rtype
opencascade::handle<Geom_Surface>* Returns one surface patch that contains given point
- param pnt
- type pnt
gp_Pnt2d
- rtype
opencascade::handle<Geom_Surface>
-
Patches
()¶ - Returns grid of surfaces
- rtype
opencascade::handle<TColGeom_HArray2OfSurface>
-
SetUFirstValue
()¶ - Changes starting value for global U parametrisation (all other joint values are shifted accordingly)
- param UFirst
- type UFirst
float
- rtype
None
-
SetUJointValues
()¶ - Sets the array of U values corresponding to joint points, which define global parametrisation of the surface. Number of values in array should be equal to NbUPatches()+1. All the values should be sorted in increasing order. If this is not satisfied, does nothing and returns False.
- param UJoints
- type UJoints
TColStd_Array1OfReal
- rtype
bool
-
SetVFirstValue
()¶ - Changes starting value for global V parametrisation (all other joint values are shifted accordingly)
- param VFirst
- type VFirst
float
- rtype
None
-
SetVJointValues
()¶ - Sets the array of V values corresponding to joint points, which define global parametrisation of the surface Number of values in array should be equal to NbVPatches()+1. All the values should be sorted in increasing order. If this is not satisfied, does nothing and returns False.
- param VJoints
- type VJoints
TColStd_Array1OfReal
- rtype
bool
-
UGlobalToLocal
()¶ - Converts global parameter U to local parameter u on patch i,j
- param i
- type i
int
- param j
- type j
int
- param U
- type U
float
- rtype
float
-
UJointValue
()¶ - Returns i-th joint value in U direction (1-st is global Umin, (NbUPatches()+1)-th is global Umax on the composite surface)
- param i
- type i
int
- rtype
float
-
UJointValues
()¶ - Returns the array of U values corresponding to joint points between patches as well as to start and end points, which define global parametrisation of the surface
- rtype
opencascade::handle<TColStd_HArray1OfReal>
-
ULocalToGlobal
()¶ - Converts local parameter u on patch i,j to global parameter U
- param i
- type i
int
- param j
- type j
int
- param u
- type u
float
- rtype
float
-
VGlobalToLocal
()¶ - Converts global parameter V to local parameter v on patch i,j
- param i
- type i
int
- param j
- type j
int
- param V
- type V
float
- rtype
float
-
VJointValue
()¶ - Returns j-th joint value in V direction (1-st is global Vmin, (NbVPatches()+1)-th is global Vmax on the composite surface)
- param j
- type j
int
- rtype
float
-
VJointValues
()¶ - Returns the array of V values corresponding to joint points between patches as well as to start and end points, which define global parametrisation of the surface
- rtype
opencascade::handle<TColStd_HArray1OfReal>
-
VLocalToGlobal
()¶ - Converts local parameter v on patch i,j to global parameter V
- param i
- type i
int
- param j
- type j
int
- param v
- type v
float
- rtype
float
-
Value
()¶ - Computes the point of parameter pnt on the grid.
- param pnt
- type pnt
gp_Pnt2d
- rtype
gp_Pnt
-
property
thisown
¶ The membership flag
-
class
ShapeExtend_DataMapOfShapeListOfMsg
(*args)¶ Bases:
object
-
Assign
()¶
-
Bind
()¶
-
Bound
()¶
-
ChangeFind
()¶
-
ChangeSeek
()¶
-
Clear
()¶
-
Exchange
()¶
-
Find
()¶
-
IsBound
()¶
-
ReSize
()¶
-
Seek
()¶
-
Set
()¶
-
Size
()¶
-
UnBind
()¶
-
begin
()¶
-
cbegin
()¶
-
cend
()¶
-
end
()¶
-
property
thisown
¶ The membership flag
-
-
class
ShapeExtend_DataMapOfTransientListOfMsg
(*args)¶ Bases:
object
-
Assign
()¶
-
Bind
()¶
-
Bound
()¶
-
ChangeFind
()¶
-
ChangeSeek
()¶
-
Clear
()¶
-
Exchange
()¶
-
Find
()¶
-
IsBound
()¶
-
ReSize
()¶
-
Seek
()¶
-
Set
()¶
-
Size
()¶
-
UnBind
()¶
-
begin
()¶
-
cbegin
()¶
-
cend
()¶
-
end
()¶
-
property
thisown
¶ The membership flag
-
-
class
ShapeExtend_Explorer
(*args)¶ Bases:
object
- Creates an object Explorer
- rtype
None
-
CompoundFromSeq
()¶ - Converts a sequence of Shapes to a Compound
- param seqval
- type seqval
TopTools_HSequenceOfShape
- rtype
TopoDS_Shape
-
DispatchList
()¶ - Dispatches starting list of shapes according to their type, to the appropriate resulting lists For each of these lists, if it is null, it is firstly created else, new items are appended to the already existing ones
- param list
- type list
TopTools_HSequenceOfShape
- param vertices
- type vertices
TopTools_HSequenceOfShape
- param edges
- type edges
TopTools_HSequenceOfShape
- param wires
- type wires
TopTools_HSequenceOfShape
- param faces
- type faces
TopTools_HSequenceOfShape
- param shells
- type shells
TopTools_HSequenceOfShape
- param solids
- type solids
TopTools_HSequenceOfShape
- param compsols
- type compsols
TopTools_HSequenceOfShape
- param compounds
- type compounds
TopTools_HSequenceOfShape
- rtype
None
-
ListFromSeq
()¶ - Converts a Sequence of Shapes to a List of Shapes <clear> if True (D), commands the list to start from scratch else, the list is cumulated
- param seqval
- type seqval
TopTools_HSequenceOfShape
- param lisval
- type lisval
TopTools_ListOfShape
- param clear
default value is Standard_True
- type clear
bool
- rtype
None
-
SeqFromCompound
()¶ - Converts a Compound to a list of Shapes if <comp> is not a compound, the list contains only <comp> if <comp> is Null, the list is empty if <comp> is a Compound, its sub-shapes are put into the list then if <expcomp> is True, if a sub-shape is a Compound, it is not put to the list but its sub-shapes are (recursive)
- param comp
- type comp
TopoDS_Shape
- param expcomp
- type expcomp
bool
- rtype
opencascade::handle<TopTools_HSequenceOfShape>
-
SeqFromList
()¶ - Converts a List of Shapes to a Sequence of Shapes
- param lisval
- type lisval
TopTools_ListOfShape
- rtype
opencascade::handle<TopTools_HSequenceOfShape>
-
ShapeType
()¶ - Returns the type of a Shape: true type if <compound> is False If <compound> is True and <shape> is a Compound, iterates on its items. If all are of the same type, returns this type. Else, returns COMPOUND. If it is empty, returns SHAPE For a Null Shape, returns SHAPE
- param shape
- type shape
TopoDS_Shape
- param compound
- type compound
bool
- rtype
TopAbs_ShapeEnum
-
SortedCompound
()¶ - Builds a COMPOUND from the given shape. It explores the shape level by level, according to the <explore> argument. If <explore> is False, only COMPOUND items are explored, else all items are. The following shapes are added to resulting compound: - shapes which comply to <type> - if <type> is WIRE, considers also free edges (and makes wires) - if <type> is SHELL, considers also free faces (and makes shells) If <compound> is True, gathers items in compounds which correspond to starting COMPOUND,SOLID or SHELL containers, or items directly contained in a Compound
- param shape
- type shape
TopoDS_Shape
- param type
- type type
TopAbs_ShapeEnum
- param explore
- type explore
bool
- param compound
- type compound
bool
- rtype
TopoDS_Shape
-
property
thisown
¶ The membership flag
-
class
ShapeExtend_MsgRegistrator
(*args)¶ Bases:
OCC.Core.ShapeExtend.ShapeExtend_BasicMsgRegistrator
- Creates an object.
- rtype
None
-
static
DownCast
(t)¶
-
MapShape
()¶ - Returns a Map of shapes and message list
- rtype
ShapeExtend_DataMapOfShapeListOfMsg
-
MapTransient
()¶ - Returns a Map of objects and message list
- rtype
ShapeExtend_DataMapOfTransientListOfMsg
-
Send
()¶ - Sends a message to be attached to the object. If the object is in the map then the message is added to the list, otherwise the object is firstly added to the map.
- param object
- type object
Standard_Transient
- param message
- type message
Message_Msg
- param gravity
- type gravity
Message_Gravity
- rtype
void* Sends a message to be attached to the shape. If the shape is in the map then the message is added to the list, otherwise the shape is firstly added to the map.
- param shape
- type shape
TopoDS_Shape
- param message
- type message
Message_Msg
- param gravity
- type gravity
Message_Gravity
- rtype
void
-
property
thisown
¶ The membership flag
-
class
ShapeExtend_WireData
(*args)¶ Bases:
OCC.Core.Standard.Standard_Transient
- Empty constructor, creates empty wire with no edges
- rtype
None* Constructor initializing the data from TopoDS_Wire. Calls Init(wire,chained).
- param wire
- type wire
TopoDS_Wire
- param chained
default value is Standard_True
- type chained
bool
- param theManifoldMode
default value is Standard_True
- type theManifoldMode
bool
- rtype
None
-
Add
()¶ - Adds an edge to a wire, being defined (not yet ended) This is the plain, basic, function to add an edge <num> = 0 (D): Appends at end <num> = 1: Preprends at start else, Insert before <num> RemarkNull Edge is simply ignored
- param edge
- type edge
TopoDS_Edge
- param atnum
default value is 0
- type atnum
int
- rtype
None* Adds an entire wire, considered as a list of edges Remark : The wire is assumed to be ordered (TopoDS_Iterator is used)
- param wire
- type wire
TopoDS_Wire
- param atnum
default value is 0
- type atnum
int
- rtype
None* Adds a wire in the form of WireData
- param wire
- type wire
ShapeExtend_WireData
- param atnum
default value is 0
- type atnum
int
- rtype
None* Adds an edge or a wire invoking corresponding method Add
- param shape
- type shape
TopoDS_Shape
- param atnum
default value is 0
- type atnum
int
- rtype
None
-
AddOriented
()¶ - Adds an edge to start or end of <self>, according to <mode> 0: at end, as direct 1: at end, as reversed 2: at start, as direct 3: at start, as reversed < 0: no adding
- param edge
- type edge
TopoDS_Edge
- param mode
- type mode
int
- rtype
None* Adds a wire to start or end of <self>, according to <mode> 0: at end, as direct 1: at end, as reversed 2: at start, as direct 3: at start, as reversed < 0: no adding
- param wire
- type wire
TopoDS_Wire
- param mode
- type mode
int
- rtype
None* Adds an edge or a wire invoking corresponding method AddOriented
- param shape
- type shape
TopoDS_Shape
- param mode
- type mode
int
- rtype
None
-
Clear
()¶ - Clears data about Wire.
- rtype
None
-
ComputeSeams
()¶ - Computes the list of seam edges By default (direct call), computing is enforced For indirect call (from IsSeam) it is redone only if not yet already done or if the list of edges has changed RemarkA Seam Edge is an Edge present twice in the list, once as FORWARD and once as REVERSED Each sense has its own PCurve, the one for FORWARD must be set in first
- param enforce
default value is Standard_True
- type enforce
bool
- rtype
None
-
static
DownCast
(t)¶
-
Edge
()¶ - Returns <num>th Edge
- param num
- type num
int
- rtype
TopoDS_Edge
-
GetManifoldMode
(ShapeExtend_WireData self) → Standard_Boolean¶
-
Index
()¶ - Returns the index of the edge If the edge is a seam the orientation is also checked Returns 0 if the edge is not found in the list
- param edge
- type edge
TopoDS_Edge
- rtype
int
-
Init
()¶ - Copies data from another WireData
- param other
- type other
ShapeExtend_WireData
- rtype
None* Loads an already existing wire If <chained> is True (default), edges are added in the sequence as they are explored by TopoDS_Iterator Else, if <chained> is False, wire is explored by BRepTools_WireExplorer and it is guaranteed that edges will be sequencially connected. Remark : In the latter case it can happen that not all edges will be found (because of limitations of BRepTools_WireExplorer for disconnected wires and wires with seam edges).
- param wire
- type wire
TopoDS_Wire
- param chained
default value is Standard_True
- type chained
bool
- param theManifoldMode
default value is Standard_True
- type theManifoldMode
bool
- rtype
bool
-
IsSeam
()¶ - Tells if an Edge is seam (see ComputeSeams) An edge is considered as seam if it presents twice in the edge list, once as FORWARD and once as REVERSED.
- param num
- type num
int
- rtype
bool
-
NbEdges
()¶ - Returns the count of currently recorded edges
- rtype
int
-
NbNonManifoldEdges
()¶ - Returns the count of currently recorded non-manifold edges
- rtype
int
-
NonmanifoldEdge
()¶ - Returns <num>th nonmanifold Edge
- param num
- type num
int
- rtype
TopoDS_Edge
-
NonmanifoldEdges
()¶ - Returns sequence of non-manifold edges This sequence can be not empty if wire data set in manifold mode but initial wire has INTERNAL orientation or contains INTERNAL edges
- rtype
opencascade::handle<TopTools_HSequenceOfShape>
-
Remove
()¶ - Removes an Edge, given its rank. By default removes the last edge.
- param num
default value is 0
- type num
int
- rtype
None
-
Reverse
()¶ - Reverses the sense of the list and the orientation of each Edge This method should be called when either wire has no seam edges or face is not available
- rtype
None* Reverses the sense of the list and the orientation of each Edge The face is necessary for swapping pcurves for seam edges (first pcurve corresponds to orientation FORWARD, and second to REVERSED; when edge is reversed, pcurves must be swapped) If face is NULL, no swapping is performed
- param face
- type face
TopoDS_Face
- rtype
None
-
Set
()¶ - Replaces an edge at the given rank number <num> with new one. Default is last edge (<num> = 0).
- param edge
- type edge
TopoDS_Edge
- param num
default value is 0
- type num
int
- rtype
None
-
SetDegeneratedLast
()¶ - When the wire contains at least one degenerated edge, sets it as last one NoteIt is useful to process pcurves, for instance, while the pcurve of a DGNR may not be computed from its 3D part (there is none) it is computed after the other edges have been computed and chained.
- rtype
None
-
SetLast
()¶ - Does a circular permutation in order to set <num>th edge last
- param num
- type num
int
- rtype
None
-
SetManifoldMode
(ShapeExtend_WireData self, Standard_Boolean value)¶
-
Wire
()¶ - Makes TopoDS_Wire using BRep_Builder (just creates the TopoDS_Wire object and adds all edges into it). This method should be called when the wire is correct (for example, after successful fixes by ShapeFix_Wire) and adjacent edges share common vertices. In case if adjacent edges do not share the same vertices the resulting TopoDS_Wire will be invalid.
- rtype
TopoDS_Wire
-
WireAPIMake
()¶ - Makes TopoDS_Wire using BRepAPI_MakeWire. Class BRepAPI_MakeWire merges geometrically coincided vertices and can disturb correct order of edges in the wire. If this class fails, null shape is returned.
- rtype
TopoDS_Wire
-
property
thisown
¶ The membership flag
-
class
SwigPyIterator
(*args, **kwargs)¶ Bases:
object
-
advance
()¶
-
copy
()¶
-
decr
()¶
-
distance
()¶
-
equal
()¶
-
incr
()¶
-
next
()¶
-
previous
()¶
-
property
thisown
¶ The membership flag
-
value
()¶
-
-
class
shapeextend
¶ Bases:
object
-
static
DecodeStatus
()¶ - Tells if a bit flag contains bit corresponding to enumerated status
- param flag
- type flag
int
- param status
- type status
ShapeExtend_Status
- rtype
bool
-
static
EncodeStatus
()¶ - Encodes status (enumeration) to a bit flag
- param status
- type status
ShapeExtend_Status
- rtype
int
-
static
Init
()¶ - Inits using of ShapeExtend. Currently, loads messages output by ShapeHealing algorithms.
- rtype
void
-
property
thisown
¶ The membership flag
-
static