Exemplo n.º 1
0
    def get_mesh_vertex(self, pos):
        """
        Get location of a single mesh vertex.

        Args:
            pos: 0-based (row, col)-tuple, position of mesh vertex

        """
        m_count = self.dxf.m_count
        n_count = self.dxf.n_count
        m, n = pos
        if 0 <= m < m_count and 0 <= n < n_count:
            pos = m * n_count + n
            return self.__getitem__(pos)
        else:
            raise const.DXFIndexError(repr(pos))
Exemplo n.º 2
0
    def get_mesh_vertex(self, pos: Tuple[int, int]) -> 'DXFVertex':
        """
        Get location of a single mesh vertex.

        Args:
            pos: 0-based ``(row, col)`` tuple, position of mesh vertex

        """
        m_count = self.dxf.m_count
        n_count = self.dxf.n_count
        m, n = pos
        if 0 <= m < m_count and 0 <= n < n_count:
            pos = m * n_count + n
            return self.vertices[pos]
        else:
            raise const.DXFIndexError(repr(pos))
Exemplo n.º 3
0
    def get_mesh_vertex(self, pos: Tuple[int, int]) -> 'DXFVertex':
        """
        Get location of a single mesh vertex.

        Args:
            pos: 0-based (row, col)-tuple, position of mesh vertex

        """
        polyline = cast('Polyline', self)
        m_count = polyline.dxf.m_count
        n_count = polyline.dxf.n_count
        m, n = pos
        if 0 <= m < m_count and 0 <= n < n_count:
            pos = m * n_count + n
            return polyline.__getitem__(pos)
        else:
            raise const.DXFIndexError(repr(pos))