コード例 #1
0
ファイル: Construct.py プロジェクト: psavine42/OCCUtilsExt
def make_box(*args):
    p1, p2 = None, None
    if isinstance(args, (list, tuple)):
        if len(args) == 2:
            p1 = make_pnt(args[0])
            p2 = make_pnt(args[1])

        elif len(args) == 6:
            p1 = gp_Pnt(*args[0:3])
            p2 = gp_Pnt(*args[3:])

    if p1 is None:
        return

    box = BRepPrimAPI_MakeBox(p1, p2)
    box.Build()
    with assert_isdone(box, 'failed to built a cube...'):
        return box.Shape()
コード例 #2
0
def make_box(*args):
    box = BRepPrimAPI_MakeBox(*args)
    box.Build()
    with assert_isdone(box, 'failed to built a cube...'):
        return box.Shape()
コード例 #3
0
#---------------------------------------------------------------------------
# the objective of this test is merely validating a succesful pythonocc-core
# install through `conda install pythonocc-core`
# not to be mistaken for unittests...
#---------------------------------------------------------------------------
from OCC.BRepPrimAPI import BRepPrimAPI_MakeBox
my_box = BRepPrimAPI_MakeBox(10., 20., 30.)
my_box.Build()
assert my_box.IsDone()