OCC.BRepPrimAPI module

The BRepBuilderAPI package provides an ApplicationProgramming Interface for the BRep topology datastructure.The API is a set of classes aiming to provide :* High level and simple calls for the most commonoperations.* Keeping an access on the low-levelimplementation of high-level calls.* Examples of programming of high-level operationsfrom low-level operations.* A complete coverage of modelling :- Creating vertices ,edges, faces, solids.- Sweeping operations.- Boolean operations.- Global properties computation.The API provides classes to build objects:* The constructors of the classes provides thedifferent constructions methods.* The class keeps as fields the different toolsused to build the object.* The class provides a casting method to getautomatically the result with a function-likecall.For example to make a vertex <V> from a point <P>one can writes :V = BRepBuilderAPI_MakeVertex(P);orBRepBuilderAPI_MakeVertex MV(P);V = MV.Vertex();For tolerances a default precision is used whichcan be changed by the packahe methodBRepBuilderAPI::Precision.For error handling the BRepBuilderAPI commands raise onlythe NotDone error. When Done is false on a commandthe error description can be asked to the command.In theory the comands can be called with anyarguments, argument checking is performed by thecommand.

class BRepPrimAPI_MakeBox(*args)

Bases: OCC.BRepBuilderAPI.BRepBuilderAPI_MakeShape

  • Make a box with a corner at 0,0,0 and the other dx,dy,dz
Parameters:
Return type:

None

  • Make a box with a corner at P and size dx, dy, dz.
Parameters:
Return type:

None

  • Make a box with corners P1,P2.
Parameters:
Return type:

None

  • Ax2 is the left corner and the axis. Constructs a box such that its sides are parallel to the axes of - the global coordinate system, or - the local coordinate system Axis. and - with a corner at (0, 0, 0) and of size (dx, dy, dz), or - with a corner at point P and of size (dx, dy, dz), or - with corners at points P1 and P2. Exceptions Standard_DomainError if: dx, dy, dz are less than or equal to Precision::Confusion(), or - the vector joining the points P1 and P2 has a component projected onto the global coordinate system less than or equal to Precision::Confusion(). In these cases, the box would be flat.
Parameters:
Return type:

None

BackFace()
  • Returns XMin face
Return type:TopoDS_Face
BottomFace()
  • Returns ZMin face
Return type:TopoDS_Face
FrontFace()
  • Returns XMax face
Return type:TopoDS_Face
LeftFace()
  • Returns YMin face
Return type:TopoDS_Face
RightFace()
  • Returns YMax face
Return type:TopoDS_Face
Shell()
  • Returns the constructed box as a shell.
Return type:TopoDS_Shell
Solid()
  • Returns the constructed box as a solid.
Return type:TopoDS_Solid
TopFace()
  • Returns ZMax face
Return type:TopoDS_Face
Wedge()
  • Returns the internal algorithm.
Return type:BRepPrim_Wedge
thisown

The membership flag

class BRepPrimAPI_MakeCone(*args)

Bases: OCC.BRepPrimAPI.BRepPrimAPI_MakeOneAxis

  • Make a cone of height H radius R1 in the plane z = 0, R2 in the plane Z = H. R1 and R2 may be null.
Parameters:
Return type:

None

  • Make a cone of height H radius R1 in the plane z = 0, R2 in the plane Z = H. R1 and R2 may be null. Take a section of <angle>
Parameters:
Return type:

None

  • Make a cone of height H radius R1 in the plane z = 0, R2 in the plane Z = H. R1 and R2 may be null.
Parameters:
Return type:

None

  • Make a cone of height H radius R1 in the plane z = 0, R2 in the plane Z = H. R1 and R2 may be null. Take a section of <angle> Constructs a cone, or a portion of a cone, of height H, and radius R1 in the plane z = 0 and R2 in the plane z = H. The result is a sharp cone if R1 or R2 is equal to 0. The cone is constructed about the ‘Z Axis’ of either: - the global coordinate system, or - the local coordinate system Axes. It is limited in these coordinate systems as follows: - in the v parametric direction (the Z coordinate), by the two parameter values 0 and H, - and in the u parametric direction (defined by the angle of rotation around the Z axis), in the case of a portion of a cone, by the two parameter values 0 and angle. Angle is given in radians. The resulting shape is composed of: - a lateral conical face - two planar faces in the planes z = 0 and z = H, or only one planar face in one of these two planes if a radius value is null (in the case of a complete cone, these faces are circles), and - and in the case of a portion of a cone, two planar faces to close the shape. (either two parallelograms or two triangles, in the planes u = 0 and u = angle). Exceptions Standard_DomainError if: - H is less than or equal to Precision::Confusion(), or - the half-angle at the apex of the cone, defined by R1, R2 and H, is less than Precision::Confusion()/H, or greater than (Pi/2)-Precision::Confusion()/H.f
