topologicpy.Grid module

class topologicpy.Grid.Grid

Bases: object

Utility methods for creating edge and vertex grids.

Methods

EdgesByDistances([face, uOrigin, vOrigin, ...])

Creates a grid of edges by distance offsets.

EdgesByParameters(face[, uRange, vRange, ...])

Creates a grid of edges by face parameters.

VerticesByDistances([face, origin, uRange, ...])

Creates a grid of vertices by distance offsets.

VerticesByDistances_old([face, origin, ...])

Deprecated compatibility wrapper for VerticesByDistances.

VerticesByParameters([face, uRange, vRange, ...])

Creates a grid of vertices by face parameters.

static EdgesByDistances(face=None, uOrigin=None, vOrigin=None, uRange=None, vRange=None, clip=False, mantissa: int = 6, tolerance=0.0001)

Creates a grid of edges by distance offsets.

Parameters
facetopologic_core.Face , optional

The input face. If set to None, the grid is created on the XY plane. Default is None.

uOrigintopologic_core.Vertex , optional

The origin used for u offsets. If None, it is set to the face’s (0,0) parameter vertex or to the world origin when face is None. Default is None.

vOrigintopologic_core.Vertex , optional

The origin used for v offsets. If None, it is set to the face’s (0,0) parameter vertex or to the world origin when face is None. Default is None.

uRangelist , optional

A list of distance offsets in the u direction. Default is [-0.5,-0.25,0,0.25,0.5].

vRangelist , optional

A list of distance offsets in the v direction. Default is [-0.5,-0.25,0,0.25,0.5].

clipbool , optional

If True, the grid is clipped by the input face. Default is False.

mantissaint , optional

The number of decimal places to round coordinates to. Default is 6.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

Returns
topologic_core.Cluster

The created grid. Edges in the grid have a dictionary with keys “dir” and “offset”.

static EdgesByParameters(face, uRange=None, vRange=None, clip=False, tolerance=0.0001)

Creates a grid of edges by face parameters.

Parameters
facetopologic_core.Face

The input face.

uRangelist , optional

A list of u parameters for the u grid lines. Default is [0,0.25,0.5,0.75,1.0].

vRangelist , optional

A list of v parameters for the v grid lines. Default is [0,0.25,0.5,0.75,1.0].

clipbool , optional

If True, the grid is clipped by the input face. Default is False.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

Returns
topologic_core.Cluster

The created grid. Edges in the grid have a dictionary with keys “dir” and “offset”.

static VerticesByDistances(face=None, origin=None, uRange=None, vRange=None, clip: bool = False, mantissa: int = 6, tolerance: float = 0.0001, silent: bool = False)

Creates a grid of vertices by distance offsets.

Parameters
facetopologic_core.Face , optional

The input face. If set to None, the grid is created on the XY plane. Default is None.

origintopologic_core.Vertex , optional

The origin of the grid vertices. If None, it is set to the face’s (0,0) parameter vertex or to the world origin when face is None. Default is None.

uRangelist , optional

A list of distance offsets in the u direction. Default is [-0.5,-0.25,0,0.25,0.5].

vRangelist , optional

A list of distance offsets in the v direction. Default is [-0.5,-0.25,0,0.25,0.5].

clipbool , optional

If True, vertices outside the input face are removed. Default is False.

mantissaint , optional

The number of decimal places to round coordinates to. Default is 6.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

silentbool , optional

If set to True, no warning or error messages are printed. Default is False.

Returns
topologic_core.Cluster

The created grid. Vertices in the grid have a dictionary with keys “u” and “v”.

static VerticesByDistances_old(face=None, origin=None, uRange=None, vRange=None, clip: bool = False, mantissa: int = 6, tolerance: float = 0.0001)

Deprecated compatibility wrapper for VerticesByDistances.

static VerticesByParameters(face=None, uRange=None, vRange=None, clip=False, tolerance=0.0001, silent: bool = False)

Creates a grid of vertices by face parameters.

Parameters
facetopologic_core.Face

The input face.

uRangelist , optional

A list of u parameters. Default is [0,0.25,0.5,0.75,1.0].

vRangelist , optional

A list of v parameters. Default is [0,0.25,0.5,0.75,1.0].

clipbool , optional

If True, vertices outside the input face are removed. Default is False.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

silentbool , optional

If set to True, no warning or error messages are printed. Default is False.

Returns
topologic_core.Cluster

The created grid. Vertices in the grid have a dictionary with keys “u” and “v”.