Esempio n. 1
0
            cg_symbol, randomness=True, indices=range(cg.coordination_number), max_random_dist=0.05
        )

        lgf.perfect_geometry = AbstractGeometry.from_cg(cg=cg)

        # Setting up the plane of separation
        local_plane = None
        found = False
        for npoints in range(sepplanealgo.minimum_number_of_points, min(sepplanealgo.maximum_number_of_points, 4) + 1):
            if found:
                break
            for ipoints in itertools.combinations(sepplanealgo.plane_points, npoints):
                points_combination = [lgf.local_geometry.coords[ipoint] for ipoint in ipoints]
                if npoints == 2:
                    if collinear(
                        points_combination[0], points_combination[1], lgf.local_geometry.central_site, tolerance=0.25
                    ):
                        continue
                    local_plane = Plane.from_3points(
                        points_combination[0], points_combination[1], lgf.local_geometry.central_site
                    )
                    found = True
                    break
                elif npoints == 3:
                    if collinear(points_combination[0], points_combination[1], points_combination[2], tolerance=0.25):
                        continue
                    local_plane = Plane.from_3points(
                        points_combination[0], points_combination[1], points_combination[2]
                    )
                    found = True
                    break
        # (csms, perms, sep_perms) = lgf.coordination_geometry_symmetry_measures_separation_plane_newpmg(coordination_geometry=cg,
        #                                                                                                separation_plane_algo=sepplanealgo,
        #                                                                                                testing=True)

        # Setting up the plane of separation
        local_plane = None
        found = False
        for npoints in range(sepplanealgo.minimum_number_of_points,
                             min(sepplanealgo.maximum_number_of_points, 4)+1):
            if found:
                break
            for ipoints in itertools.combinations(sepplanealgo.plane_points, npoints):
                points_combination = [lgf.local_geometry.coords[ipoint] for ipoint in ipoints]
                if npoints == 2:
                    if collinear(points_combination[0], points_combination[1],
                                 lgf.local_geometry.central_site, tolerance=0.25):
                        continue
                    local_plane = Plane.from_3points(points_combination[0], points_combination[1],
                                               lgf.local_geometry.central_site)
                    found = True
                    break
                elif npoints == 3:
                    if collinear(points_combination[0], points_combination[1], points_combination[2], tolerance=0.25):
                        continue
                    local_plane = Plane.from_3points(points_combination[0], points_combination[1], points_combination[2])
                    found = True
                    break
                elif npoints > 3:
                    local_plane = Plane.from_npoints(points_combination, best_fit='least_square_distance')
                    found = True
                    break