OCC.Extend.ShapeFactory module

class assert_isdone(to_check, error_statement)

Bases: object

raises an assertion error when IsDone() returns false, with the error specified in error_statement

center_boundingbox(shape)

compute the center point of a TopoDS_Shape, based on its bounding box

shape : TopoDS_Shape instance or a subclass like TopoDS_Face

gp_Pnt

get_boundingbox(shape, tol=1e-06, as_vec=False)

return the bounding box of the TopoDS_Shape shape

shapeTopoDS_Shape or a subclass such as TopoDS_Face

the shape to compute the bounding box from

tol: float

tolerance of the computed boundingbox

as_vecbool

wether to return the lower and upper point of the bounding box as gp_Vec instances

if as_vec is True, return a tuple of gp_Vec instances

for the lower and another for the upper X,Y,Z values representing the bounding box

if as_vec is False, return a tuple of lower and then upper X,Y,Z values

representing the bounding box

make_edge(*args)
make_edge2d(*args)
make_extrusion(face, length, vector=class<'gp_Vec'>)

creates a extrusion from a face, along the vector vector. with a distance legnth. Note that the normal vector does not necessary be normalized. By default, the extrusion is along the z axis.

make_face(*args)
make_n_sided(edges, continuity=0)
make_vertex(*args)
make_wire(*args)
midpoint(pntA, pntB)

computes the point that lies in the middle between pntA and pntB

pntA, pntB : gp_Pnt

gp_Pnt

point_list_to_TColgp_Array1OfPnt(li)
points_to_bspline(pnts)
rotate_shp_3_axis(shape, rx, ry, rz, unity='deg')

Rotate a shape around (O,x), (O,y) and (O,z).

@param rx_degree : rotation around (O,x) @param ry_degree : rotation around (O,y) @param rz_degree : rotation around (O,z)

@return : the rotated shape.

translate_shp(shp, vec, copy=False)