newton.utils#

Classes

ColorSpace

RGB color spaces used at Newton rendering boundaries.

EventTracer

Calculates elapsed times of functions annotated with event_scope.

MeshAdjacency

Connectivity tables of a soft (triangle) mesh, consumed by collision and the solvers.

MeshAdjacencyData

Kernel-facing soft-mesh adjacency -- pure data, no Python state or methods.

Functions

bourke_color_map(low, high, v)

Map a scalar value to an RGB color using Bourke's color ramp.

color_graph(num_nodes, graph_edge_indices[, ...])

A function that generates coloring for a graph, which is represented by the number of nodes and an array of edges.

color_linear_to_srgb(color)

Convert a linear RGB triple to sRGB/display encoding.

color_srgb_to_linear(color)

Convert an sRGB/display RGB triple to linear Rec.709.

compute_world_offsets(world_count, spacing)

Compute positional offsets for multiple worlds arranged in a grid.

download_asset(asset_folder[, cache_dir, ...])

Download a specific folder from the newton-assets GitHub repository into a local cache.

event_scope(fn[, name])

Wraps a function and records an event before and after the function invocation.

load_texture(texture)

Normalize a texture input into a contiguous image array.

normalize_texture(texture_image, *[, ...])

Normalize a texture array for rendering.

plot_graph(vertices, edges[, edge_labels, ...])

Plots a graph using matplotlib and networkx.

rasterize_mesh_to_heightfield(mesh, ...[, ...])

Rasterize a triangle mesh into a heightfield elevation grid.

remesh_mesh(mesh[, method, ...])

Remeshes a Mesh object using the specified remeshing method.

run_benchmark(benchmark_cls[, number, ...])

Simple scaffold to run a benchmark class.

solidify_mesh(faces, vertices, thickness)

Convert a surface mesh into a solid mesh by extruding along face normals.

string_to_warp(value, warp_dtype[, default])

Parse a Warp value from a string.

validate_tet_mesh(vertices, indices, *[, ...])

Check a tetrahedral mesh for quality issues and emit warnings.

validate_triangle_mesh(vertices, indices, *)

Check a triangle mesh for quality issues and emit warnings.

Deprecated

Name

Guidance

CableStiffness

Deprecated in 1.6; pass direct stiffness values to newton.ModelBuilder.add_rod() instead.

create_cable_stiffness_from_elastic_moduli

Deprecated in 1.6; supply elastic material through newton.Rod(...) or pass direct stiffness values to newton.ModelBuilder.add_rod() instead.

create_parallel_transport_cable_quaternions

Deprecated in 1.6; construct rod = newton.Rod(points) and read rod.quaternions instead. For nonzero twist_total, first call rod.compute_frames(twist_total=twist_total).

create_straight_cable_points

Deprecated in 1.6; use newton.Rod.create_straight(...).points instead.

create_straight_cable_points_and_quaternions

Deprecated in 1.6; use newton.Rod.create_straight(...) instead.