trimesh.path.creation

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, center=None, **kwargs)

Create a Path2D containing circle with the specified radius.

Parameters:
  • radius (float) – The radius of the circle

  • center (None or (2,) float) – Center of the circle, origin by default

  • kwargs (**) – Passed to trimesh.path.Path2D constructor

Returns:

circle – Path containing specified circle

Return type:

Path2D

trimesh.path.creation.circle_pattern(pattern_radius, circle_radius, count, center=None, 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=5, transform=None, plane_origin=None, plane_normal=None, include_circle=True, sections_circle=32)

Create a Path3D for a grid visualization of a plane.

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

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

  • transform (None or (4, 4) float) – Transformation matrix to move grid location. Takes precedence over plane_origin if both are passed.

  • plane_origin (None or (3,) float) – Plane origin

  • plane_normal (None or (3,) float) – Unit normal vector

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

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

Returns:

grid – Path containing grid plane visualization

Return type:

trimesh.path.Path3D

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