newton.utils#

Classes

EventTracer

Calculates elapsed times of functions annotated with event_scope.

MeshAdjacency

Builds and stores edge adjacency information for a triangle mesh.

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.

compute_world_offsets(world_count, spacing)

Compute positional offsets for multiple worlds arranged in a grid.

create_cable_stiffness_from_elastic_moduli(...)

Create rod/cable stiffness parameters from elastic moduli (circular cross-section).

create_parallel_transport_cable_quaternions(...)

Generate per-segment quaternions using a parallel-transport style construction.

create_straight_cable_points(start, ...)

Create straight cable polyline points.

create_straight_cable_points_and_quaternions(...)

Generate straight cable points and matching per-segment quaternions.

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

Downloads 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.

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.