Parameters:
Return type:

None

Cone()
  • Missing detailed docstring.
Return type:BRepPrim_Cone
thisown

The membership flag

class BRepPrimAPI_MakeCylinder(*args)

Bases: OCC.BRepPrimAPI.BRepPrimAPI_MakeOneAxis

  • Make a cylinder of radius R and length H.
Parameters:
Return type:

None

  • Make a cylinder of radius R and length H with angle H.
Parameters:
Return type:

None

  • Make a cylinder of radius R and length H.
Parameters:
Return type:

None

  • Make a cylinder of radius R and length H with angle H. Constructs - a cylinder of radius R and height H, or - a portion of cylinder of radius R and height H, and of the angle Angle defining the missing portion of the cylinder. The cylinder is constructed about the ‘Z Axis’ of either: - the global coordinate system, or - the local coordinate system Axes. It is limited in this coordinate system as follows: - in the v parametric direction (the Z axis), by the two parameter values 0 and H, - and in the u parametric direction (the rotation angle around the Z Axis), in the case of a portion of a cylinder, by the two parameter values 0 and Angle. Angle is given in radians. The resulting shape is composed of: - a lateral cylindrical face, - two planar faces in the planes z = 0 and z = H (in the case of a complete cylinder, these faces are circles), and - in case of a portion of a cylinder, two additional planar faces to close the shape.(two rectangles in the planes u = 0 and u = Angle). Exceptions Standard_DomainError if: - R is less than or equal to Precision::Confusion(), or - H is less than or equal to Precision::Confusion().
Parameters:
Return type:

None

Cylinder()
  • Missing detailed docstring.
Return type:BRepPrim_Cylinder
thisown

The membership flag

class BRepPrimAPI_MakeHalfSpace(*args)

Bases: OCC.BRepBuilderAPI.BRepBuilderAPI_MakeShape

  • Make a HalfSpace defined with a Face and a Point.
Parameters:
  • Face (TopoDS_Face &) –
  • RefPnt (gp_Pnt) –
Return type:

None

  • Make a HalfSpace defined with a Shell and a Point.
Parameters:
  • Shell (TopoDS_Shell &) –
  • RefPnt (gp_Pnt) –
Return type:

None

Solid()
  • Returns the constructed half-space as a solid.
Return type:TopoDS_Solid
thisown

The membership flag

class BRepPrimAPI_MakeOneAxis(*args, **kwargs)

Bases: OCC.BRepBuilderAPI.BRepBuilderAPI_MakeShape

Face()
  • Returns the lateral face of the rotational primitive.
Return type:TopoDS_Face
OneAxis()
  • The inherited commands should provide the algorithm. Returned as a pointer.
Return type:Standard_Address
Shell()
  • Returns the constructed rotational primitive as a shell.
Return type:TopoDS_Shell
Solid()
  • Returns the constructed rotational primitive as a solid.
Return type:TopoDS_Solid
thisown

The membership flag

class BRepPrimAPI_MakePrism(*args)

Bases: OCC.BRepPrimAPI.BRepPrimAPI_MakeSweep

  • Builds the prism of base S and vector V. If C is true, S is copied. If Canonize is true then generated surfaces are attempted to be canonized in simple types
Parameters:
  • S (TopoDS_Shape &) –
  • V (gp_Vec) –
  • Copy (bool) – default value is Standard_False
  • Canonize (bool) – default value is Standard_True
Return type:

None

  • Builds a semi-infinite or an infinite prism of base S. If Inf is true the prism is infinite, if Inf is false the prism is semi-infinite (in the direction D). If C is true S is copied (for semi-infinite prisms). If Canonize is true then generated surfaces are attempted to be canonized in simple types
Parameters:
  • S (TopoDS_Shape &) –
  • D (gp_Dir) –
  • Inf (bool) – default value is Standard_True
  • Copy (bool) – default value is Standard_False
  • Canonize (bool) – default value is Standard_True
Return type:

None

FirstShape()
  • Returns the TopoDS Shape of the bottom of the prism.
Return type:TopoDS_Shape
  • Returns the TopoDS Shape of the bottom of the prism. generated with theShape (subShape of the generating shape).
