Ejemplo n.º 1
0
 def test_standard_integer_by_ref_passed_returned(self):
     '''
     Checks the Standard_Integer & byreference return parameter
     '''
     sfs = ShapeFix_Solid()
     sfs.SetFixShellMode(5)
     self.assertEqual(sfs.GetFixShellMode(), 5)
Ejemplo n.º 2
0
 def testStandardIntegerByRefPassedReturned(self):
     '''
     Checks the Standard_Integer & byreference return parameter
     '''
     print 'Test: Standard_Integer & by reference transformator'
     from OCC.ShapeFix import ShapeFix_Solid
     sfs = ShapeFix_Solid()
     sfs.SetFixShellMode(5)
     self.assertEqual(sfs.GetFixShellMode(), 5)
Ejemplo n.º 3
0
def fix_close_solid(occsolid):
    shape_fix = ShapeFix_Solid(occsolid)
    shape_fix.Perform()
    fix_solid = shape_fix.Solid()
    fix_solid_list = fetch.geom_explorer(fix_solid, "solid")
    if not fix_solid_list:
        return None
    else:
        fix_solid = fix_solid_list[0]
        breplib.OrientClosedSolid(fix_solid)
        return fix_solid
Ejemplo n.º 4
0
def fix_close_solid(occsolid):
    """
    This function fixes an OCCsolid by making sure all the OCCfaces in the solid have an outward orientation. 
 
    Parameters
    ----------        
    occsolid : OCCsolid
        The OCCsolid to be fixed.

    Returns
    -------
    fixed solid : OCCsolid
        The fixed OCCsolid. If None it means the solid is not fixed.
    """
    shape_fix = ShapeFix_Solid(occsolid)
    shape_fix.Perform()
    fix_solid = shape_fix.Solid()
    fix_solid_list = fetch.topo_explorer(fix_solid, "solid")
    if not fix_solid_list:
        return None
    else:
        fix_solid = fix_solid_list[0]
        breplib.OrientClosedSolid(fix_solid)
        return fix_solid