trimesh.path.creation module

Functions

box_outline([extents, transform])

Return a cuboid.

circle([radius, center])

Create a Path2D containing a single or multiple rectangles with the specified bounds.

circle_pattern(pattern_radius, …[, …])

Create a Path2D representing a circle pattern.

grid(side, count[, include_circle, …])

Create a Path3D for a grid visualization.

rectangle(bounds, **kwargs)

Create a Path2D containing a single or multiple rectangles with the specified bounds.

trimesh.path.creation.box_outline(extents=None, transform=None, **kwargs)

Return a cuboid.

Parameters
  • extents (float, or (3,) float) – Edge lengths

  • transform ((4, 4) float) – Transformation matrix

  • **kwargs – passed to Trimesh to create box

Returns

geometry – Path outline of a cuboid geometry

Return type

trimesh.Path3D

trimesh.path.creation.circle(radius=None, center=None, **kwargs)

Create a Path2D containing a single or multiple rectangles with the specified bounds.

Parameters

bounds ((2, 2) float, or (m, 2, 2) float) – Minimum XY, Maximum XY

Returns

rect – Path containing specified rectangles

Return type

Path2D

trimesh.path.creation.circle_pattern(pattern_radius, circle_radius, count, center=[0.0, 0.0], angle=None, **kwargs)

Create a Path2D representing a circle pattern.

Parameters
  • pattern_radius (float) – Radius of circle centers

  • circle_radius (float) – The radius of each circle

  • count (int) – Number of circles in the pattern

  • center ((2,) float) – Center of pattern

  • angle (float) – If defined pattern will span this angle If None, pattern will be evenly spaced

Returns

pattern – Path containing circular pattern

Return type

trimesh.path.Path2D

trimesh.path.creation.grid(side, count, include_circle=True, sections_circle=32, transform=None)

Create a Path3D for a grid visualization.

Parameters
  • side (float) – Length of half of a grid side

  • count (int) – Number of grid lines per grid half

  • include_circle (bool) – Include a circular pattern inside the grid

  • sections_circle (int) – How many sections should the smallest circle have

  • transform (None or (4, 4) float) – Transformation matrix

trimesh.path.creation.rectangle(bounds, **kwargs)

Create a Path2D containing a single or multiple rectangles with the specified bounds.

Parameters

bounds ((2, 2) float, or (m, 2, 2) float) – Minimum XY, Maximum XY

Returns

rect – Path containing specified rectangles

Return type

Path2D