Parameters:theShape (TopoDS_Shape &) –
Return type:TopoDS_Shape
LastShape()
  • Returns the TopoDS Shape of the top of the prism. In the case of a finite prism, FirstShape returns the basis of the prism, in other words, S if Copy is false; otherwise, the copy of S belonging to the prism. LastShape returns the copy of S translated by V at the time of construction.
Return type:TopoDS_Shape
  • Returns the TopoDS Shape of the top of the prism. generated with theShape (subShape of the generating shape).
Parameters:theShape (TopoDS_Shape &) –
Return type:TopoDS_Shape
Prism()
  • Returns the internal sweeping algorithm.
Return type:BRepSweep_Prism
thisown

The membership flag

class BRepPrimAPI_MakeRevol(*args)

Bases: OCC.BRepPrimAPI.BRepPrimAPI_MakeSweep

  • Builds the Revol of base S, axis A and angle D. If C is true, S is copied.
Parameters:
  • S (TopoDS_Shape &) –
  • A (gp_Ax1) –
  • D (float) –
  • Copy (bool) – default value is Standard_False
Return type:

None

  • Builds the Revol of base S, axis A and angle 2*Pi. If C is true, S is copied.
Parameters:
  • S (TopoDS_Shape &) –
  • A (gp_Ax1) –
  • Copy (bool) – default value is Standard_False
Return type:

None

Degenerated()
Return type:TopTools_ListOfShape
FirstShape()
  • Returns the first shape of the revol (coinciding with the generating shape).
Return type:TopoDS_Shape
  • Returns the TopoDS Shape of the beginning of the revolution, generated with theShape (subShape of the generating shape).
Parameters:theShape (TopoDS_Shape &) –
Return type:TopoDS_Shape
HasDegenerated()
  • Check if there are degenerated edges in the result.
Return type:bool
LastShape()
  • Returns the TopoDS Shape of the end of the revol.
Return type:TopoDS_Shape
  • Returns the TopoDS Shape of the end of the revolution, generated with theShape (subShape of the generating shape).
Parameters:theShape (TopoDS_Shape &) –
Return type:TopoDS_Shape
Revol()
  • Returns the internal sweeping algorithm.
Return type:BRepSweep_Revol
thisown

The membership flag

class BRepPrimAPI_MakeRevolution(*args)

Bases: OCC.BRepPrimAPI.BRepPrimAPI_MakeOneAxis

  • Make a revolution body by rotating a curve around Z.
Parameters:Meridian (Handle_Geom_Curve &) –
Return type:None
  • Make a revolution body by rotating a curve around Z.
Parameters:
  • Meridian (Handle_Geom_Curve &) –
  • angle (float) –
Return type:

None

  • Make a revolution body by rotating a curve around Z.
Parameters:
  • Meridian (Handle_Geom_Curve &) –
  • VMin (float) –
  • VMax (float) –
Return type:

None

  • Make a revolution body by rotating a curve around Z.
Parameters:
  • Meridian (Handle_Geom_Curve &) –
  • VMin (float) –
  • VMax (float) –
  • angle (float) –
Return type:

None

  • Make a revolution body by rotating a curve around Z.
Parameters:
  • Axes (gp_Ax2) –
  • Meridian (Handle_Geom_Curve &) –
Return type:

None

  • Make a revolution body by rotating a curve around Z.
Parameters:
  • Axes (gp_Ax2) –
  • Meridian (Handle_Geom_Curve &) –
  • angle (float) –
Return type:

None

  • Make a revolution body by rotating a curve around Z.
Parameters:
  • Axes (gp_Ax2) –
  • Meridian (Handle_Geom_Curve &) –
  • VMin (float) –
  • VMax (float) –
Return type:

None

  • Make a revolution body by rotating a curve around Z. For all algorithms the resulting shape is composed of - a lateral revolved face, - two planar faces in planes parallel to the plane z = 0, and passing by the extremities of the revolved portion of Meridian, if these points are not on the Z axis (in case of a complete revolved shape, these faces are circles), - and in the case of a portion of a revolved shape, two planar faces to close the shape (in the planes u = 0 and u = angle).
Parameters:
  • Axes (gp_Ax2) –
  • Meridian (Handle_Geom_Curve &) –
  • VMin (float) –
  • VMax (float) –
  • angle (float) –
Return type:

None

Revolution()
  • Missing detailed docstring.
Return type:BRepPrim_Revolution
thisown

The membership flag

class BRepPrimAPI_MakeSphere(*args)

Bases: OCC.BRepPrimAPI.BRepPrimAPI_MakeOneAxis

  • Make a sphere of radius R.
Parameters:R (float) –
Return type:None
  • Make a sphere of radius R.
