コード例 #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)
コード例 #2
0
ファイル: solid.py プロジェクト: mirmik/zencad
def _make_solid(shells):
    if not isinstance(shells, (list, tuple)):
        shells = [shells]

    algo = BRepBuilderAPI_MakeSolid()

    for s in shells:
        algo.Add(s.Shell())

    fixer = ShapeFix_Solid(algo.Solid())
    fixer.Perform()
    return Shape(fixer.Solid())
コード例 #3
0
ファイル: entities.py プロジェクト: tnakaicode/AFEM-OCC
    def by_shell(shell):
        """
        Create a solid from the shell.

        :param afem.topology.entities.Shell shell: The shell.

        :return: The new solid.
        :rtype: afem.topology.entities.Solid
        """
        return Solid(ShapeFix_Solid().SolidFromShell(shell.object))
コード例 #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
コード例 #5
0
def _fill3d(shp):
    algo = ShapeFix_Solid()
    return Shape(algo.SolidFromShell(shp.Shell()))
コード例 #6
0
def _shapefix_solid(shp):
    algo2 = ShapeFix_Solid(shp.Shape())
    algo2.Perform()
    return Shape(algo2.Solid())