OCC.Core.ShapeBuild module¶
ShapeBuild module, see official documentation at https://www.opencascade.com/doc/occt-7.4.0/refman/html/package_shapebuild.html
-
class
ShapeBuild_Edge
¶ Bases:
object
-
BuildCurve3d
()¶ - Calls BRepTools::BuildCurve3D
- param edge
- type edge
TopoDS_Edge
- rtype
bool
-
Copy
()¶ - Make a copy of <edge> by call to CopyReplaceVertices() (i.e. construct new TEdge with the same pcurves and vertices). If <sharepcurves> is False, pcurves are also replaced by their copies with help of method CopyPCurves
- param edge
- type edge
TopoDS_Edge
- param sharepcurves
default value is Standard_True
- type sharepcurves
bool
- rtype
TopoDS_Edge
-
CopyPCurves
()¶ - Makes a copy of pcurves from edge <fromedge> into edge <toedge>. Pcurves which are already present in <toedge>, are replaced by copies, other are copied. Ranges are also copied.
- param toedge
- type toedge
TopoDS_Edge
- param fromedge
- type fromedge
TopoDS_Edge
- rtype
None
-
CopyRanges
()¶ - Copies ranges for curve3d and all common pcurves from edge <fromedge> into edge <toedge>.
- param toedge
- type toedge
TopoDS_Edge
- param fromedge
- type fromedge
TopoDS_Edge
- param alpha
default value is 0
- type alpha
float
- param beta
default value is 1
- type beta
float
- rtype
None
-
CopyReplaceVertices
()¶ - Copy edge and replace one or both its vertices to a given one(s). Vertex V1 replaces FORWARD vertex, and V2 - REVERSED, as they are found by TopoDS_Iterator. If V1 or V2 is NULL, the original vertex is taken
- param edge
- type edge
TopoDS_Edge
- param V1
- type V1
TopoDS_Vertex
- param V2
- type V2
TopoDS_Vertex
- rtype
TopoDS_Edge
-
MakeEdge
()¶ - Makes edge with curve and location
- param edge
- type edge
TopoDS_Edge
- param curve
- type curve
Geom_Curve
- param L
- type L
TopLoc_Location
- rtype
None* Makes edge with curve, location and range [p1, p2]
- param edge
- type edge
TopoDS_Edge
- param curve
- type curve
Geom_Curve
- param L
- type L
TopLoc_Location
- param p1
- type p1
float
- param p2
- type p2
float
- rtype
None* Makes edge with pcurve and face
- param edge
- type edge
TopoDS_Edge
- param pcurve
- type pcurve
Geom2d_Curve
- param face
- type face
TopoDS_Face
- rtype
None* Makes edge with pcurve, face and range [p1, p2]
- param edge
- type edge
TopoDS_Edge
- param pcurve
- type pcurve
Geom2d_Curve
- param face
- type face
TopoDS_Face
- param p1
- type p1
float
- param p2
- type p2
float
- rtype
None* Makes edge with pcurve, surface and location
- param edge
- type edge
TopoDS_Edge
- param pcurve
- type pcurve
Geom2d_Curve
- param S
- type S
Geom_Surface
- param L
- type L
TopLoc_Location
- rtype
None* Makes edge with pcurve, surface, location and range [p1, p2]
- param edge
- type edge
TopoDS_Edge
- param pcurve
- type pcurve
Geom2d_Curve
- param S
- type S
Geom_Surface
- param L
- type L
TopLoc_Location
- param p1
- type p1
float
- param p2
- type p2
float
- rtype
None
-
ReassignPCurve
()¶ - Reassign edge pcurve lying on face <old> to another face <sub>. If edge has two pcurves on <old> face, only one of them will be reassigned, and other will left alone. Similarly, if edge already had a pcurve on face <sub>, it will have two pcurves on it. Returns True if succeeded, False if no pcurve lying on <old> found.
- param edge
- type edge
TopoDS_Edge
- param old
- type old
TopoDS_Face
- param sub
- type sub
TopoDS_Face
- rtype
bool
-
RemoveCurve3d
()¶ - Removes the Curve3D recorded in an Edge
- param edge
- type edge
TopoDS_Edge
- rtype
None
-
RemovePCurve
()¶ - Removes the PCurve(s) which could be recorded in an Edge for the given Face
- param edge
- type edge
TopoDS_Edge
- param face
- type face
TopoDS_Face
- rtype
None* Removes the PCurve(s) which could be recorded in an Edge for the given Surface
- param edge
- type edge
TopoDS_Edge
- param surf
- type surf
Geom_Surface
- rtype
None* Removes the PCurve(s) which could be recorded in an Edge for the given Surface, with given Location
- param edge
- type edge
TopoDS_Edge
- param surf
- type surf
Geom_Surface
- param loc
- type loc
TopLoc_Location
- rtype
None
-
ReplacePCurve
()¶ - Replace the PCurve in an Edge for the given Face In case if edge is seam, i.e. has 2 pcurves on that face, only pcurve corresponding to the orientation of the edge is replaced
- param edge
- type edge
TopoDS_Edge
- param pcurve
- type pcurve
Geom2d_Curve
- param face
- type face
TopoDS_Face
- rtype
None
-
SetRange3d
()¶ - Sets range on 3d curve only.
- param edge
- type edge
TopoDS_Edge
- param first
- type first
float
- param last
- type last
float
- rtype
None
-
TransformPCurve
()¶ - Transforms the PCurve with given matrix and affinity U factor.
- param pcurve
- type pcurve
Geom2d_Curve
- param trans
- type trans
gp_Trsf2d
- param uFact
- type uFact
float
- param aFirst
- type aFirst
float
- param aLast
- type aLast
float
- rtype
opencascade::handle<Geom2d_Curve>
-
property
thisown
¶ The membership flag
-
-
class
ShapeBuild_ReShape
(*args)¶ Bases:
OCC.Core.BRepTools.BRepTools_ReShape
- Returns an empty Reshape
- rtype
None
-
Apply
()¶ - Applies the substitutions requests to a shape //! <until> gives the level of type until which requests are taken into account. For subshapes of the type <until> no rebuild and futher exploring are done. ACTUALLY, NOT IMPLEMENTED BELOW TopAbs_FACE //! <buildmode> says how to do on a SOLID,SHELL … if one of its sub-shapes has been changed: 0: at least one Replace or Remove -> COMPOUND, else as such 1: at least one Remove (Replace are ignored) -> COMPOUND 2: Replace and Remove are both ignored If Replace/Remove are ignored or absent, the result as same type as the starting shape
- param shape
- type shape
TopoDS_Shape
- param until
- type until
TopAbs_ShapeEnum
- param buildmode
- type buildmode
int
- rtype
TopoDS_Shape* Applies the substitutions requests to a shape. //! <until> gives the level of type until which requests are taken into account. For subshapes of the type <until> no rebuild and futher exploring are done. //! NOTE: each subshape can be replaced by shape of the same type or by shape containing only shapes of that type (for example, TopoDS_Edge can be replaced by TopoDS_Edge, TopoDS_Wire or TopoDS_Compound containing TopoDS_Edges). If incompatible shape type is encountered, it is ignored and flag FAIL1 is set in Status.
- param shape
- type shape
TopoDS_Shape
- param until
default value is TopAbs_SHAPE
- type until
TopAbs_ShapeEnum
- rtype
TopoDS_Shape
-
static
DownCast
(t)¶
-
Status
()¶ - Returns a complete substitution status for a shape 0not recorded, <newsh> = original <shape> < 0: to be removed, <newsh> is NULL > 0: to be replaced, <newsh> is a new item If <last> is False, returns status and new shape recorded in the map directly for the shape, if True and status > 0 then recursively searches for the last status and new shape.
- param shape
- type shape
TopoDS_Shape
- param newsh
- type newsh
TopoDS_Shape
- param last
default value is Standard_False
- type last
bool
- rtype
int* Queries the status of last call to Apply(shape,enum) OK : no (sub)shapes replaced or removed DONE1: source (starting) shape replaced DONE2: source (starting) shape removed DONE3: some subshapes replaced DONE4: some subshapes removed FAIL1: some replacements not done because of bad type of subshape
- param status
- type status
ShapeExtend_Status
- rtype
bool
-
property
thisown
¶ The membership flag
-
class
ShapeBuild_Vertex
¶ Bases:
object
-
CombineVertex
()¶ - Combines new vertex from two others. This new one is the smallest vertex which comprises both of the source vertices. The function takes into account the positions and tolerances of the source vertices. The tolerance of the new vertex will be equal to the minimal tolerance that is required to comprise source vertices multiplied by tolFactor (in order to avoid errors because of discreteness of calculations).
- param V1
- type V1
TopoDS_Vertex
- param V2
- type V2
TopoDS_Vertex
- param tolFactor
default value is 1.0001
- type tolFactor
float
- rtype
TopoDS_Vertex* The same function as above, except that it accepts two points and two tolerances instead of vertices
- param pnt1
- type pnt1
gp_Pnt
- param pnt2
- type pnt2
gp_Pnt
- param tol1
- type tol1
float
- param tol2
- type tol2
float
- param tolFactor
default value is 1.0001
- type tolFactor
float
- rtype
TopoDS_Vertex
-
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
shapebuild
¶ Bases:
object
-
static
PlaneXOY
()¶ - Rebuilds a shape with substitution of some components Returns a Geom_Surface which is the Plane XOY (Z positive) This allows to consider an UV space homologous to a 3D space, with this support surface
- rtype
opencascade::handle<Geom_Plane>
-
property
thisown
¶ The membership flag
-
static