Parameters:
Return type:

None

  • Make a sphere of radius R.
Parameters:
Return type:

None

  • Make a sphere of radius R.
Parameters:
Return type:

None

  • Make a sphere of radius R.
Parameters:
Return type:

None

  • Make a sphere of radius R.
Parameters:
Return type:

None

  • Make a sphere of radius R.
Parameters:
Return type:

None

  • Make a sphere of radius R.
Parameters:
Return type:

None

  • Make a sphere of radius R.
Parameters:
Return type:

None

  • Make a sphere of radius R.
Parameters:
Return type:

None

  • Make a sphere of radius R.
Parameters:
Return type:

None

  • Make a sphere of radius R. For all algorithms The resulting shape is composed of - a lateral spherical face, - two planar faces parallel to the plane z = 0 if the sphere is truncated in the v parametric direction, or only one planar face if angle1 is equal to -p/2 or if angle2 is equal to p/2 (these faces are circles in case of a complete truncated sphere), - and in case of a portion of sphere, two planar faces to shut the shape.(in the planes u = 0 and u = angle).
Parameters:
Return type:

None

Sphere()
  • Missing detailed docstring.
Return type:BRepPrim_Sphere
thisown

The membership flag

class BRepPrimAPI_MakeSweep(*args, **kwargs)

Bases: OCC.BRepBuilderAPI.BRepBuilderAPI_MakeShape

FirstShape()
  • Returns the TopoDS Shape of the bottom of the sweep.
Return type:TopoDS_Shape
LastShape()
  • Returns the TopoDS Shape of the top of the sweep.
Return type:TopoDS_Shape
thisown

The membership flag

class BRepPrimAPI_MakeTorus(*args)

Bases: OCC.BRepPrimAPI.BRepPrimAPI_MakeOneAxis

  • Make a torus of radii R1 R2.
Parameters:
Return type:

None

  • Make a section of a torus of radii R1 R2.
Parameters:
Return type:

None

  • Make a torus of radii R2, R2 with angles on the small circle.
Parameters:
Return type:

None

  • Make a torus of radii R2, R2 with angles on the small circle.
Parameters:
Return type:

None

  • Make a torus of radii R1 R2.
Parameters:
Return type:

None

  • Make a section of a torus of radii R1 R2.
Parameters:
Return type:

None

  • Make a torus of radii R1 R2.
Parameters:
Return type:

None

  • Make a section of a torus of radii R1 R2. For all algorithms The resulting shape is composed of - a lateral toroidal face, - two conical faces (defined by the equation v = angle1 and v = angle2) if the sphere is truncated in the v parametric direction (they may be cylindrical faces in some particular conditions), and in case of a portion of torus, two planar faces to close the shape.(in the planes u = 0 and u = angle). Notes: - The u parameter corresponds to a rotation angle around the Z axis. - The circle whose radius is equal to the minor radius, located in the plane defined by the X axis and the Z axis, centered on the X axis, on its positive side, and positioned at a distance from the origin equal to the major radius, is the reference circle of the torus. The rotation around an axis parallel to the Y axis and passing through the center of the reference circle gives the v parameter on the reference circle. The X axis gives the origin of the v parameter. Near 0, as v increases, the Z coordinate decreases.
Parameters:
Return type:

None

Torus()
  • Missing detailed docstring.
Return type:BRepPrim_Torus
thisown

The membership flag

class BRepPrimAPI_MakeWedge(*args)

Bases: OCC.BRepBuilderAPI.BRepBuilderAPI_MakeShape

  • Make a STEP right angular wedge. (ltx >= 0)
Parameters:
Return type:

None

  • Make a STEP right angular wedge. (ltx >= 0)
Parameters:
Return type:

None

  • Make a wedge. The face at dy is xmin,zmin xmax,zmax
Parameters:
Return type:

None

  • Make a wedge. The face at dy is xmin,zmin xmax,zmax
Parameters:
Return type:

None

Shell()
  • Returns the constructed box in the form of a shell.
Return type:TopoDS_Shell
Solid()
  • Returns the constructed box in the form of a solid.
Return type:TopoDS_Solid
Wedge()
  • Returns the internal algorithm.
Return type:BRepPrim_Wedge
thisown

The membership flag

class SwigPyIterator(*args, **kwargs)

Bases: object

advance()
copy()
decr()
distance()
equal()
incr()
next()
previous()
thisown

The membership flag

value()
new_instancemethod(func, inst, cls)
register_handle(handle, base_object)

Inserts the handle into the base object to prevent memory corruption in certain cases