Copy disabled (too large)
Download .txt
Showing preview only (17,809K chars total). Download the full file to get everything.
Repository: newton-physics/newton
Branch: main
Commit: 04e4be2554be
Files: 730
Total size: 16.8 MB
Directory structure:
gitextract_nsnm_v9o/
├── .claude/
│ └── skills/
│ └── newton-api-design/
│ └── SKILL.md
├── .coderabbit.yml
├── .gitattributes
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── 1-bug-report.yml
│ │ ├── 2-feature-request.yml
│ │ ├── 3-documentation.yml
│ │ └── config.yml
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── codecov.yml
│ └── workflows/
│ ├── aws_gpu_benchmarks.yml
│ ├── aws_gpu_tests.yml
│ ├── ci.yml
│ ├── docs-dev.yml
│ ├── docs-release.yml
│ ├── merge_queue_aws_gpu.yml
│ ├── minimum_deps_tests.yml
│ ├── mujoco_warp_tests.yml
│ ├── pr.yml
│ ├── pr_closed.yml
│ ├── pr_license_check.yml
│ ├── pr_target_aws_gpu_benchmarks.yml
│ ├── pr_target_aws_gpu_tests.yml
│ ├── push_aws_gpu.yml
│ ├── release.yml
│ ├── scheduled_nightly.yml
│ └── warp_nightly_tests.yml
├── .gitignore
├── .licenserc-docs.yaml
├── .licenserc.yaml
├── .pre-commit-config.yaml
├── .python-version
├── AGENTS.md
├── CHANGELOG.md
├── CITATION.cff
├── CLAUDE.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md
├── SECURITY.md
├── asv/
│ └── benchmarks/
│ ├── __init__.py
│ ├── benchmark_ik.py
│ ├── benchmark_mujoco.py
│ ├── compilation/
│ │ ├── __init__.py
│ │ └── bench_example_load.py
│ ├── setup/
│ │ ├── __init__.py
│ │ └── bench_model.py
│ └── simulation/
│ ├── __init__.py
│ ├── bench_anymal.py
│ ├── bench_cable.py
│ ├── bench_cloth.py
│ ├── bench_contacts.py
│ ├── bench_heightfield.py
│ ├── bench_ik.py
│ ├── bench_mujoco.py
│ ├── bench_quadruped_xpbd.py
│ ├── bench_selection.py
│ ├── bench_sensor_tiled_camera.py
│ └── bench_viewer.py
├── asv.conf.json
├── docs/
│ ├── Makefile
│ ├── _ext/
│ │ ├── autodoc_filter.py
│ │ └── autodoc_wpfunc.py
│ ├── _static/
│ │ ├── custom.css
│ │ ├── gh-pages-404.html
│ │ └── switcher.json
│ ├── _templates/
│ │ ├── autosummary/
│ │ │ └── class.rst
│ │ ├── class.rst
│ │ ├── genindex.html
│ │ ├── py-modindex.html
│ │ ├── search.html
│ │ └── sidebar-nav-bs.html
│ ├── api/
│ │ ├── newton.rst
│ │ ├── newton_geometry.rst
│ │ ├── newton_ik.rst
│ │ ├── newton_math.rst
│ │ ├── newton_selection.rst
│ │ ├── newton_sensors.rst
│ │ ├── newton_solvers.rst
│ │ ├── newton_solvers_style3d.rst
│ │ ├── newton_usd.rst
│ │ ├── newton_utils.rst
│ │ └── newton_viewer.rst
│ ├── concepts/
│ │ ├── articulations.rst
│ │ ├── collisions.rst
│ │ ├── conventions.rst
│ │ ├── custom_attributes.rst
│ │ ├── extended_attributes.rst
│ │ ├── mass_inertia.rst
│ │ ├── sensors.rst
│ │ ├── sites.rst
│ │ ├── usd_parsing.rst
│ │ └── worlds.rst
│ ├── conf.py
│ ├── faq.rst
│ ├── generate_api.py
│ ├── guide/
│ │ ├── development.rst
│ │ ├── installation.rst
│ │ ├── overview.rst
│ │ ├── release.rst
│ │ ├── tutorials.rst
│ │ └── visualization.rst
│ ├── images/
│ │ └── examples/
│ │ ├── resize.bat
│ │ └── resize.sh
│ ├── index.rst
│ ├── integrations/
│ │ ├── index.rst
│ │ ├── isaac-lab.rst
│ │ └── mujoco.rst
│ ├── make.bat
│ ├── migration.rst
│ ├── print_api.py
│ ├── serve.py
│ └── tutorials/
│ └── 00_introduction.ipynb
├── newton/
│ ├── __init__.py
│ ├── _src/
│ │ ├── core/
│ │ │ ├── __init__.py
│ │ │ └── types.py
│ │ ├── geometry/
│ │ │ ├── __init__.py
│ │ │ ├── broad_phase_common.py
│ │ │ ├── broad_phase_nxn.py
│ │ │ ├── broad_phase_sap.py
│ │ │ ├── collision_convex.py
│ │ │ ├── collision_core.py
│ │ │ ├── collision_primitive.py
│ │ │ ├── contact_data.py
│ │ │ ├── contact_reduction.py
│ │ │ ├── contact_reduction_global.py
│ │ │ ├── contact_reduction_hydroelastic.py
│ │ │ ├── differentiable_contacts.py
│ │ │ ├── flags.py
│ │ │ ├── hashtable.py
│ │ │ ├── inertia.py
│ │ │ ├── kernels.py
│ │ │ ├── mpr.py
│ │ │ ├── multicontact.py
│ │ │ ├── narrow_phase.py
│ │ │ ├── raycast.py
│ │ │ ├── remesh.py
│ │ │ ├── sdf_contact.py
│ │ │ ├── sdf_hydroelastic.py
│ │ │ ├── sdf_mc.py
│ │ │ ├── sdf_texture.py
│ │ │ ├── sdf_utils.py
│ │ │ ├── simplex_solver.py
│ │ │ ├── support_function.py
│ │ │ ├── terrain_generator.py
│ │ │ ├── types.py
│ │ │ └── utils.py
│ │ ├── math/
│ │ │ ├── __init__.py
│ │ │ └── spatial.py
│ │ ├── sensors/
│ │ │ ├── __init__.py
│ │ │ ├── sensor_contact.py
│ │ │ ├── sensor_frame_transform.py
│ │ │ ├── sensor_imu.py
│ │ │ ├── sensor_raycast.py
│ │ │ ├── sensor_tiled_camera.py
│ │ │ └── warp_raytrace/
│ │ │ ├── __init__.py
│ │ │ ├── bvh.py
│ │ │ ├── gaussians.py
│ │ │ ├── lighting.py
│ │ │ ├── ray_intersect.py
│ │ │ ├── raytrace.py
│ │ │ ├── render.py
│ │ │ ├── render_context.py
│ │ │ ├── textures.py
│ │ │ ├── tiling.py
│ │ │ ├── types.py
│ │ │ └── utils.py
│ │ ├── sim/
│ │ │ ├── __init__.py
│ │ │ ├── articulation.py
│ │ │ ├── builder.py
│ │ │ ├── collide.py
│ │ │ ├── contacts.py
│ │ │ ├── control.py
│ │ │ ├── enums.py
│ │ │ ├── graph_coloring.py
│ │ │ ├── ik/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── ik_common.py
│ │ │ │ ├── ik_lbfgs_optimizer.py
│ │ │ │ ├── ik_lm_optimizer.py
│ │ │ │ ├── ik_objectives.py
│ │ │ │ └── ik_solver.py
│ │ │ ├── model.py
│ │ │ └── state.py
│ │ ├── solvers/
│ │ │ ├── __init__.py
│ │ │ ├── featherstone/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── kernels.py
│ │ │ │ └── solver_featherstone.py
│ │ │ ├── flags.py
│ │ │ ├── implicit_mpm/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── contact_solver_kernels.py
│ │ │ │ ├── implicit_mpm_model.py
│ │ │ │ ├── implicit_mpm_solver_kernels.py
│ │ │ │ ├── rasterized_collisions.py
│ │ │ │ ├── render_grains.py
│ │ │ │ ├── rheology_solver_kernels.py
│ │ │ │ ├── solve_rheology.py
│ │ │ │ └── solver_implicit_mpm.py
│ │ │ ├── kamino/
│ │ │ │ ├── README.md
│ │ │ │ ├── __init__.py
│ │ │ │ ├── _src/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── core/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── bodies.py
│ │ │ │ │ │ ├── builder.py
│ │ │ │ │ │ ├── control.py
│ │ │ │ │ │ ├── conversions.py
│ │ │ │ │ │ ├── data.py
│ │ │ │ │ │ ├── geometry.py
│ │ │ │ │ │ ├── gravity.py
│ │ │ │ │ │ ├── inertia.py
│ │ │ │ │ │ ├── joints.py
│ │ │ │ │ │ ├── materials.py
│ │ │ │ │ │ ├── math.py
│ │ │ │ │ │ ├── model.py
│ │ │ │ │ │ ├── shapes.py
│ │ │ │ │ │ ├── size.py
│ │ │ │ │ │ ├── state.py
│ │ │ │ │ │ ├── time.py
│ │ │ │ │ │ ├── types.py
│ │ │ │ │ │ └── world.py
│ │ │ │ │ ├── dynamics/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── delassus.py
│ │ │ │ │ │ ├── dual.py
│ │ │ │ │ │ └── wrenches.py
│ │ │ │ │ ├── geometry/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── aggregation.py
│ │ │ │ │ │ ├── contacts.py
│ │ │ │ │ │ ├── detector.py
│ │ │ │ │ │ ├── keying.py
│ │ │ │ │ │ ├── primitive/
│ │ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ │ ├── broadphase.py
│ │ │ │ │ │ │ ├── narrowphase.py
│ │ │ │ │ │ │ └── pipeline.py
│ │ │ │ │ │ └── unified.py
│ │ │ │ │ ├── integrators/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── euler.py
│ │ │ │ │ │ ├── integrator.py
│ │ │ │ │ │ └── moreau.py
│ │ │ │ │ ├── kinematics/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── constraints.py
│ │ │ │ │ │ ├── jacobians.py
│ │ │ │ │ │ ├── joints.py
│ │ │ │ │ │ ├── limits.py
│ │ │ │ │ │ └── resets.py
│ │ │ │ │ ├── linalg/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── blas.py
│ │ │ │ │ │ ├── conjugate.py
│ │ │ │ │ │ ├── core.py
│ │ │ │ │ │ ├── factorize/
│ │ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ │ ├── llt_blocked.py
│ │ │ │ │ │ │ ├── llt_blocked_semi_sparse.py
│ │ │ │ │ │ │ └── llt_sequential.py
│ │ │ │ │ │ ├── linear.py
│ │ │ │ │ │ ├── sparse_matrix.py
│ │ │ │ │ │ ├── sparse_operator.py
│ │ │ │ │ │ └── utils/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── matrix.py
│ │ │ │ │ │ ├── rand.py
│ │ │ │ │ │ └── range.py
│ │ │ │ │ ├── models/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── assets/
│ │ │ │ │ │ │ ├── basics/
│ │ │ │ │ │ │ │ ├── box_on_plane.usda
│ │ │ │ │ │ │ │ ├── box_pendulum.usda
│ │ │ │ │ │ │ │ ├── boxes_fourbar.usda
│ │ │ │ │ │ │ │ ├── boxes_hinged.usda
│ │ │ │ │ │ │ │ ├── boxes_nunchaku.usda
│ │ │ │ │ │ │ │ └── cartpole.usda
│ │ │ │ │ │ │ └── testing/
│ │ │ │ │ │ │ ├── geoms/
│ │ │ │ │ │ │ │ ├── test_geom_box.usda
│ │ │ │ │ │ │ │ ├── test_geom_capsule.usda
│ │ │ │ │ │ │ │ ├── test_geom_cone.usda
│ │ │ │ │ │ │ │ ├── test_geom_cylinder.usda
│ │ │ │ │ │ │ │ ├── test_geom_ellipsoid.usda
│ │ │ │ │ │ │ │ └── test_geom_sphere.usda
│ │ │ │ │ │ │ └── joints/
│ │ │ │ │ │ │ ├── test_joint_cartesian_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_cartesian_actuated_unary.usda
│ │ │ │ │ │ │ ├── test_joint_cartesian_passive.usda
│ │ │ │ │ │ │ ├── test_joint_cartesian_passive_unary.usda
│ │ │ │ │ │ │ ├── test_joint_cylindrical_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_cylindrical_actuated_unary.usda
│ │ │ │ │ │ │ ├── test_joint_cylindrical_passive.usda
│ │ │ │ │ │ │ ├── test_joint_cylindrical_passive_unary.usda
│ │ │ │ │ │ │ ├── test_joint_d6_6dof_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_d6_6dof_passive.usda
│ │ │ │ │ │ │ ├── test_joint_d6_cartesian_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_d6_cartesian_passive.usda
│ │ │ │ │ │ │ ├── test_joint_d6_cylindrical_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_d6_cylindrical_passive.usda
│ │ │ │ │ │ │ ├── test_joint_d6_prismatic_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_d6_prismatic_passive.usda
│ │ │ │ │ │ │ ├── test_joint_d6_revolute_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_d6_revolute_passive.usda
│ │ │ │ │ │ │ ├── test_joint_d6_spherical_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_d6_spherical_passive.usda
│ │ │ │ │ │ │ ├── test_joint_d6_universal_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_d6_universal_passive.usda
│ │ │ │ │ │ │ ├── test_joint_fixed.usda
│ │ │ │ │ │ │ ├── test_joint_fixed_unary.usda
│ │ │ │ │ │ │ ├── test_joint_prismatic_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_prismatic_actuated_unary.usda
│ │ │ │ │ │ │ ├── test_joint_prismatic_passive.usda
│ │ │ │ │ │ │ ├── test_joint_prismatic_passive_unary.usda
│ │ │ │ │ │ │ ├── test_joint_revolute_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_revolute_actuated_unary.usda
│ │ │ │ │ │ │ ├── test_joint_revolute_passive.usda
│ │ │ │ │ │ │ ├── test_joint_revolute_passive_unary.usda
│ │ │ │ │ │ │ ├── test_joint_spherical.usda
│ │ │ │ │ │ │ ├── test_joint_spherical_unary.usda
│ │ │ │ │ │ │ ├── test_joint_universal_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_universal_actuated_unary.usda
│ │ │ │ │ │ │ ├── test_joint_universal_passive.usda
│ │ │ │ │ │ │ └── test_joint_universal_passive_unary.usda
│ │ │ │ │ │ └── builders/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── basics.py
│ │ │ │ │ │ ├── basics_newton.py
│ │ │ │ │ │ ├── testing.py
│ │ │ │ │ │ └── utils.py
│ │ │ │ │ ├── solver_kamino_impl.py
│ │ │ │ │ ├── solvers/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── fk.py
│ │ │ │ │ │ ├── metrics.py
│ │ │ │ │ │ ├── padmm/
│ │ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ │ ├── kernels.py
│ │ │ │ │ │ │ ├── math.py
│ │ │ │ │ │ │ ├── solver.py
│ │ │ │ │ │ │ └── types.py
│ │ │ │ │ │ └── warmstart.py
│ │ │ │ │ └── utils/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── benchmark/
│ │ │ │ │ │ ├── .gitignore
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── __main__.py
│ │ │ │ │ │ ├── configs.py
│ │ │ │ │ │ ├── metrics.py
│ │ │ │ │ │ ├── problems.py
│ │ │ │ │ │ ├── render.py
│ │ │ │ │ │ └── runner.py
│ │ │ │ │ ├── control/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── animation.py
│ │ │ │ │ │ ├── pid.py
│ │ │ │ │ │ └── rand.py
│ │ │ │ │ ├── device.py
│ │ │ │ │ ├── io/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ └── usd.py
│ │ │ │ │ ├── logger.py
│ │ │ │ │ ├── profiles.py
│ │ │ │ │ ├── sim/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── datalog.py
│ │ │ │ │ │ ├── runner.py
│ │ │ │ │ │ ├── simulator.py
│ │ │ │ │ │ └── viewer.py
│ │ │ │ │ ├── sparse.py
│ │ │ │ │ └── viewer.py
│ │ │ │ ├── config.py
│ │ │ │ ├── examples/
│ │ │ │ │ ├── .gitignore
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── newton/
│ │ │ │ │ │ ├── example_anymal_d.py
│ │ │ │ │ │ ├── example_dr_legs.py
│ │ │ │ │ │ └── example_fourbar.py
│ │ │ │ │ ├── reset/
│ │ │ │ │ │ └── example_reset_dr_legs.py
│ │ │ │ │ ├── rl/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── camera_follow.py
│ │ │ │ │ │ ├── example_rl_bipedal.py
│ │ │ │ │ │ ├── example_rl_drlegs.py
│ │ │ │ │ │ ├── joystick.py
│ │ │ │ │ │ ├── observations.py
│ │ │ │ │ │ ├── simulation.py
│ │ │ │ │ │ ├── simulation_runner.py
│ │ │ │ │ │ ├── test_multi_env_dr_legs.py
│ │ │ │ │ │ └── utils.py
│ │ │ │ │ └── sim/
│ │ │ │ │ ├── example_sim_basics_all_heterogeneous.py
│ │ │ │ │ ├── example_sim_basics_box_on_plane.py
│ │ │ │ │ ├── example_sim_basics_box_pendulum.py
│ │ │ │ │ ├── example_sim_basics_boxes_fourbar.py
│ │ │ │ │ ├── example_sim_basics_boxes_hinged.py
│ │ │ │ │ ├── example_sim_basics_cartpole.py
│ │ │ │ │ ├── example_sim_dr_legs.py
│ │ │ │ │ ├── example_sim_dr_testmech.py
│ │ │ │ │ ├── example_sim_test_all_geoms.py
│ │ │ │ │ └── example_sim_test_all_joints.py
│ │ │ │ ├── solver_kamino.py
│ │ │ │ └── tests/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── README.md
│ │ │ │ ├── __init__.py
│ │ │ │ ├── __main__.py
│ │ │ │ ├── test_core_builder.py
│ │ │ │ ├── test_core_geometry.py
│ │ │ │ ├── test_core_joints.py
│ │ │ │ ├── test_core_materials.py
│ │ │ │ ├── test_core_model.py
│ │ │ │ ├── test_core_shapes.py
│ │ │ │ ├── test_core_world.py
│ │ │ │ ├── test_dynamics_delassus.py
│ │ │ │ ├── test_dynamics_dual.py
│ │ │ │ ├── test_dynamics_wrenches.py
│ │ │ │ ├── test_geometry_aggregation.py
│ │ │ │ ├── test_geometry_contacts.py
│ │ │ │ ├── test_geometry_detector.py
│ │ │ │ ├── test_geometry_keying.py
│ │ │ │ ├── test_geometry_margin_gap.py
│ │ │ │ ├── test_geometry_primitive.py
│ │ │ │ ├── test_geometry_unified.py
│ │ │ │ ├── test_kinematics_constraints.py
│ │ │ │ ├── test_kinematics_jacobians.py
│ │ │ │ ├── test_kinematics_joints.py
│ │ │ │ ├── test_kinematics_limits.py
│ │ │ │ ├── test_linalg_core.py
│ │ │ │ ├── test_linalg_factorize_llt_blocked.py
│ │ │ │ ├── test_linalg_factorize_llt_sequential.py
│ │ │ │ ├── test_linalg_solve_cg.py
│ │ │ │ ├── test_linalg_solver_llt_blocked.py
│ │ │ │ ├── test_linalg_solver_llt_sequential.py
│ │ │ │ ├── test_linalg_sparse.py
│ │ │ │ ├── test_linalg_utils_matrix.py
│ │ │ │ ├── test_linalg_utils_rand.py
│ │ │ │ ├── test_solver_kamino.py
│ │ │ │ ├── test_solvers_forward_kinematics.py
│ │ │ │ ├── test_solvers_metrics.py
│ │ │ │ ├── test_solvers_padmm.py
│ │ │ │ ├── test_utils_control_animation.py
│ │ │ │ ├── test_utils_control_pid.py
│ │ │ │ ├── test_utils_control_rand.py
│ │ │ │ ├── test_utils_io_usd.py
│ │ │ │ ├── test_utils_logger.py
│ │ │ │ ├── test_utils_profiles.py
│ │ │ │ ├── test_utils_random.py
│ │ │ │ ├── test_utils_sim_simulator.py
│ │ │ │ └── utils/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── checks.py
│ │ │ │ ├── diff_check.py
│ │ │ │ ├── extract.py
│ │ │ │ ├── make.py
│ │ │ │ ├── print.py
│ │ │ │ └── rand.py
│ │ │ ├── mujoco/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── kernels.py
│ │ │ │ └── solver_mujoco.py
│ │ │ ├── semi_implicit/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── kernels_body.py
│ │ │ │ ├── kernels_contact.py
│ │ │ │ ├── kernels_muscle.py
│ │ │ │ ├── kernels_particle.py
│ │ │ │ └── solver_semi_implicit.py
│ │ │ ├── solver.py
│ │ │ ├── style3d/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── builder.py
│ │ │ │ ├── cloth.py
│ │ │ │ ├── collision/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── bvh/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── bvh.py
│ │ │ │ │ │ └── kernels.py
│ │ │ │ │ ├── collision.py
│ │ │ │ │ ├── collision_legacy.py
│ │ │ │ │ └── kernels.py
│ │ │ │ ├── kernels.py
│ │ │ │ ├── linear_solver.py
│ │ │ │ └── solver_style3d.py
│ │ │ ├── vbd/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── particle_vbd_kernels.py
│ │ │ │ ├── rigid_vbd_kernels.py
│ │ │ │ ├── solver_vbd.py
│ │ │ │ └── tri_mesh_collision.py
│ │ │ └── xpbd/
│ │ │ ├── __init__.py
│ │ │ ├── kernels.py
│ │ │ └── solver_xpbd.py
│ │ ├── usd/
│ │ │ ├── __init__.py
│ │ │ ├── schema_resolver.py
│ │ │ ├── schemas.py
│ │ │ └── utils.py
│ │ ├── utils/
│ │ │ ├── __init__.py
│ │ │ ├── benchmark.py
│ │ │ ├── cable.py
│ │ │ ├── download_assets.py
│ │ │ ├── heightfield.py
│ │ │ ├── import_mjcf.py
│ │ │ ├── import_urdf.py
│ │ │ ├── import_usd.py
│ │ │ ├── import_utils.py
│ │ │ ├── mesh.py
│ │ │ ├── render.py
│ │ │ ├── selection.py
│ │ │ ├── texture.py
│ │ │ └── topology.py
│ │ └── viewer/
│ │ ├── __init__.py
│ │ ├── camera.py
│ │ ├── gl/
│ │ │ ├── gui.py
│ │ │ ├── icon.py
│ │ │ ├── opengl.py
│ │ │ └── shaders.py
│ │ ├── kernels.py
│ │ ├── picking.py
│ │ ├── viewer.py
│ │ ├── viewer_file.py
│ │ ├── viewer_gl.py
│ │ ├── viewer_null.py
│ │ ├── viewer_rerun.py
│ │ ├── viewer_usd.py
│ │ ├── viewer_viser.py
│ │ ├── viser/
│ │ │ └── static/
│ │ │ ├── assets/
│ │ │ │ ├── Sorter-Df0J3ZWJ.wasm
│ │ │ │ ├── SplatSortWorker-DiSpcAPr.js
│ │ │ │ ├── WebsocketServerWorker-C6PJJ7Dx.js
│ │ │ │ ├── __vite-browser-external-BIHI7g3E.js
│ │ │ │ ├── index-BVvA0mmR.css
│ │ │ │ └── index-H4DT9vxj.js
│ │ │ ├── index.html
│ │ │ ├── manifest.json
│ │ │ └── robots.txt
│ │ └── wind.py
│ ├── _version.py
│ ├── examples/
│ │ ├── __init__.py
│ │ ├── __main__.py
│ │ ├── assets/
│ │ │ ├── ant.usda
│ │ │ ├── anymal_walking_policy.pt
│ │ │ ├── axis_cube.usda
│ │ │ ├── bear.usd
│ │ │ ├── boxes_fourbar.usda
│ │ │ ├── bunny.usd
│ │ │ ├── cartpole.urdf
│ │ │ ├── cartpole.usda
│ │ │ ├── cartpole_single_pendulum.usda
│ │ │ ├── crazyflie.usd
│ │ │ ├── curvedSurface.usd
│ │ │ ├── humanoid.usda
│ │ │ ├── nv_ant.xml
│ │ │ ├── nv_humanoid.xml
│ │ │ ├── quadruped.urdf
│ │ │ ├── rj45_plug.usd
│ │ │ ├── sensor_contact_scene.usda
│ │ │ ├── tabletop.xml
│ │ │ └── unisex_shirt.usd
│ │ ├── basic/
│ │ │ ├── example_basic_conveyor.py
│ │ │ ├── example_basic_heightfield.py
│ │ │ ├── example_basic_joints.py
│ │ │ ├── example_basic_pendulum.py
│ │ │ ├── example_basic_plotting.py
│ │ │ ├── example_basic_shapes.py
│ │ │ ├── example_basic_urdf.py
│ │ │ ├── example_basic_viewer.py
│ │ │ ├── example_recording.py
│ │ │ └── example_replay_viewer.py
│ │ ├── cable/
│ │ │ ├── example_cable_bundle_hysteresis.py
│ │ │ ├── example_cable_pile.py
│ │ │ ├── example_cable_twist.py
│ │ │ └── example_cable_y_junction.py
│ │ ├── cloth/
│ │ │ ├── example_cloth_bending.py
│ │ │ ├── example_cloth_franka.py
│ │ │ ├── example_cloth_h1.py
│ │ │ ├── example_cloth_hanging.py
│ │ │ ├── example_cloth_poker_cards.py
│ │ │ ├── example_cloth_rollers.py
│ │ │ ├── example_cloth_style3d.py
│ │ │ └── example_cloth_twist.py
│ │ ├── contacts/
│ │ │ ├── example_brick_stacking.py
│ │ │ ├── example_contacts_rj45_plug.py
│ │ │ ├── example_nut_bolt_hydro.py
│ │ │ ├── example_nut_bolt_sdf.py
│ │ │ └── example_pyramid.py
│ │ ├── diffsim/
│ │ │ ├── example_diffsim_ball.py
│ │ │ ├── example_diffsim_bear.py
│ │ │ ├── example_diffsim_cloth.py
│ │ │ ├── example_diffsim_drone.py
│ │ │ ├── example_diffsim_soft_body.py
│ │ │ └── example_diffsim_spring_cage.py
│ │ ├── ik/
│ │ │ ├── example_ik_cube_stacking.py
│ │ │ ├── example_ik_custom.py
│ │ │ ├── example_ik_franka.py
│ │ │ └── example_ik_h1.py
│ │ ├── mpm/
│ │ │ ├── example_mpm_anymal.py
│ │ │ ├── example_mpm_beam_twist.py
│ │ │ ├── example_mpm_grain_rendering.py
│ │ │ ├── example_mpm_granular.py
│ │ │ ├── example_mpm_multi_material.py
│ │ │ ├── example_mpm_snow_ball.py
│ │ │ ├── example_mpm_twoway_coupling.py
│ │ │ └── example_mpm_viscous.py
│ │ ├── multiphysics/
│ │ │ ├── example_softbody_dropping_to_cloth.py
│ │ │ └── example_softbody_gift.py
│ │ ├── robot/
│ │ │ ├── example_robot_allegro_hand.py
│ │ │ ├── example_robot_anymal_c_walk.py
│ │ │ ├── example_robot_anymal_d.py
│ │ │ ├── example_robot_cartpole.py
│ │ │ ├── example_robot_g1.py
│ │ │ ├── example_robot_h1.py
│ │ │ ├── example_robot_panda_hydro.py
│ │ │ ├── example_robot_policy.py
│ │ │ └── example_robot_ur10.py
│ │ ├── selection/
│ │ │ ├── example_selection_articulations.py
│ │ │ ├── example_selection_cartpole.py
│ │ │ ├── example_selection_materials.py
│ │ │ └── example_selection_multiple.py
│ │ ├── sensors/
│ │ │ ├── example_sensor_contact.py
│ │ │ ├── example_sensor_imu.py
│ │ │ └── example_sensor_tiled_camera.py
│ │ └── softbody/
│ │ ├── example_softbody_franka.py
│ │ └── example_softbody_hanging.py
│ ├── geometry.py
│ ├── ik.py
│ ├── licenses/
│ │ ├── CC-BY-4.0.txt
│ │ ├── unittest-parallel-LICENSE.txt
│ │ └── viser_and_inter-font-family.txt
│ ├── math.py
│ ├── py.typed
│ ├── selection.py
│ ├── sensors.py
│ ├── solvers.py
│ ├── tests/
│ │ ├── __init__.py
│ │ ├── __main__.py
│ │ ├── assets/
│ │ │ ├── actuator_test.usda
│ │ │ ├── ant.usda
│ │ │ ├── ant_mixed.usda
│ │ │ ├── ant_multi.usda
│ │ │ ├── cartpole_mjc.usda
│ │ │ ├── constraints.xml
│ │ │ ├── cube_cylinder.usda
│ │ │ ├── four_link_chain_articulation.usda
│ │ │ ├── humanoid.urdf
│ │ │ ├── humanoid.usda
│ │ │ ├── mjcf_exclude_hyphen_test.xml
│ │ │ ├── mjcf_exclude_test.xml
│ │ │ ├── pendulum_revolute_vs_d6.usda
│ │ │ ├── revolute_articulation.usda
│ │ │ ├── simple_articulation_with_mesh.usda
│ │ │ ├── tetmesh_custom_attrs.usda
│ │ │ ├── tetmesh_multi.usda
│ │ │ ├── tetmesh_simple.usda
│ │ │ └── tetmesh_with_material.usda
│ │ ├── golden_data/
│ │ │ └── test_sensor_tiled_camera/
│ │ │ ├── color.npy
│ │ │ └── depth.npy
│ │ ├── test_actuators.py
│ │ ├── test_anymal_reset.py
│ │ ├── test_api.py
│ │ ├── test_body_force.py
│ │ ├── test_body_velocity.py
│ │ ├── test_broad_phase.py
│ │ ├── test_cable.py
│ │ ├── test_cloth.py
│ │ ├── test_collision_cloth.py
│ │ ├── test_collision_pipeline.py
│ │ ├── test_collision_primitives.py
│ │ ├── test_coloring.py
│ │ ├── test_cone_orientation.py
│ │ ├── test_contact_reduction.py
│ │ ├── test_contact_reduction_global.py
│ │ ├── test_control_force.py
│ │ ├── test_custom_attributes.py
│ │ ├── test_differentiable_contacts.py
│ │ ├── test_download_assets.py
│ │ ├── test_environment_group_collision.py
│ │ ├── test_equality_constraints.py
│ │ ├── test_example_browser.py
│ │ ├── test_examples.py
│ │ ├── test_fixed_tendon.py
│ │ ├── test_gjk.py
│ │ ├── test_hashtable.py
│ │ ├── test_heightfield.py
│ │ ├── test_hydroelastic.py
│ │ ├── test_ik.py
│ │ ├── test_ik_fk_kernels.py
│ │ ├── test_ik_lbfgs.py
│ │ ├── test_implicit_mpm.py
│ │ ├── test_implicit_mpm_flow_rule.py
│ │ ├── test_import_mjcf.py
│ │ ├── test_import_urdf.py
│ │ ├── test_import_usd.py
│ │ ├── test_inertia.py
│ │ ├── test_inertia_validation.py
│ │ ├── test_jacobian_mass_matrix.py
│ │ ├── test_joint_controllers.py
│ │ ├── test_joint_drive.py
│ │ ├── test_joint_limits.py
│ │ ├── test_kinematic_links.py
│ │ ├── test_kinematics.py
│ │ ├── test_match_labels.py
│ │ ├── test_menagerie_mujoco.py
│ │ ├── test_menagerie_usd_mujoco.py
│ │ ├── test_mesh_aabb.py
│ │ ├── test_model.py
│ │ ├── test_mujoco_general_actuators.py
│ │ ├── test_mujoco_solver.py
│ │ ├── test_narrow_phase.py
│ │ ├── test_obb.py
│ │ ├── test_parent_force.py
│ │ ├── test_pendulum_revolute_vs_d6.py
│ │ ├── test_physics_validation.py
│ │ ├── test_raycast.py
│ │ ├── test_recorder.py
│ │ ├── test_remesh.py
│ │ ├── test_rigid_contact.py
│ │ ├── test_robot_composer.py
│ │ ├── test_runtime_gravity.py
│ │ ├── test_schema_resolver.py
│ │ ├── test_sdf_compute.py
│ │ ├── test_sdf_primitive.py
│ │ ├── test_sdf_texture.py
│ │ ├── test_selection.py
│ │ ├── test_sensor_contact.py
│ │ ├── test_sensor_frame_transform.py
│ │ ├── test_sensor_imu.py
│ │ ├── test_sensor_raycast.py
│ │ ├── test_sensor_tiled_camera.py
│ │ ├── test_sensor_tiled_camera_forward_depth.py
│ │ ├── test_sensor_tiled_camera_particles_multiworld.py
│ │ ├── test_shape_colors.py
│ │ ├── test_shapes_no_bounce.py
│ │ ├── test_sites.py
│ │ ├── test_sites_mjcf_import.py
│ │ ├── test_sites_mujoco_export.py
│ │ ├── test_sites_usd_import.py
│ │ ├── test_softbody.py
│ │ ├── test_solver_vbd.py
│ │ ├── test_solver_xpbd.py
│ │ ├── test_spatial_tendon.py
│ │ ├── test_terrain_generator.py
│ │ ├── test_tolerance_clamping.py
│ │ ├── test_up_axis.py
│ │ ├── test_viewer_geometry_batching.py
│ │ ├── test_viewer_log_shapes.py
│ │ ├── test_viewer_particle_flags.py
│ │ ├── test_viewer_picking.py
│ │ ├── test_viewer_rerun_hidden.py
│ │ ├── test_viewer_rerun_init_args.py
│ │ ├── test_viewer_usd.py
│ │ ├── test_viewer_world_offsets.py
│ │ ├── test_warp_config_cli.py
│ │ ├── thirdparty/
│ │ │ ├── __init__.py
│ │ │ └── unittest_parallel.py
│ │ └── unittest_utils.py
│ ├── usd.py
│ ├── utils.py
│ └── viewer.py
├── pyproject.toml
└── scripts/
├── check_warp_array_syntax.py
└── ci/
├── dispatch_workflow_and_wait.py
└── update_docs_switcher.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .claude/skills/newton-api-design/SKILL.md
================================================
---
name: newton-api-design
description: Use when designing, adding, or reviewing public API for the Newton physics engine — class names, method signatures, type hints, docstrings, or parameter conventions. Also use when unsure if new API conforms to project conventions.
---
# Newton API Design Conventions
Detailed patterns that supplement AGENTS.md. Read AGENTS.md first for the basics (prefix-first naming, PEP 604, Google-style docstrings, SI units, Sphinx cross-refs).
## Builder Method Signature Template
All `ModelBuilder.add_shape_*` methods follow this parameter order:
```python
def add_shape_cone(
self,
body: int,
xform: Transform | None = None,
# shape-specific params here (radius, height, etc.)
radius: float = 0.5,
height: float = 1.0,
cfg: ShapeConfig | None = None,
as_site: bool = False,
label: str | None = None,
custom_attributes: dict[str, Any] | None = None,
) -> int:
"""Adds a cone collision shape to a body.
Args:
body: Index of the parent body. Use -1 for static shapes.
xform: Transform in parent body's local frame. If ``None``,
identity transform is used.
radius: Cone base radius [m].
height: Cone height [m].
cfg: Shape configuration. If ``None``, uses
:attr:`default_shape_cfg`.
as_site: If ``True``, creates a site instead of a collision shape.
label: Optional label for identifying the shape.
custom_attributes: Dictionary of custom attribute names to values.
Returns:
Index of the newly added shape.
"""
```
**Key conventions:**
- `xform` (not `tf`, `transform`, or `pose`) — always `Transform | None = None`
- `cfg` (not `config`, `shape_config`) — always `ShapeConfig | None = None`
- `body`, `label`, `custom_attributes` — standard params on all builder methods
- Defaults are `None`, not constructed objects like `wp.transform()`
## Nested Classes
Use `IntEnum` (not `Enum` with strings) for enumerations:
```python
class Model:
class AttributeAssignment(IntEnum):
MODEL = 0
STATE = 1
```
When an `IntEnum` includes a `NONE` member, define it first at `0`:
```python
class GeoType(IntEnum):
NONE = 0
PLANE = 1
HFIELD = 2
```
This keeps the sentinel value stable and leaves room to append future real
members at the end instead of inserting them before a trailing `NONE`.
Dataclass field docstrings go on the line immediately below the field:
```python
@dataclass
class ShapeConfig:
density: float = 1000.0
"""The density of the shape material."""
ke: float = 2.5e3
"""The contact elastic stiffness."""
```
## Array Documentation Format
Document shape, dtype, and units in attribute docstrings:
```python
"""Rigid body velocities [m/s, rad/s], shape (body_count,), dtype :class:`spatial_vector`."""
"""Joint forces [N or N·m], shape (joint_dof_count,), dtype float."""
"""Contact points [m], shape [count, 3], float."""
```
For compound arrays, list per-component units:
```python
"""[0] k_mu [Pa], [1] k_lambda [Pa], ..."""
```
For **public API** attributes and method signatures, use bare `wp.array | None` and document the concrete dtype in the docstring (e.g., `dtype :class:\`vec3\``). Warp kernel parameters require concrete dtypes inline (`wp.array(dtype=wp.vec3)`) per AGENTS.md.
## Quick Checklist
When reviewing new API, verify:
- [ ] Parameters use project vocabulary (`xform`, `cfg`, `body`, `label`)
- [ ] Defaults are `None`, not constructed objects
- [ ] Nested enumerations use `IntEnum` with int values
- [ ] Enumerations with `NONE` define `NONE = 0` first
- [ ] Dataclass fields have docstrings on the line below
- [ ] Array docs include shape, dtype, and units
- [ ] Builder methods include `as_site`, `label`, `custom_attributes`
================================================
FILE: .coderabbit.yml
================================================
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
language: "en-US"
early_access: false
reviews:
profile: "chill"
request_changes_workflow: false
high_level_summary: true
poem: false
review_status: true
collapse_walkthrough: true
auto_review:
enabled: true
drafts: true
tools:
github-checks:
timeout_ms: 900000
path_instructions:
- path: "**"
instructions: |
Check that any user-facing change includes a corresponding entry in
CHANGELOG.md under the [Unreleased] section. Entries should use
imperative present tense ("Add X", not "Added X") and be placed under
the correct category (Added, Changed, Deprecated, Removed, or Fixed).
For Deprecated, Changed, and Removed entries, verify the entry includes
migration guidance telling users what replaces the old behavior.
chat:
auto_reply: true
issue_enrichment:
auto_enrich:
enabled: false
================================================
FILE: .gitattributes
================================================
*.jpg !text !filter !merge !diff
CHANGELOG.md merge=union
================================================
FILE: .github/ISSUE_TEMPLATE/1-bug-report.yml
================================================
name: Bug Report
description: Create a report to help us improve Newton.
title: "[BUG] "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
attributes:
label: Bug Description
description: >-
Describe the bug. What happened, and what did you expect to happen?
validations:
required: true
- type: textarea
attributes:
label: Reproduction Script
description: >-
If possible, provide a minimal script or code snippet that reproduces
the issue.
render: python
validations:
required: false
- type: textarea
attributes:
label: System Information
description: >-
Newton version, Warp version, Python version, OS, and GPU (if
relevant).
placeholder: |
- Newton: 0.x.x
- Warp: 1.x.x
- Python: 3.x
- OS: Ubuntu 22.04 / Windows 11 / macOS 14
- GPU: NVIDIA RTX ...
validations:
required: false
================================================
FILE: .github/ISSUE_TEMPLATE/2-feature-request.yml
================================================
name: Feature Request
description: Suggest an idea for Newton.
title: "[REQ] "
labels: ["feature request"]
body:
- type: textarea
attributes:
label: Description
description: >-
Describe the feature you'd like added or changed.
validations:
required: true
- type: textarea
attributes:
label: Motivation / Use Case
description: >-
Why would this be useful? What problem does it solve?
validations:
required: true
- type: textarea
attributes:
label: Alternatives Considered
description: >-
Have you considered any alternative approaches or workarounds?
validations:
required: false
================================================
FILE: .github/ISSUE_TEMPLATE/3-documentation.yml
================================================
name: Documentation
description: Report an error or suggest improvements for the documentation.
title: "[DOCS] "
labels: ["docs"]
body:
- type: dropdown
attributes:
label: Category
description: What kind of documentation issue is this?
options:
- Error in existing documentation
- Missing documentation
- Improvement suggestion
validations:
required: true
- type: textarea
attributes:
label: Description
description: >-
Describe the issue. Include links to the relevant documentation pages
if applicable.
validations:
required: true
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: true
contact_links:
- name: Question
url: https://github.com/newton-physics/newton/discussions
about: Ask questions about Newton in GitHub Discussions.
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
## Description
<!-- What does this PR change and why?
Reference any issues closed by this PR with "Closes #1234". -->
## Checklist
- [ ] New or existing tests cover these changes
- [ ] The documentation is up to date with these changes
- [ ] `CHANGELOG.md` has been updated (if user-facing change)
## Test plan
<!-- How were these changes verified? Include commands, test names,
or manual steps. Example:
```
uv run --extra dev -m newton.tests -k test_relevant_test
``` -->
## Bug fix
<!-- DELETE this section if not a bug fix.
Describe how to reproduce the issue WITHOUT this PR applied. -->
**Steps to reproduce:**
<!-- 1. Step one
2. Step two
3. Observe incorrect behavior -->
**Minimal reproduction:**
```python
import newton
# Code that demonstrates the bug
```
## New feature / API change
<!-- DELETE this section if not applicable.
Provide a code example showing what this PR enables. -->
```python
import newton
# Code that demonstrates the new capability
```
================================================
FILE: .github/codecov.yml
================================================
coverage:
status:
project: off
patch: off
comment:
layout: "diff, flags, files"
fixes:
- "/var/snap/amazon-ssm-agent/[0-9]+/::"
================================================
FILE: .github/workflows/aws_gpu_benchmarks.yml
================================================
name: GPU Benchmarks on AWS EC2 (Reusable)
# This is a reusable workflow that uses machulav/ec2-github-runner to run GPU benchmarks.
# Called by:
# - pr_target_aws_gpu.yml (for pull requests)
# Workflow configuration variables
env:
AWS_REGION: us-east-2
AWS_INSTANCE_TYPE: g7e.2xlarge
AWS_VOLUME_SIZE: 92
AWS_VOLUME_TYPE: gp3
AWS_SECURITY_GROUP_IDS: sg-07807c44e7f2a368a
AWS_ROLE_ARN: arn:aws:iam::968945269301:role/newton-physics-newton-ec2-github-runner-role
AWS_ROLE_DURATION: 7200
HOME: /actions-runner
on:
workflow_call:
inputs:
ref:
description: 'Git ref to checkout'
required: true
type: string
default: ''
base_ref:
description: 'Base ref to compare against (for ASV)'
required: true
type: string
default: ''
secrets:
GH_PERSONAL_ACCESS_TOKEN:
required: true
jobs:
start-runner:
name: Start self-hosted EC2 runner
if: github.repository == 'newton-physics/newton'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.AWS_ROLE_ARN }}
role-duration-seconds: ${{ env.AWS_ROLE_DURATION }}
- name: Get the latest AWS Deep Learning Base GPU AMI
run: |
echo "Finding the latest AWS Deep Learning Base GPU AMI..."
LATEST_AMI_ID=$(aws ec2 describe-images --region ${{ env.AWS_REGION }} \
--owners amazon \
--filters 'Name=name,Values=Deep Learning Base AMI with Single CUDA (Ubuntu 22.04) ????????' 'Name=state,Values=available' \
--query 'reverse(sort_by(Images, &CreationDate))[:1].ImageId' \
--output text)
if [[ -z "$LATEST_AMI_ID" ]]; then
echo "❌ No AMI ID found. Exiting."
exit 1
fi
echo "Latest AMI ID found: $LATEST_AMI_ID"
echo "LATEST_AMI_ID=$LATEST_AMI_ID" >> "$GITHUB_ENV"
- name: Start EC2 runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@a00f575a87f3a96ec6de9413d16eeb828a3cc0a8 # v2.5.2
with:
mode: start
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
ec2-instance-type: ${{ env.AWS_INSTANCE_TYPE }}
ec2-volume-size: ${{ env.AWS_VOLUME_SIZE }}
ec2-volume-type: ${{ env.AWS_VOLUME_TYPE }}
availability-zones-config: >
[
{"imageId": "${{ env.LATEST_AMI_ID }}", "subnetId": "subnet-051b9d2e71acf8047", "securityGroupId": "${{ env.AWS_SECURITY_GROUP_IDS }}"},
{"imageId": "${{ env.LATEST_AMI_ID }}", "subnetId": "subnet-0c98bd06abe8ee5eb", "securityGroupId": "${{ env.AWS_SECURITY_GROUP_IDS }}"}
]
pre-runner-script: |
if [ -d /opt/dlami/nvme ]; then
mkdir -p /opt/dlami/nvme/actions-runner/_work
mkdir -p /opt/dlami/nvme/actions-runner/.local
mkdir -p /opt/dlami/nvme/actions-runner/.cache
ln -s /opt/dlami/nvme/actions-runner/_work /actions-runner/_work
ln -s /opt/dlami/nvme/actions-runner/.local /actions-runner/.local
ln -s /opt/dlami/nvme/actions-runner/.cache /actions-runner/.cache
fi
aws-resource-tags: >
[
{"Key": "Name", "Value": "ec2-github-runner"},
{"Key": "created-by", "Value": "github-actions-newton-role"},
{"Key": "GitHub-Repository", "Value": "${{ github.repository }}"}
]
gpu-benchmarks:
name: Run GPU Benchmarks on AWS EC2
needs: start-runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev \
libgl1-mesa-dev libglu1-mesa-dev
# Clean up apt cache immediately after install
sudo apt-get clean
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
version: "0.11.0"
- name: Set up Python
run: uv python install
- name: Check disk space
run: df -h
- name: Set up ASV environment
run: uvx asv machine --yes
- name: Run Benchmarks
run: |
uvx --with virtualenv asv continuous \
--launch-method spawn \
--interleave-rounds \
--append-samples \
--no-only-changed \
-e -b Fast \
${{ inputs.base_ref }} \
${{ inputs.ref }}
continue-on-error: true
id: benchmark
- name: Show comparison on failure
if: steps.benchmark.outcome == 'failure'
run: |
uvx asv compare --split ${{ inputs.base_ref }} ${{ inputs.ref }}
exit 2
- name: Check disk space (post-benchmark)
if: always()
run: df -h
- name: Re-run instructions
if: failure()
run: |
# Create error annotations (appear at top of job summary)
echo "::error::DO NOT use 'Re-run failed jobs' - the EC2 runner no longer exists and your job will be queued forever."
echo "::error::USE 'Re-run all jobs' instead to start a fresh EC2 runner."
# Write to job summary (appears in Summary tab)
cat >> "$GITHUB_STEP_SUMMARY" << 'EOF'
## ⚠️ How to Re-run This Workflow
This workflow uses **ephemeral EC2 runners** that are terminated after each run.
| | Option | Result |
|---|--------|--------|
| ❌ | **Re-run failed jobs** | Runner no longer exists → job queued forever |
| ✅ | **Re-run all jobs** | Starts new EC2 runner → benchmarks re-run |
EOF
# Also print to log for completeness
cat << 'EOF'
================================================================================
⚠️ IMPORTANT: HOW TO RE-RUN THIS WORKFLOW
================================================================================
This workflow uses ephemeral EC2 runners that are terminated after each run.
❌ DO NOT select "Re-run failed jobs"
→ The runner no longer exists and your job will be queued forever.
✅ DO select "Re-run all jobs"
→ This will start a new EC2 runner and re-run the benchmarks.
================================================================================
EOF
stop-runner:
name: Stop self-hosted EC2 runner
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
needs:
- start-runner
- gpu-benchmarks
if: always() && github.repository == 'newton-physics/newton'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.AWS_ROLE_ARN }}
role-duration-seconds: ${{ env.AWS_ROLE_DURATION }}
- name: Stop EC2 runner
uses: machulav/ec2-github-runner@a00f575a87f3a96ec6de9413d16eeb828a3cc0a8 # v2.5.2
with:
mode: stop
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
================================================
FILE: .github/workflows/aws_gpu_tests.yml
================================================
name: GPU Unit Tests on AWS EC2 (Reusable)
# This is a reusable workflow that uses machulav/ec2-github-runner to run GPU tests.
# Called by:
# - pr_target_aws_gpu_tests.yml (for pull requests)
# - merge_queue_aws_gpu.yml (for merge groups)
# - push_aws_gpu.yml (for pushes to main/release branches)
# - scheduled_nightly.yml (for nightly multi-GPU tests)
# Workflow configuration variables
env:
AWS_REGION: us-east-2
AWS_INSTANCE_TYPE: ${{ inputs.instance-type || 'g7e.2xlarge' }}
AWS_VOLUME_SIZE: ${{ inputs.volume-size || '92' }}
AWS_VOLUME_TYPE: gp3
AWS_SECURITY_GROUP_IDS: sg-07807c44e7f2a368a
AWS_ROLE_ARN: arn:aws:iam::968945269301:role/newton-physics-newton-ec2-github-runner-role
AWS_ROLE_DURATION: 7200
HOME: /actions-runner
on:
workflow_call:
inputs:
ref:
description: 'Git ref to checkout'
required: false
type: string
default: ''
instance-type:
description: 'EC2 instance type'
required: false
type: string
default: 'g7e.2xlarge'
volume-size:
description: 'EBS volume size in GB'
required: false
type: string
default: '92'
secrets:
GH_PERSONAL_ACCESS_TOKEN:
required: true
CODECOV_TOKEN:
required: true
workflow_dispatch:
inputs:
instance-type:
description: 'EC2 instance type'
required: false
type: string
default: 'g7e.2xlarge'
jobs:
start-runner:
name: Start self-hosted EC2 runner
if: github.repository == 'newton-physics/newton'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.AWS_ROLE_ARN }}
role-duration-seconds: ${{ env.AWS_ROLE_DURATION }}
- name: Get the latest AWS Deep Learning Base GPU AMI
run: |
echo "Finding the latest AWS Deep Learning Base GPU AMI..."
LATEST_AMI_ID=$(aws ec2 describe-images --region ${{ env.AWS_REGION }} \
--owners amazon \
--filters 'Name=name,Values=Deep Learning Base AMI with Single CUDA (Ubuntu 22.04) ????????' 'Name=state,Values=available' \
--query 'reverse(sort_by(Images, &CreationDate))[:1].ImageId' \
--output text)
if [[ -z "$LATEST_AMI_ID" ]]; then
echo "❌ No AMI ID found. Exiting."
exit 1
fi
echo "Latest AMI ID found: $LATEST_AMI_ID"
echo "LATEST_AMI_ID=$LATEST_AMI_ID" >> "$GITHUB_ENV"
- name: Start EC2 runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@a00f575a87f3a96ec6de9413d16eeb828a3cc0a8 # v2.5.2
with:
mode: start
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
ec2-instance-type: ${{ env.AWS_INSTANCE_TYPE }}
ec2-volume-size: ${{ env.AWS_VOLUME_SIZE }}
ec2-volume-type: ${{ env.AWS_VOLUME_TYPE }}
availability-zones-config: >
[
{"imageId": "${{ env.LATEST_AMI_ID }}", "subnetId": "subnet-051b9d2e71acf8047", "securityGroupId": "${{ env.AWS_SECURITY_GROUP_IDS }}"},
{"imageId": "${{ env.LATEST_AMI_ID }}", "subnetId": "subnet-0c98bd06abe8ee5eb", "securityGroupId": "${{ env.AWS_SECURITY_GROUP_IDS }}"}
]
pre-runner-script: |
if [ -d /opt/dlami/nvme ]; then
mkdir -p /opt/dlami/nvme/actions-runner/_work
mkdir -p /opt/dlami/nvme/actions-runner/.local
mkdir -p /opt/dlami/nvme/actions-runner/.cache
ln -s /opt/dlami/nvme/actions-runner/_work /actions-runner/_work
ln -s /opt/dlami/nvme/actions-runner/.local /actions-runner/.local
ln -s /opt/dlami/nvme/actions-runner/.cache /actions-runner/.cache
fi
aws-resource-tags: >
[
{"Key": "Name", "Value": "ec2-github-runner"},
{"Key": "created-by", "Value": "github-actions-newton-role"},
{"Key": "GitHub-Repository", "Value": "${{ github.repository }}"}
]
gpu-unit-tests:
name: Run GPU Unit Tests on AWS EC2
needs: start-runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner
permissions:
contents: read
env:
PYTHONFAULTHANDLER: "1" # Dump tracebacks on fatal signals (SIGSEGV, SIGABRT, etc.)
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ inputs.ref || github.sha }}
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
version: "0.11.0"
- name: Set up Python
run: uv python install
- name: Restore Warp kernel cache
if: github.event_name != 'merge_group'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: /actions-runner/.cache/warp
key: warp-kernels-gpu-${{ hashFiles('uv.lock', 'newton/**/*.py') }}
restore-keys: |
warp-kernels-gpu-
- name: Check disk space
run: df -h
- name: Run Tests
run: uv run --extra dev --extra torch-cu13 -m newton.tests --no-cache-clear --junit-report-xml rspec.xml --coverage --coverage-xml coverage.xml
- name: Check disk space (post-test)
if: always()
run: df -h
- name: Test Summary
if: ${{ !cancelled() }}
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
with:
paths: "rspec.xml"
show: "fail"
- name: Upload coverage reports to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
with:
disable_search: true
env_vars: AWS_INSTANCE_TYPE
files: ./coverage.xml
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
- name: Re-run instructions
if: failure()
run: |
# Create error annotations (appear at top of job summary)
echo "::error::DO NOT use 'Re-run failed jobs' - the EC2 runner no longer exists and your job will be queued forever."
echo "::error::USE 'Re-run all jobs' instead to start a fresh EC2 runner."
# Write to job summary (appears in Summary tab)
cat >> "$GITHUB_STEP_SUMMARY" << 'EOF'
## ⚠️ How to Re-run This Workflow
This workflow uses **ephemeral EC2 runners** that are terminated after each run.
| | Option | Result |
|---|--------|--------|
| ❌ | **Re-run failed jobs** | Runner no longer exists → job queued forever |
| ✅ | **Re-run all jobs** | Starts new EC2 runner → tests re-run |
EOF
# Also print to log for completeness
cat << 'EOF'
================================================================================
⚠️ IMPORTANT: HOW TO RE-RUN THIS WORKFLOW
================================================================================
This workflow uses ephemeral EC2 runners that are terminated after each run.
❌ DO NOT select "Re-run failed jobs"
→ The runner no longer exists and your job will be queued forever.
✅ DO select "Re-run all jobs"
→ This will start a new EC2 runner and re-run the tests.
================================================================================
EOF
stop-runner:
name: Stop self-hosted EC2 runner
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
needs:
- start-runner
- gpu-unit-tests
if: always() && needs.start-runner.result != 'skipped' && github.repository == 'newton-physics/newton'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.AWS_ROLE_ARN }}
role-duration-seconds: ${{ env.AWS_ROLE_DURATION }}
- name: Stop EC2 runner
uses: machulav/ec2-github-runner@a00f575a87f3a96ec6de9413d16eeb828a3cc0a8 # v2.5.2
with:
mode: stop
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
================================================
FILE: .github/workflows/ci.yml
================================================
name: CI
permissions:
contents: read
env:
PYTHONFAULTHANDLER: "1" # Dump tracebacks on fatal signals (SIGSEGV, SIGABRT, etc.)
on:
workflow_call:
workflow_dispatch:
push:
tags:
- v*
branches:
- main
- release-*
jobs:
minimal-import-test:
if: github.event_name != 'push' || github.repository == 'newton-physics/newton'
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: block
allowed-endpoints: >
download.pytorch.org:443
files.pythonhosted.org:443
github.com:443
pypi.nvidia.com:443
pypi.org:443
raw.githubusercontent.com:443
release-assets.githubusercontent.com:443
releases.astral.sh:443
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
version: "0.11.0"
- name: Test minimal import (Python 3.10)
run: uv run --python 3.10 python -c "import newton; print(f'Newton {newton.__version__} imported successfully')"
- name: Test minimal import (Python 3.11)
run: uv run --python 3.11 python -c "import newton; print(f'Newton {newton.__version__} imported successfully')"
- name: Test minimal import (Python 3.12)
run: uv run --python 3.12 python -c "import newton; print(f'Newton {newton.__version__} imported successfully')"
- name: Test minimal import (Python 3.13)
run: uv run --python 3.13 python -c "import newton; print(f'Newton {newton.__version__} imported successfully')"
- name: Test minimal import (Python 3.14)
run: uv run --python 3.14 python -c "import newton; print(f'Newton {newton.__version__} imported successfully')"
dependency-install-test:
needs: minimal-import-test
strategy:
fail-fast: false
matrix:
os:
[
ubuntu-latest,
ubuntu-24.04-arm,
windows-latest,
macos-latest,
]
runs-on: ${{ matrix.os }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
version: "0.11.0"
- name: Test dependency resolution (Python 3.10)
run: uv sync --dry-run --python 3.10 --extra dev
- name: Test dependency resolution (Python 3.11)
run: uv sync --dry-run --python 3.11 --extra dev
- name: Test dependency resolution (Python 3.12)
run: uv sync --dry-run --python 3.12 --extra dev
- name: Test dependency resolution (Python 3.13)
run: uv sync --dry-run --python 3.13 --extra dev
newton-unittests:
needs: dependency-install-test
strategy:
fail-fast: false
matrix:
os:
[
ubuntu-latest,
ubuntu-24.04-arm,
windows-latest,
macos-latest,
]
runs-on: ${{ matrix.os }}
env:
OS: ${{ matrix.os }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install system dependencies (Ubuntu ARM)
if: matrix.os == 'ubuntu-24.04-arm'
run: |
sudo apt-get update
sudo apt-get install -y libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
version: "0.11.0"
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version-file: ".python-version"
- name: Restore Warp kernel cache
if: github.event_name != 'merge_group'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: |
~/.cache/warp
~/Library/Caches/warp
~\AppData\Local\NVIDIA\warp\Cache
key: warp-kernels-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('uv.lock', 'newton/**/*.py') }}
restore-keys: |
warp-kernels-${{ runner.os }}-${{ runner.arch }}-
- name: Run Tests
run: uv run --extra dev -m newton.tests --no-cache-clear --junit-report-xml rspec.xml --coverage --coverage-xml coverage.xml
- name: Test Summary
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
with:
paths: "rspec.xml"
show: "fail"
if: always()
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
with:
files: ./rspec.xml
report_type: test_results
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
with:
disable_search: true
env_vars: OS
files: ./coverage.xml
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
================================================
FILE: .github/workflows/docs-dev.yml
================================================
name: Deploy dev documentation
on:
push:
branches:
- main
workflow_dispatch:
# Ensure only one deployment runs at a time
concurrency:
group: docs-deploy
cancel-in-progress: false
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0 # Need full history for gh-pages branch
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
version: "0.11.0"
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version-file: ".python-version"
- name: Install pandoc
uses: pandoc/actions/setup@86321b6dd4675f5014c611e05088e10d4939e09e # v1.1.1
- name: Build Sphinx documentation
run: uv run --extra docs --extra sim sphinx-build -j auto -b html docs docs/_build/html
env:
NEWTON_REQUIRE_PANDOC: "1"
- name: Deploy to gh-pages /latest/
run: |
set -e # Exit on any error
git config user.email "actions@github.com"
git config user.name "GitHub Actions"
# Save built docs and 404 template outside the repo before switching branches
mv docs/_build/html /tmp/docs-latest
cp docs/_static/gh-pages-404.html /tmp/gh-pages-404.html
# Switch to gh-pages branch (check existence first to avoid masking other fetch errors)
if git ls-remote --exit-code --heads origin gh-pages > /dev/null 2>&1; then
git fetch origin gh-pages:gh-pages
git checkout gh-pages
else
echo "Creating new gh-pages branch"
git checkout --orphan gh-pages
git rm -rf . || true
fi
# Remove old /latest/ and replace with new build
rm -rf latest
mv /tmp/docs-latest latest
# Deploy custom 404 page for redirecting old non-versioned URLs
cp /tmp/gh-pages-404.html 404.html
# Ensure .nojekyll exists
touch .nojekyll
# Check gh-pages size (warn if approaching GitHub Pages 1GB limit)
SIZE_KB=$(du -sk --exclude=.git . | cut -f1)
SIZE_MB=$((SIZE_KB / 1024))
echo "Current gh-pages size: ${SIZE_MB}MB"
if [ "$SIZE_MB" -gt 800 ]; then
echo "::warning::gh-pages branch is ${SIZE_MB}MB, approaching GitHub Pages 1GB limit. Consider pruning old versions."
fi
# Stage only the files we want deployed (avoid committing build artifacts
# like .venv/ that persist after switching branches)
git add latest 404.html .nojekyll
git diff --cached --quiet || git commit -m "Update dev docs from main@${GITHUB_SHA::8}"
git push origin gh-pages
================================================
FILE: .github/workflows/docs-release.yml
================================================
name: Deploy release documentation
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version to build (e.g., 1.0.0)'
required: true
type: string
# Ensure only one deployment runs at a time
concurrency:
group: docs-deploy
cancel-in-progress: false
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0 # Need full history for gh-pages branch
- name: Set version from tag or input
id: version
env:
EVENT_NAME: ${{ github.event_name }}
INPUT_VERSION: ${{ inputs.version }}
run: |
if [ "$EVENT_NAME" = "push" ]; then
VERSION="${GITHUB_REF#refs/tags/v}"
else
VERSION="$INPUT_VERSION"
fi
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
# Only deploy docs for stable releases (strict semver X.Y.Z)
# Pre-release tags (e.g., 1.0.0-rc.1, 1.0.0-beta) are skipped entirely
if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "SHOULD_DEPLOY=true" >> $GITHUB_OUTPUT
echo "Stable release detected: will deploy docs"
else
echo "SHOULD_DEPLOY=false" >> $GITHUB_OUTPUT
echo "Pre-release detected: skipping documentation deployment"
fi
- name: Install uv
if: steps.version.outputs.SHOULD_DEPLOY == 'true'
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
version: "0.11.0"
- name: Set up Python
if: steps.version.outputs.SHOULD_DEPLOY == 'true'
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version-file: ".python-version"
- name: Install pandoc
if: steps.version.outputs.SHOULD_DEPLOY == 'true'
uses: pandoc/actions/setup@86321b6dd4675f5014c611e05088e10d4939e09e # v1.1.1
- name: Build Sphinx documentation
if: steps.version.outputs.SHOULD_DEPLOY == 'true'
run: uv run --extra docs --extra sim sphinx-build -j auto -b html docs docs/_build/html
env:
NEWTON_REQUIRE_PANDOC: "1"
- name: Deploy to gh-pages
if: steps.version.outputs.SHOULD_DEPLOY == 'true'
env:
VERSION: ${{ steps.version.outputs.VERSION }}
run: |
set -e # Exit on any error
git config user.email "actions@github.com"
git config user.name "GitHub Actions"
# Save built docs and 404 template outside the repo before switching branches
mv docs/_build/html /tmp/docs-release
cp docs/_static/gh-pages-404.html /tmp/gh-pages-404.html
# Switch to gh-pages branch (check existence first to avoid masking other fetch errors)
if git ls-remote --exit-code --heads origin gh-pages > /dev/null 2>&1; then
git fetch origin gh-pages:gh-pages
git checkout gh-pages
else
echo "Creating new gh-pages branch"
git checkout --orphan gh-pages
git rm -rf . || true
fi
# Deploy version directory (remove old if rebuilding)
rm -rf "$VERSION"
mv /tmp/docs-release "$VERSION"
# Update stable/ directory (copy, not symlink - symlinks unreliable on GH Pages)
rm -rf stable
cp -r "$VERSION" stable
# Update switcher.json (script is in the main branch, not gh-pages)
# Use origin/main because there's no local main branch on tag-triggered runs
git show origin/main:scripts/ci/update_docs_switcher.py > /tmp/update_docs_switcher.py
uv run --no-project /tmp/update_docs_switcher.py "$VERSION"
rm -f switcher.json.bak
# Ensure root index.html redirect exists
{
echo '<!DOCTYPE html>'
echo '<html>'
echo '<head>'
echo ' <meta charset="utf-8">'
echo ' <title>Redirecting to Newton Documentation</title>'
echo ' <meta http-equiv="refresh" content="0; url=stable/">'
echo ' <link rel="canonical" href="https://newton-physics.github.io/newton/stable/">'
echo '</head>'
echo '<body>'
echo ' <p>Redirecting to <a href="stable/">Newton Documentation</a>...</p>'
echo '</body>'
echo '</html>'
} > index.html
# Deploy custom 404 page for redirecting old non-versioned URLs
cp /tmp/gh-pages-404.html 404.html
# Ensure .nojekyll exists
touch .nojekyll
# Check gh-pages size (warn if approaching GitHub Pages 1GB limit)
SIZE_KB=$(du -sk --exclude=.git . | cut -f1)
SIZE_MB=$((SIZE_KB / 1024))
echo "Current gh-pages size: ${SIZE_MB}MB"
if [ "$SIZE_MB" -gt 800 ]; then
echo "::warning::gh-pages branch is ${SIZE_MB}MB, approaching GitHub Pages 1GB limit. Consider pruning old versions."
fi
# Stage only the files we want deployed (avoid committing build artifacts
# like .venv/ that persist after switching branches)
git add "$VERSION" stable switcher.json index.html 404.html .nojekyll
git diff --cached --quiet || git commit -m "Release v$VERSION documentation"
git push origin gh-pages
================================================
FILE: .github/workflows/merge_queue_aws_gpu.yml
================================================
name: Merge Queue - AWS GPU
on:
merge_group:
jobs:
run-tests:
name: Run GPU Tests
if: github.repository == 'newton-physics/newton'
uses: ./.github/workflows/aws_gpu_tests.yml
with:
ref: ${{ github.sha }}
secrets: inherit
permissions:
id-token: write # Required for AWS OIDC authentication in start-runner/stop-runner
contents: read # Required for checkout in all jobs
================================================
FILE: .github/workflows/minimum_deps_tests.yml
================================================
name: Minimum Dependency Version Tests on AWS EC2 (Reusable)
# Standalone workflow that tests Newton with the lowest compatible versions
# of direct PyPI dependencies (as specified by version floors in pyproject.toml).
# Dispatched by scheduled_nightly.yml via the workflow_dispatch API.
env:
AWS_REGION: us-east-2
AWS_INSTANCE_TYPE: g7e.2xlarge
AWS_VOLUME_SIZE: 92
AWS_VOLUME_TYPE: gp3
AWS_SECURITY_GROUP_IDS: sg-07807c44e7f2a368a
AWS_ROLE_ARN: arn:aws:iam::968945269301:role/newton-physics-newton-ec2-github-runner-role
AWS_ROLE_DURATION: 3600
HOME: /actions-runner
on:
workflow_call:
secrets:
GH_PERSONAL_ACCESS_TOKEN:
required: true
CODECOV_TOKEN:
required: true
workflow_dispatch:
jobs:
start-runner:
name: Start self-hosted EC2 runner
if: github.repository == 'newton-physics/newton'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.AWS_ROLE_ARN }}
role-duration-seconds: ${{ env.AWS_ROLE_DURATION }}
- name: Get the latest AWS Deep Learning Base GPU AMI
run: |
echo "Finding the latest AWS Deep Learning Base GPU AMI..."
LATEST_AMI_ID=$(aws ec2 describe-images --region ${{ env.AWS_REGION }} \
--owners amazon \
--filters 'Name=name,Values=Deep Learning Base AMI with Single CUDA (Ubuntu 22.04) ????????' 'Name=state,Values=available' \
--query 'reverse(sort_by(Images, &CreationDate))[:1].ImageId' \
--output text)
if [[ -z "$LATEST_AMI_ID" ]]; then
echo "❌ No AMI ID found. Exiting."
exit 1
fi
echo "Latest AMI ID found: $LATEST_AMI_ID"
echo "LATEST_AMI_ID=$LATEST_AMI_ID" >> "$GITHUB_ENV"
- name: Start EC2 runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@a00f575a87f3a96ec6de9413d16eeb828a3cc0a8 # v2.5.2
with:
mode: start
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
ec2-instance-type: ${{ env.AWS_INSTANCE_TYPE }}
ec2-volume-size: ${{ env.AWS_VOLUME_SIZE }}
ec2-volume-type: ${{ env.AWS_VOLUME_TYPE }}
availability-zones-config: >
[
{"imageId": "${{ env.LATEST_AMI_ID }}", "subnetId": "subnet-051b9d2e71acf8047", "securityGroupId": "${{ env.AWS_SECURITY_GROUP_IDS }}"},
{"imageId": "${{ env.LATEST_AMI_ID }}", "subnetId": "subnet-0c98bd06abe8ee5eb", "securityGroupId": "${{ env.AWS_SECURITY_GROUP_IDS }}"}
]
pre-runner-script: |
if [ -d /opt/dlami/nvme ]; then
mkdir -p /opt/dlami/nvme/actions-runner/_work
mkdir -p /opt/dlami/nvme/actions-runner/.local
mkdir -p /opt/dlami/nvme/actions-runner/.cache
ln -s /opt/dlami/nvme/actions-runner/_work /actions-runner/_work
ln -s /opt/dlami/nvme/actions-runner/.local /actions-runner/.local
ln -s /opt/dlami/nvme/actions-runner/.cache /actions-runner/.cache
fi
aws-resource-tags: >
[
{"Key": "Name", "Value": "ec2-github-runner"},
{"Key": "created-by", "Value": "github-actions-newton-role"},
{"Key": "GitHub-Repository", "Value": "${{ github.repository }}"}
]
minimum-deps-tests:
name: Run Tests with Minimum Dependency Versions
needs: start-runner
if: ${{ !cancelled() && needs.start-runner.result == 'success' }}
runs-on: ${{ needs.start-runner.outputs.label }}
timeout-minutes: 60
permissions:
contents: read
env:
PYTHONFAULTHANDLER: "1"
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
version: "0.11.0"
- name: Set up Python
run: uv python install
- name: Resolve minimum dependency versions
run: |
uv lock --resolution lowest-direct
echo "Resolved dependency versions:"
uv tree --depth 1
- name: Run Tests
run: uv run --extra dev -m newton.tests --junit-report-xml rspec.xml
- name: Test Summary
if: ${{ !cancelled() }}
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
with:
paths: "rspec.xml"
show: "fail"
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
continue-on-error: true
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
with:
disable_search: true
files: ./rspec.xml
flags: minimum-deps-nightly
report_type: test_results
token: ${{ secrets.CODECOV_TOKEN }}
- name: Re-run instructions
if: failure()
run: |
echo "::error::DO NOT use 'Re-run failed jobs' - the EC2 runner no longer exists and your job will be queued forever."
echo "::error::USE 'Re-run all jobs' instead to start a fresh EC2 runner."
cat >> "$GITHUB_STEP_SUMMARY" << 'EOF'
## ⚠️ How to Re-run This Workflow
This workflow uses **ephemeral EC2 runners** that are terminated after each run.
| | Option | Result |
|---|--------|--------|
| ❌ | **Re-run failed jobs** | Runner no longer exists → job queued forever |
| ✅ | **Re-run all jobs** | Starts new EC2 runner → tests re-run |
EOF
stop-runner:
name: Stop self-hosted EC2 runner
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
needs:
- start-runner
- minimum-deps-tests
if: always() && needs.start-runner.result != 'skipped' && github.repository == 'newton-physics/newton'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.AWS_ROLE_ARN }}
role-duration-seconds: ${{ env.AWS_ROLE_DURATION }}
- name: Stop EC2 runner
uses: machulav/ec2-github-runner@a00f575a87f3a96ec6de9413d16eeb828a3cc0a8 # v2.5.2
with:
mode: stop
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
================================================
FILE: .github/workflows/mujoco_warp_tests.yml
================================================
name: MuJoCo Warp Tests on AWS EC2 (Reusable)
# Standalone workflow that tests Newton with the latest mujoco-warp from source.
# Not currently dispatched by scheduled_nightly.yml; kept available for manual dispatch/reuse.
env:
AWS_REGION: us-east-2
AWS_INSTANCE_TYPE: g7e.2xlarge
AWS_VOLUME_SIZE: 92
AWS_VOLUME_TYPE: gp3
AWS_SECURITY_GROUP_IDS: sg-07807c44e7f2a368a
AWS_ROLE_ARN: arn:aws:iam::968945269301:role/newton-physics-newton-ec2-github-runner-role
AWS_ROLE_DURATION: 3600
HOME: /actions-runner
on:
workflow_call:
secrets:
GH_PERSONAL_ACCESS_TOKEN:
required: true
CODECOV_TOKEN:
required: true
workflow_dispatch:
jobs:
start-runner:
name: Start self-hosted EC2 runner
if: github.repository == 'newton-physics/newton'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.AWS_ROLE_ARN }}
role-duration-seconds: ${{ env.AWS_ROLE_DURATION }}
- name: Get the latest AWS Deep Learning Base GPU AMI
run: |
echo "Finding the latest AWS Deep Learning Base GPU AMI..."
LATEST_AMI_ID=$(aws ec2 describe-images --region ${{ env.AWS_REGION }} \
--owners amazon \
--filters 'Name=name,Values=Deep Learning Base AMI with Single CUDA (Ubuntu 22.04) ????????' 'Name=state,Values=available' \
--query 'reverse(sort_by(Images, &CreationDate))[:1].ImageId' \
--output text)
if [[ -z "$LATEST_AMI_ID" ]]; then
echo "❌ No AMI ID found. Exiting."
exit 1
fi
echo "Latest AMI ID found: $LATEST_AMI_ID"
echo "LATEST_AMI_ID=$LATEST_AMI_ID" >> "$GITHUB_ENV"
- name: Start EC2 runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@a00f575a87f3a96ec6de9413d16eeb828a3cc0a8 # v2.5.2
with:
mode: start
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
ec2-instance-type: ${{ env.AWS_INSTANCE_TYPE }}
ec2-volume-size: ${{ env.AWS_VOLUME_SIZE }}
ec2-volume-type: ${{ env.AWS_VOLUME_TYPE }}
availability-zones-config: >
[
{"imageId": "${{ env.LATEST_AMI_ID }}", "subnetId": "subnet-051b9d2e71acf8047", "securityGroupId": "${{ env.AWS_SECURITY_GROUP_IDS }}"},
{"imageId": "${{ env.LATEST_AMI_ID }}", "subnetId": "subnet-0c98bd06abe8ee5eb", "securityGroupId": "${{ env.AWS_SECURITY_GROUP_IDS }}"}
]
pre-runner-script: |
if [ -d /opt/dlami/nvme ]; then
mkdir -p /opt/dlami/nvme/actions-runner/_work
mkdir -p /opt/dlami/nvme/actions-runner/.local
mkdir -p /opt/dlami/nvme/actions-runner/.cache
ln -s /opt/dlami/nvme/actions-runner/_work /actions-runner/_work
ln -s /opt/dlami/nvme/actions-runner/.local /actions-runner/.local
ln -s /opt/dlami/nvme/actions-runner/.cache /actions-runner/.cache
fi
aws-resource-tags: >
[
{"Key": "Name", "Value": "ec2-github-runner"},
{"Key": "created-by", "Value": "github-actions-newton-role"},
{"Key": "GitHub-Repository", "Value": "${{ github.repository }}"}
]
mujoco-warp-tests:
name: Run Tests with MuJoCo Warp from Source
needs: start-runner
if: ${{ !cancelled() && needs.start-runner.result == 'success' }}
runs-on: ${{ needs.start-runner.outputs.label }}
timeout-minutes: 60
permissions:
contents: read
env:
PYTHONFAULTHANDLER: "1"
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
version: "0.11.0"
- name: Set up Python
run: uv python install
- name: Install Newton and override mujoco-warp with source build
run: |
uv sync --extra dev --extra torch-cu13
uv pip install --reinstall-package mujoco-warp "mujoco-warp @ git+https://github.com/google-deepmind/mujoco_warp.git"
- name: Print mujoco-warp version info
run: uv run --no-sync python -c "import mujoco_warp; print('mujoco_warp version:', getattr(mujoco_warp, '__version__', 'unknown'))"
- name: Check disk space
run: df -h
- name: Run Tests
run: uv run --no-sync -m newton.tests --junit-report-xml rspec.xml
- name: Check disk space (post-test)
if: always()
run: df -h
- name: Test Summary
if: ${{ !cancelled() }}
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
with:
paths: "rspec.xml"
show: "fail"
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
continue-on-error: true
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
with:
disable_search: true
files: ./rspec.xml
flags: mujoco-warp-nightly
report_type: test_results
token: ${{ secrets.CODECOV_TOKEN }}
- name: Re-run instructions
if: failure()
run: |
echo "::error::DO NOT use 'Re-run failed jobs' - the EC2 runner no longer exists and your job will be queued forever."
echo "::error::USE 'Re-run all jobs' instead to start a fresh EC2 runner."
cat >> "$GITHUB_STEP_SUMMARY" << 'EOF'
## ⚠️ How to Re-run This Workflow
This workflow uses **ephemeral EC2 runners** that are terminated after each run.
| | Option | Result |
|---|--------|--------|
| ❌ | **Re-run failed jobs** | Runner no longer exists → job queued forever |
| ✅ | **Re-run all jobs** | Starts new EC2 runner → tests re-run |
EOF
stop-runner:
name: Stop self-hosted EC2 runner
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
needs:
- start-runner
- mujoco-warp-tests
if: always() && needs.start-runner.result != 'skipped' && github.repository == 'newton-physics/newton'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.AWS_ROLE_ARN }}
role-duration-seconds: ${{ env.AWS_ROLE_DURATION }}
- name: Stop EC2 runner
uses: machulav/ec2-github-runner@a00f575a87f3a96ec6de9413d16eeb828a3cc0a8 # v2.5.2
with:
mode: stop
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
================================================
FILE: .github/workflows/pr.yml
================================================
name: Pull Request
permissions:
contents: read
on:
merge_group:
pull_request:
branches:
- main
- "release-*"
concurrency:
group: ${{ github.workflow }}-on-${{ github.event_name }}-from-${{ github.ref_name }}
cancel-in-progress: true
jobs:
check-lockfile:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: block
allowed-endpoints: >
download.pytorch.org:443
files.pythonhosted.org:443
github.com:443
pypi.nvidia.com:443
pypi.org:443
raw.githubusercontent.com:443
release-assets.githubusercontent.com:443
releases.astral.sh:443
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
version: "0.11.0"
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version-file: ".python-version"
- name: Check uv lockfile
run: uv lock --check
run-newton-tests:
uses: ./.github/workflows/ci.yml
secrets: inherit
pull-request-docs:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
version: "0.11.0"
- name: "Set up Python"
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version-file: ".python-version"
- name: Install pandoc
uses: pandoc/actions/setup@86321b6dd4675f5014c611e05088e10d4939e09e # v1.1.1
- name: Build Sphinx documentation
run: uv run --extra docs --extra sim sphinx-build -j auto -W -b html docs docs/_build/html
env:
NEWTON_REQUIRE_PANDOC: "1"
- name: Verify API docs are up-to-date
run: |
git diff --exit-code docs/api/ || {
echo "::error::API docs are stale. Run 'python docs/generate_api.py' and commit the changes."
exit 1
}
- name: Run Sphinx doctests
run: uv run --extra docs --extra sim sphinx-build -j auto -W -b doctest docs docs/_build/doctest
================================================
FILE: .github/workflows/pr_closed.yml
================================================
name: Cancel workflows on PR close
on:
pull_request_target:
types: [closed]
jobs:
cancel-pr-workflows:
name: Cancel in-progress PR workflows
runs-on: ubuntu-latest
permissions:
actions: write
timeout-minutes: 3
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Cancel in-progress runs for this PR
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
HEAD_BRANCH: ${{ github.event.pull_request.head.ref }}
PR_NUMBER: ${{ github.event.pull_request.number }}
CURRENT_RUN: ${{ github.run_id }}
run: |
echo "PR #$PR_NUMBER closed, cancelling workflows for branch: $HEAD_BRANCH"
# Cancel all in-progress and queued runs on this PR's head branch (except this one)
for status in in_progress queued; do
gh run list --branch "$HEAD_BRANCH" --status "$status" --json databaseId --jq '.[].databaseId' \
| while read -r run_id; do
if [ "$run_id" != "$CURRENT_RUN" ]; then
echo "Cancelling run $run_id"
if ! gh run cancel "$run_id"; then
echo "Warning: failed to cancel run $run_id" >&2
fi
fi
done
done
================================================
FILE: .github/workflows/pr_license_check.yml
================================================
name: License Check
permissions:
contents: read
pull-requests: read
on:
merge_group:
pull_request:
branches:
- main
- "release-*"
# Cancels in-progress runs of this workflow for the same pull request,
# but allows parallel runs for pushes to the main branch.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
check-licenses:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: block
allowed-endpoints: >
api.github.com:443
github.com:443
proxy.golang.org:443
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Check code license headers (Apache-2.0)
uses: apache/skywalking-eyes/header@61275cc80d0798a405cb070f7d3a8aaf7cf2c2c1 # v0.8.0
- name: Check docs license headers (CC-BY-4.0)
uses: apache/skywalking-eyes/header@61275cc80d0798a405cb070f7d3a8aaf7cf2c2c1 # v0.8.0
with:
config: .licenserc-docs.yaml
- name: Check notebook license headers (CC-BY-4.0)
run: |
status=0
for nb in $(find docs -name '*.ipynb' -not -path '*/.*' -not -path '*/_build/*'); do
if ! grep -q 'SPDX-License-Identifier: CC-BY-4.0' "$nb"; then
echo "ERROR: $nb missing CC-BY-4.0 SPDX header"
status=1
fi
done
exit $status
================================================
FILE: .github/workflows/pr_target_aws_gpu_benchmarks.yml
================================================
name: Pull Request - AWS GPU Benchmarks
on:
pull_request_target:
concurrency:
group: ${{ github.workflow }}-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
check-author-membership:
name: Check Author Membership
runs-on: ubuntu-latest
permissions: {}
outputs:
membership_status: ${{ steps.check_org.outputs.membership_status }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Check user's organization membership
id: check_org
run: |
ASSOCIATION="${{ github.event.pull_request.author_association }}"
echo "Author's association with the repository: ${ASSOCIATION}"
if [[ "${ASSOCIATION}" == "MEMBER" || "${ASSOCIATION}" == "OWNER" || "${ASSOCIATION}" == "COLLABORATOR" ]]; then
echo "Author is a recognized member, owner, or collaborator."
echo "membership_status=CONFIRMED_MEMBER" >> "$GITHUB_OUTPUT"
else
# Set the output for other jobs to use
echo "membership_status=NOT_MEMBER" >> "$GITHUB_OUTPUT"
# Print a message explaining the status and its impact on workflows.
echo "--------------------------------------------------------------------------------" >&2
echo "Thank you for your contribution!" >&2
echo "This is the expected status for community contributors. Certain automated" >&2
echo "workflows are reserved for verified organization members." >&2
echo "" >&2
echo "--------------------------------------------------------------------------------" >&2
echo "❓ Are you a member of the 'newton-physics' organization and believe this is an error?" >&2
echo "" >&2
echo "This can happen if your organization membership is set to 'Private'. To fix this," >&2
echo "please make your membership 'Public' to enable all workflow triggers:" >&2
echo "" >&2
echo "1. Go to the organization's People page: https://github.com/orgs/newton-physics/people" >&2
echo "2. Find your username in the list." >&2
echo "3. Click the dropdown next to your name and change your visibility from 'Private' to 'Public'." >&2
echo "" >&2
echo "After updating your visibility, push a new commit to this PR to re-run the check." >&2
echo "--------------------------------------------------------------------------------" >&2
# Surface warnings as visible annotations (yellow banners in job view)
echo "::warning::This PR requires manual approval before GPU benchmarks can run (author is not a recognized org member)."
echo "::warning::If you are a newton-physics org member with private membership, make it public at https://github.com/orgs/newton-physics/people"
# Write to job summary (appears in Summary tab)
cat >> "$GITHUB_STEP_SUMMARY" << 'EOF'
## ⚠️ Manual Approval Required
This PR was authored by an external contributor. GPU benchmarks require manual approval from a maintainer before they can run.
### Are you a newton-physics org member?
If your membership is set to **Private**, the workflow cannot detect it. To fix:
1. Go to [newton-physics People](https://github.com/orgs/newton-physics/people)
2. Find your username and change visibility from **Private** to **Public**
3. Push a new commit to re-trigger the check
EOF
fi
require-approval:
name: Require Manual Approval for External PRs
runs-on: ubuntu-latest
permissions:
deployments: write # Required for creating deployment record when using environment
needs: check-author-membership
if: needs.check-author-membership.outputs.membership_status != 'CONFIRMED_MEMBER'
environment:
name: external-pr-approval
url: ${{ github.event.pull_request.html_url }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Approval granted
run: echo "Manual approval granted for external PR"
run-gpu-benchmarks:
name: Run GPU Benchmarks
needs:
- check-author-membership
- require-approval
if: github.repository == 'newton-physics/newton' && (!cancelled())
uses: ./.github/workflows/aws_gpu_benchmarks.yml
with:
ref: ${{ github.event.pull_request.head.sha }}
base_ref: ${{ github.event.pull_request.base.sha }}
secrets: inherit
permissions:
id-token: write # Required for AWS OIDC authentication in start-runner/stop-runner
contents: read # Required for checkout in all jobs
================================================
FILE: .github/workflows/pr_target_aws_gpu_tests.yml
================================================
name: Pull Request - AWS GPU Tests
on:
pull_request_target:
concurrency:
group: ${{ github.workflow }}-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
check-author-membership:
name: Check Author Membership
runs-on: ubuntu-latest
permissions: {}
outputs:
membership_status: ${{ steps.check_org.outputs.membership_status }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Check user's organization membership
id: check_org
run: |
ASSOCIATION="${{ github.event.pull_request.author_association }}"
echo "Author's association with the repository: ${ASSOCIATION}"
if [[ "${ASSOCIATION}" == "MEMBER" || "${ASSOCIATION}" == "OWNER" || "${ASSOCIATION}" == "COLLABORATOR" ]]; then
echo "Author is a recognized member, owner, or collaborator."
echo "membership_status=CONFIRMED_MEMBER" >> "$GITHUB_OUTPUT"
else
# Set the output for other jobs to use
echo "membership_status=NOT_MEMBER" >> "$GITHUB_OUTPUT"
# Print a message explaining the status and its impact on workflows.
echo "--------------------------------------------------------------------------------" >&2
echo "Thank you for your contribution!" >&2
echo "This is the expected status for community contributors. Certain automated" >&2
echo "workflows are reserved for verified organization members." >&2
echo "" >&2
echo "--------------------------------------------------------------------------------" >&2
echo "❓ Are you a member of the 'newton-physics' organization and believe this is an error?" >&2
echo "" >&2
echo "This can happen if your organization membership is set to 'Private'. To fix this," >&2
echo "please make your membership 'Public' to enable all workflow triggers:" >&2
echo "" >&2
echo "1. Go to the organization's People page: https://github.com/orgs/newton-physics/people" >&2
echo "2. Find your username in the list." >&2
echo "3. Click the dropdown next to your name and change your visibility from 'Private' to 'Public'." >&2
echo "" >&2
echo "After updating your visibility, push a new commit to this PR to re-run the check." >&2
echo "--------------------------------------------------------------------------------" >&2
# Surface warnings as visible annotations (yellow banners in job view)
echo "::warning::This PR requires manual approval before GPU tests can run (author is not a recognized org member)."
echo "::warning::If you are a newton-physics org member with private membership, make it public at https://github.com/orgs/newton-physics/people"
# Write to job summary (appears in Summary tab)
cat >> "$GITHUB_STEP_SUMMARY" << 'EOF'
## ⚠️ Manual Approval Required
This PR was authored by an external contributor. GPU tests require manual approval from a maintainer before they can run.
### Are you a newton-physics org member?
If your membership is set to **Private**, the workflow cannot detect it. To fix:
1. Go to [newton-physics People](https://github.com/orgs/newton-physics/people)
2. Find your username and change visibility from **Private** to **Public**
3. Push a new commit to re-trigger the check
EOF
fi
require-approval:
name: Require Manual Approval for External PRs
runs-on: ubuntu-latest
permissions:
deployments: write # Required for creating deployment record when using environment
needs: check-author-membership
if: needs.check-author-membership.outputs.membership_status != 'CONFIRMED_MEMBER'
environment:
name: external-pr-approval
url: ${{ github.event.pull_request.html_url }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Approval granted
run: echo "Manual approval granted for external PR"
run-gpu-tests:
name: Run GPU Tests
needs:
- check-author-membership
- require-approval
if: github.repository == 'newton-physics/newton' && (!cancelled())
uses: ./.github/workflows/aws_gpu_tests.yml
with:
ref: ${{ github.event.pull_request.head.sha }}
secrets: inherit
permissions:
id-token: write # Required for AWS OIDC authentication in start-runner/stop-runner
contents: read # Required for checkout in all jobs
================================================
FILE: .github/workflows/push_aws_gpu.yml
================================================
name: Push - AWS GPU
# This workflow triggers GPU tests for pushes to main/release branches.
# It replaces the old push_aws_gpu_tests.yml workflow.
# Uses reusable workflows:
# - aws_gpu_tests.yml
on:
push:
paths-ignore:
- "docs/**"
- "**.md"
jobs:
run-tests:
if: github.repository == 'newton-physics/newton'
uses: ./.github/workflows/aws_gpu_tests.yml
secrets: inherit
permissions:
id-token: write # Required for AWS OIDC authentication in start-runner/stop-runner
contents: read # Required for checkout in all jobs
================================================
FILE: .github/workflows/release.yml
================================================
name: Release
# This workflow runs when a tag is pushed.
# The publish-to-pypi job requires manual approval via the 'pypi' environment protection rules
# configured in Settings > Environments > pypi.
on:
push:
tags:
- '*'
jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
permissions:
contents: read
actions: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
version: "0.11.0"
- name: Set up Python
run: uv python install
- name: Build a binary wheel
run: uv build --wheel
- name: Store the distribution packages
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: python-package-distributions
path: dist/
publish-to-pypi:
name: Publish Python distribution to PyPI
if: github.repository == 'newton-physics/newton'
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/newton
permissions:
id-token: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Download wheel and source tarball
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
create-github-release:
name: Create GitHub Release
if: github.repository == 'newton-physics/newton'
needs:
- build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Download wheel and source tarball
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: python-package-distributions
path: dist/
- name: Create GitHub Release
run: |
gh release create ${{ github.ref_name }} \
--draft \
--title "Release ${{ github.ref_name }}" \
dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
================================================
FILE: .github/workflows/scheduled_nightly.yml
================================================
name: Scheduled Nightly Tests
# Orchestrator that dispatches all nightly test suites sequentially.
# Each sub-workflow is triggered via the workflow_dispatch REST API and
# polled to completion before the next is started, ensuring only one
# EC2 instance is active at a time. Per-workflow history is preserved
# as separate workflow runs. One group's failure does not block
# subsequent groups.
on:
schedule:
- cron: '0 9 * * *' # Daily at 9 AM UTC (1 AM PST / 2 AM PDT)
workflow_dispatch:
jobs:
check-warp-update:
name: Check for new warp-lang nightly build
if: github.repository == 'newton-physics/newton'
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
warp-updated: ${{ steps.check-update.outputs.warp-updated }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
version: "0.11.0"
- name: Update warp-lang in lock file
run: uv lock -P warp-lang --prerelease allow
- name: Check if warp-lang version changed
id: check-update
run: |
if git diff --quiet uv.lock; then
echo "No new warp-lang nightly build detected"
echo "warp-updated=false" >> "$GITHUB_OUTPUT"
else
echo "New warp-lang nightly build detected!"
echo "warp-updated=true" >> "$GITHUB_OUTPUT"
echo "Current warp-lang dependency tree:"
uv tree --package warp-lang
fi
run-nightly-tests:
name: Run nightly test suites
needs: [check-warp-update]
if: ${{ !cancelled() && github.repository == 'newton-physics/newton' }}
runs-on: ubuntu-latest
timeout-minutes: 180 # Budget for sequential dispatch+poll of all sub-workflows (typical total ~90 min)
permissions:
actions: write
contents: read
outputs:
gpu-tests-conclusion: ${{ steps.gpu-tests.outputs.conclusion }}
gpu-tests-url: ${{ steps.gpu-tests.outputs.run-url }}
minimum-deps-tests-conclusion: ${{ steps.minimum-deps-tests.outputs.conclusion }}
minimum-deps-tests-url: ${{ steps.minimum-deps-tests.outputs.run-url }}
warp-nightly-tests-conclusion: ${{ steps.warp-nightly-tests.outputs.conclusion }}
warp-nightly-tests-url: ${{ steps.warp-nightly-tests.outputs.run-url }}
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
REF: ${{ github.ref }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
version: "0.11.0"
- name: Set up Python
run: uv python install
- name: Dispatch and wait for GPU tests
id: gpu-tests
run: uv run --no-project scripts/ci/dispatch_workflow_and_wait.py aws_gpu_tests.yml -f "inputs[instance-type]=g7e.12xlarge"
- name: Dispatch and wait for Minimum Deps tests
id: minimum-deps-tests
run: uv run --no-project scripts/ci/dispatch_workflow_and_wait.py minimum_deps_tests.yml
- name: Dispatch and wait for Warp Nightly tests
id: warp-nightly-tests
if: needs.check-warp-update.result == 'success' && needs.check-warp-update.outputs.warp-updated == 'true'
run: uv run --no-project scripts/ci/dispatch_workflow_and_wait.py warp_nightly_tests.yml
notify-on-failure:
name: Notify on failure
needs: [run-nightly-tests]
if: |
!cancelled() &&
((needs.run-nightly-tests.outputs.gpu-tests-conclusion != '' &&
needs.run-nightly-tests.outputs.gpu-tests-conclusion != 'success') ||
(needs.run-nightly-tests.outputs.minimum-deps-tests-conclusion != '' &&
needs.run-nightly-tests.outputs.minimum-deps-tests-conclusion != 'success') ||
(needs.run-nightly-tests.outputs.warp-nightly-tests-conclusion != '' &&
needs.run-nightly-tests.outputs.warp-nightly-tests-conclusion != 'success'))
runs-on: ubuntu-latest
permissions:
issues: write
contents: read
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: File or update GitHub issue
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
const suites = [
{
name: 'Multi-GPU tests',
workflow: 'aws_gpu_tests.yml',
conclusion: '${{ needs.run-nightly-tests.outputs.gpu-tests-conclusion }}',
url: '${{ needs.run-nightly-tests.outputs.gpu-tests-url }}'
},
{
name: 'Minimum deps tests',
workflow: 'minimum_deps_tests.yml',
conclusion: '${{ needs.run-nightly-tests.outputs.minimum-deps-tests-conclusion }}',
url: '${{ needs.run-nightly-tests.outputs.minimum-deps-tests-url }}'
},
{
name: 'Warp nightly tests',
workflow: 'warp_nightly_tests.yml',
conclusion: '${{ needs.run-nightly-tests.outputs.warp-nightly-tests-conclusion }}',
url: '${{ needs.run-nightly-tests.outputs.warp-nightly-tests-url }}'
}
];
// Fetch recent run history to show pass/fail trend in the issue table
// (default branch only, excludes cancelled runs)
async function getHistory(workflowFile) {
try {
const { data } = await github.rest.actions.listWorkflowRuns({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: workflowFile,
branch: context.payload.repository?.default_branch || 'main',
per_page: 10,
status: 'completed',
exclude_pull_requests: true
});
const runs = data.workflow_runs
.filter(r => r.conclusion !== 'cancelled')
.slice(0, 5);
return runs.map(r => r.conclusion === 'success' ? '✅' : '❌').join('');
} catch (error) {
core.warning(`Failed to fetch history for ${workflowFile}: ${error.message}`);
return '';
}
}
const failed = [];
const rows = [];
for (const suite of suites) {
const history = await getHistory(suite.workflow);
const recentCol = history || '—';
if (!suite.conclusion) {
rows.push(`| ${suite.name} | ${recentCol} | ⏭️ Skipped | |`);
} else if (suite.conclusion === 'success') {
rows.push(`| ${suite.name} | ${recentCol} | ✅ Passed | [View logs](${suite.url}) |`);
} else {
rows.push(`| ${suite.name} | ${recentCol} | ❌ Failed | [View logs](${suite.url}) |`);
failed.push(suite.name);
}
}
const labels = ['stability', 'testing'];
const orchestratorUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
const failedList = failed.join(', ');
const table = [
'| Test Suite | Recent | Status | Logs |',
'|---|---|---|---|',
...rows
].join('\n');
// Search for an existing open nightly failure issue to update
// instead of creating duplicates
const { data: candidates } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
labels: labels.join(','),
state: 'open',
per_page: 100
});
const existing = candidates.find(i => i.title.startsWith('Nightly failure'));
try {
// If an existing issue is found, add a comment; otherwise
// create a new one with today's date
if (existing) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: existing.number,
body: [
`@newton-physics/newton-ci-notify Nightly tests are still failing.`,
``,
table,
``,
`**Orchestrator run:** [View](${orchestratorUrl})`
].join('\n')
});
} else {
const date = new Date().toISOString().slice(0, 10);
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: `Nightly failure (${date}): ${failedList}`,
body: [
`@newton-physics/newton-ci-notify`,
``,
`The scheduled nightly workflow failed.`,
``,
table,
``,
`**Orchestrator run:** [View](${orchestratorUrl})`
].join('\n'),
labels: labels
});
}
} catch (error) {
core.error(`Failed to create/update notification issue: ${error.message}`);
core.error(`Test suites that failed: ${failedList}`);
throw error;
}
================================================
FILE: .github/workflows/warp_nightly_tests.yml
================================================
name: Warp Nightly Build Tests on AWS EC2 (Reusable)
# Standalone workflow that tests Newton with the latest nightly warp-lang builds.
# Called by scheduled_nightly.yml (only when a new warp-lang nightly is detected).
env:
AWS_REGION: us-east-2
AWS_INSTANCE_TYPE: g7e.2xlarge
AWS_VOLUME_SIZE: 92
AWS_VOLUME_TYPE: gp3
AWS_SECURITY_GROUP_IDS: sg-07807c44e7f2a368a
AWS_ROLE_ARN: arn:aws:iam::968945269301:role/newton-physics-newton-ec2-github-runner-role
AWS_ROLE_DURATION: 3600
HOME: /actions-runner
on:
workflow_call:
secrets:
GH_PERSONAL_ACCESS_TOKEN:
required: true
CODECOV_TOKEN:
required: true
workflow_dispatch:
jobs:
start-runner:
name: Start self-hosted EC2 runner
if: github.repository == 'newton-physics/newton'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.AWS_ROLE_ARN }}
role-duration-seconds: ${{ env.AWS_ROLE_DURATION }}
- name: Get the latest AWS Deep Learning Base GPU AMI
run: |
echo "Finding the latest AWS Deep Learning Base GPU AMI..."
LATEST_AMI_ID=$(aws ec2 describe-images --region ${{ env.AWS_REGION }} \
--owners amazon \
--filters 'Name=name,Values=Deep Learning Base AMI with Single CUDA (Ubuntu 22.04) ????????' 'Name=state,Values=available' \
--query 'reverse(sort_by(Images, &CreationDate))[:1].ImageId' \
--output text)
if [[ -z "$LATEST_AMI_ID" ]]; then
echo "❌ No AMI ID found. Exiting."
exit 1
fi
echo "Latest AMI ID found: $LATEST_AMI_ID"
echo "LATEST_AMI_ID=$LATEST_AMI_ID" >> "$GITHUB_ENV"
- name: Start EC2 runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@a00f575a87f3a96ec6de9413d16eeb828a3cc0a8 # v2.5.2
with:
mode: start
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
ec2-instance-type: ${{ env.AWS_INSTANCE_TYPE }}
ec2-volume-size: ${{ env.AWS_VOLUME_SIZE }}
ec2-volume-type: ${{ env.AWS_VOLUME_TYPE }}
availability-zones-config: >
[
{"imageId": "${{ env.LATEST_AMI_ID }}", "subnetId": "subnet-051b9d2e71acf8047", "securityGroupId": "${{ env.AWS_SECURITY_GROUP_IDS }}"},
{"imageId": "${{ env.LATEST_AMI_ID }}", "subnetId": "subnet-0c98bd06abe8ee5eb", "securityGroupId": "${{ env.AWS_SECURITY_GROUP_IDS }}"}
]
pre-runner-script: |
if [ -d /opt/dlami/nvme ]; then
mkdir -p /opt/dlami/nvme/actions-runner/_work
mkdir -p /opt/dlami/nvme/actions-runner/.local
mkdir -p /opt/dlami/nvme/actions-runner/.cache
ln -s /opt/dlami/nvme/actions-runner/_work /actions-runner/_work
ln -s /opt/dlami/nvme/actions-runner/.local /actions-runner/.local
ln -s /opt/dlami/nvme/actions-runner/.cache /actions-runner/.cache
fi
aws-resource-tags: >
[
{"Key": "Name", "Value": "ec2-github-runner"},
{"Key": "created-by", "Value": "github-actions-newton-role"},
{"Key": "GitHub-Repository", "Value": "${{ github.repository }}"}
]
warp-nightly-tests:
name: Run Tests with Warp Nightly Build
needs: start-runner
if: ${{ !cancelled() && needs.start-runner.result == 'success' }}
runs-on: ${{ needs.start-runner.outputs.label }}
timeout-minutes: 60
permissions:
contents: read
env:
PYTHONFAULTHANDLER: "1"
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
version: "0.11.0"
- name: Set up Python
run: uv python install
- name: Update lock file with latest warp-lang nightly build
run: uv lock -P warp-lang --prerelease allow
- name: Check disk space
run: df -h
- name: Run Tests
run: uv run --extra dev --extra torch-cu13 -m newton.tests --junit-report-xml rspec.xml
- name: Check disk space (post-test)
if: always()
run: df -h
- name: Test Summary
if: ${{ !cancelled() }}
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
with:
paths: "rspec.xml"
show: "fail"
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
continue-on-error: true
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
with:
disable_search: true
files: ./rspec.xml
flags: warp-nightly
report_type: test_results
token: ${{ secrets.CODECOV_TOKEN }}
- name: Re-run instructions
if: failure()
run: |
echo "::error::DO NOT use 'Re-run failed jobs' - the EC2 runner no longer exists and your job will be queued forever."
echo "::error::USE 'Re-run all jobs' instead to start a fresh EC2 runner."
cat >> "$GITHUB_STEP_SUMMARY" << 'EOF'
## ⚠️ How to Re-run This Workflow
This workflow uses **ephemeral EC2 runners** that are terminated after each run.
| | Option | Result |
|---|--------|--------|
| ❌ | **Re-run failed jobs** | Runner no longer exists → job queued forever |
| ✅ | **Re-run all jobs** | Starts new EC2 runner → tests re-run |
EOF
stop-runner:
name: Stop self-hosted EC2 runner
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
needs:
- start-runner
- warp-nightly-tests
if: always() && needs.start-runner.result != 'skipped' && github.repository == 'newton-physics/newton'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.AWS_ROLE_ARN }}
role-duration-seconds: ${{ env.AWS_ROLE_DURATION }}
- name: Stop EC2 runner
uses: machulav/ec2-github-runner@a00f575a87f3a96ec6de9413d16eeb828a3cc0a8 # v2.5.2
with:
mode: stop
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
================================================
FILE: .gitignore
================================================
# Python-generated files
__pycache__/
*.py[oc]
build/
dist/
wheels/
*.egg-info
# Virtual Environments
.venv
# Tool cache
.cache/
.thumbs/
# Coverage reports
.coverage
.coverage.*
coverage.xml
htmlcov/
# Test Reports
rspec.xml
# Type Checking
.mypy_cache/
# IDEs & Editors
.vscode
.history/
.idea
# Claude Code
.claude/settings.local.json
.claude/worktrees/
.mcp.json
# Claude Code sandbox artifacts (empty placeholder files created in repo root)
.bash_profile
.bashrc
.profile
.zprofile
.zshrc
.gitconfig
.gitmodules
.ripgreprc
/HEAD
/config
/hooks
/objects
/refs
# Documentation
docs/_build/
docs/api/_generated/
# Airspeed Velocity
asv/env
asv/results
asv/html
# Log files, settings
MUJOCO_LOG.TXT
imgui.ini
newton/tests/outputs/
# Viser recordings
docs/_static/recordings/
*.viser
# Viser static files
docs/_static/viser/
# Notebook checkpoints
**/*.ipynb_checkpoints/
================================================
FILE: .licenserc-docs.yaml
================================================
header:
license:
spdx-id: CC-BY-4.0
copyright-owner: The Newton Developers
content: |
SPDX-FileCopyrightText: Copyright (c) 2026 The Newton Developers
SPDX-License-Identifier: CC-BY-4.0
# Pattern is matched against lowercased text where "(c)" is normalized
# to the word "copyright", so "Copyright (c)" becomes "copyright copyright".
pattern: |
spdx-filecopyrighttext: copyright copyright \d{4} the newton developers
spdx-license-identifier: cc-by-4\.0
paths:
- "**/*.rst"
paths-ignore:
- "docs/api/_generated/**"
- "docs/_templates/**"
language:
reStructuredText:
extensions:
- ".rst"
comment_style_id: DoubleDot
comment: on-failure
================================================
FILE: .licenserc.yaml
================================================
header:
license:
spdx-id: Apache-2.0
copyright-owner: The Newton Developers
content: |
# SPDX-FileCopyrightText: Copyright (c) 2026 The Newton Developers
# SPDX-License-Identifier: Apache-2.0
# Pattern is matched against lowercased text where "(c)" is normalized
# to the word "copyright", so "Copyright (c)" becomes "copyright copyright".
pattern: |
spdx-filecopyrighttext: copyright copyright \d{4} the newton developers
spdx-license-identifier: apache-2\.0
paths:
- "**/*.py"
paths-ignore:
- "newton/_version.py"
- "asv/benchmarks/**/__init__.py"
- "newton/tests/thirdparty/__init__.py"
comment: on-failure
================================================
FILE: .pre-commit-config.yaml
================================================
ci:
autofix_commit_msg: |
[pre-commit.ci] auto code formatting
autofix_prs: false
autoupdate_branch: ""
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: quarterly
# pre-commit.ci has no network access, but uv-lock needs to resolve
# dependencies from remote indexes (PyPI, nvidia, pytorch).
# Lockfile freshness is checked by a separate CI workflow instead.
skip:
- uv-lock
submodules: false
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.14.10
hooks:
# Run the linter.
- id: ruff
args: [--fix] # Apply fixes to resolve lint violations.
# Run the formatter.
- id: ruff-format
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.9.21
hooks:
# Update the uv lockfile
- id: uv-lock
- repo: https://github.com/crate-ci/typos
rev: v1.42.0
hooks:
- id: typos
args: []
exclude: \.(js|css)$
- repo: local
hooks:
- id: check-warp-array-syntax
name: check warp array syntax
entry: python scripts/check_warp_array_syntax.py
language: system
types: [python]
exclude: ^(scripts/check_warp_array_syntax\.py|newton/_src/solvers/kamino/)
================================================
FILE: .python-version
================================================
3.12
================================================
FILE: AGENTS.md
================================================
# Newton Development Guidelines
- `newton/_src/` is internal. Examples and docs must not import from `newton._src`. Expose user-facing symbols via public modules (`newton/geometry.py`, `newton/solvers.py`, etc.).
- Breaking changes require a deprecation first. Do not remove or rename public API symbols without deprecating them in a prior release.
- Prefix-first naming for autocomplete: `ActuatorPD` (not `PDActuator`), `add_shape_sphere()` (not `add_sphere_shape()`).
- Prefer nested classes for self-contained helper types/enums.
- PEP 604 unions (`x | None`, not `Optional[x]`).
- Annotate Warp arrays with bracket syntax (`wp.array[wp.vec3]`, `wp.array2d[float]`, `wp.array[Any]`), not the parenthesized form (`wp.array(dtype=...)`). Use `wp.array[X]` for 1-D arrays, not `wp.array1d[X]`.
- Follow Google-style docstrings. Types in annotations, not docstrings. `Args:` use `name: description`.
- Sphinx cross-refs (`:class:`, `:meth:`) with shortest possible targets. Prefer public API paths; never use `newton._src`.
- SI units for physical quantities in public API docstrings: `"""Particle positions [m], shape [particle_count, 3]."""`. Joint-dependent: `[m or rad]`. Spatial vectors: `[N, N·m]`. Compound arrays: per-component. Skip non-physical fields.
- Run `docs/generate_api.py` when adding public API symbols.
- Avoid new required dependencies. Strongly prefer not adding optional ones — use Warp, NumPy, or stdlib.
- Create a feature branch before committing — never commit directly to `main`. Use `<username>/feature-desc`.
- Imperative mood in commit messages ("Fix X", not "Fixed X"), ~50 char subject, body wraps at 72 chars explaining _what_ and _why_.
- Verify regression tests fail without the fix before committing.
- Pin GitHub Actions by SHA: `action@<sha> # vX.Y.Z`. Check `.github/workflows/` for allowlisted hashes.
- In SPDX copyright lines, use the year the file was first created. Do not create date ranges or update the year when modifying a file.
Run `uvx pre-commit run -a` to lint/format before committing. Use `uv` for all commands; fall back to `venv`/`conda` if unavailable.
```bash
# Examples
uv sync --extra examples
uv run -m newton.examples basic_pendulum
```
## Tests
Always use `unittest`, not pytest.
```bash
uv run --extra dev -m newton.tests
uv run --extra dev -m newton.tests -k test_viewer_log_shapes # specific test
uv run --extra dev -m newton.tests -k test_basic.example_basic_shapes # example test
uv run --extra dev --extra torch-cu12 -m newton.tests # with PyTorch
```
### Testing guidelines
- Never call `wp.synchronize()` or `wp.synchronize_device()` right before `.numpy()` on a Warp array. This is redundant as `.numpy()` performs a synchronous device-to-host copy that completes all outstanding work.
```bash
# Benchmarks
uvx --with virtualenv asv run --launch-method spawn main^!
```
## PR Instructions
- If opening a pull request on GitHub, use the template in `.github/PULL_REQUEST_TEMPLATE.md`.
- If a change modifies user-facing behavior, append an entry at the end of the correct category (`Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`) in `CHANGELOG.md`'s `[Unreleased]` section. Use imperative present tense ("Add X") and avoid internal implementation details.
- For `Deprecated`, `Changed`, and `Removed` entries, include migration guidance: "Deprecate `Model.geo_meshes` in favor of `Model.shapes`".
## Examples
- Follow the `Example` class format.
- Implement `test_final()` — runs after the example completes to verify simulation state is valid.
- Optionally implement `test_post_step()` — runs after every `step()` for per-step validation.
- Register in `README.md` with `python -m newton.examples <name>` command and a 320x320 jpg screenshot.
================================================
FILE: CHANGELOG.md
================================================
# Changelog
## [Unreleased]
### Added
- Add repeatable `--warp-config KEY=VALUE` CLI option for overriding `warp.config` attributes when running examples
- Add 3D texture-based SDF, replacing NanoVDB volumes in the mesh-mesh collision pipeline for improved performance and CPU compatibility.
- Add `--benchmark [SECONDS]` flag to examples for headless FPS measurement with warmup
- Interactive example browser in the GL viewer with tree-view navigation and switch/reset support
- Add `TetMesh` class and USD loading API for tetrahedral mesh geometry
- Support kinematic bodies in VBD solver
- Add brick stacking example
- Add box pyramid example and ASV benchmark for dense convex-on-convex contacts
- Add plotting example showing how to access and visualize per-step simulation diagnostics
- Add `exposure` property to GL renderer
- Add `snap_to` argument to `ViewerGL.log_gizmo()` to snap gizmos to a target world transform when the user releases them
- Expose `gizmo_is_using` attribute to detect whether a gizmo is actively being dragged
- Add per-axis gizmo filtering via `translate`/`rotate` parameters on `log_gizmo`
- Add conceptual overview and MuJoCo Warp integration primer to collision documentation
- Add configurable velocity basis for implicit MPM (`velocity_basis`, default `"Q1"`) with GIMP quadrature option (`integration_scheme="gimp"`)
- Add plastic viscosity, dilatancy, hardening and softening rate as per-particle MPM material properties (`mpm:viscosity`, `mpm:dilatancy`, `mpm:hardening_rate`, `mpm:softening_rate`)
- Add MPM beam twist, snow ball, and viscous coiling examples
- Add support for textures in `SensorTiledCamera` via `Config.enable_textures`
- Add `enable_ambient_lighting` and `enable_particles` options to `SensorTiledCamera.Config`
- Add `SensorTiledCamera.utils.convert_ray_depth_to_forward_depth()` to convert ray-distance depth to forward (planar) depth
- Add `newton.geometry.compute_offset_mesh()` for extracting offset surface meshes from any collision shape, and a viewer toggle to visualize gap + margin wireframes in the GL viewer
- Add differentiable rigid contacts (experimental) with respect to body poses via `CollisionPipeline` when `requires_grad=True`
- Add per-shape display colors via `ModelBuilder.shape_color`, `Model.shape_color`, and `color=` on `ModelBuilder.add_shape_*`; mesh shapes fall back to `Mesh.color` when available and viewers honor runtime `Model.shape_color` updates
- Add `ModelBuilder.inertia_tolerance` to configure the eigenvalue positivity and triangle inequality threshold used during inertia correction in `finalize()`
- Pin `newton-assets` and `mujoco_menagerie` downloads to specific commit SHAs for reproducible builds (`NEWTON_ASSETS_REF`, `MENAGERIE_REF`)
- Add `ref` parameter to `download_asset()` to allow overriding the pinned revision
- Add `total_force_friction` and `force_matrix_friction` to `SensorContact` for tangential (friction) force decomposition
- Add `compute_normals` and `compute_uvs` optional arguments to `Mesh.create_heightfield()` and `Mesh.create_terrain()`
- Add RJ45 plug-socket insertion example with SDF contacts, latch joint, and interactive gizmo
### Changed
- Unify heightfield and mesh collision pipeline paths; the separate `heightfield_midphase_kernel` and `shape_pairs_heightfield` buffer are removed in favor of the shared mesh midphase
- Replace per-shape `Model.shape_heightfield_data` / `Model.heightfield_elevation_data` with compact `Model.shape_heightfield_index` / `Model.heightfield_data` / `Model.heightfield_elevations`, matching the SDF indirection pattern
- Standardize `rigid_contact_normal` to point from shape 0 toward shape 1 (A-to-B), matching the documented convention. Consumers that previously negated the normal on read (XPBD, VBD, MuJoCo, Kamino) no longer need to.
- Replace `Model.sdf_data` / `sdf_volume` / `sdf_coarse_volume` with texture-based equivalents (`texture_sdf_data`, `texture_sdf_coarse_textures`, `texture_sdf_subgrid_textures`)
- Render inertia boxes as wireframe lines instead of solid boxes in the GL viewer to avoid occluding objects
- Make contact reduction normal binning configurable (polyhedron, scan directions, voxel budget) via constants in ``contact_reduction.py``
- Upgrade GL viewer lighting from Blinn-Phong to Cook-Torrance PBR with GGX distribution, Schlick-GGX geometry, Fresnel-weighted ambient, and ACES filmic tone mapping
- Change implicit MPM residual computation to consider both infinity and l2 norm
- Change implicit MPM hardening law from exponential to hyperbolic sine (`sinh(-h * log(Jp))`), no longer scales elastic modulus
- Change implicit MPM collider velocity mode names: `"forward"` / `"backward"` replace `"instantaneous"` / `"finite_difference"`
- Simplify `SensorContact` force output: add `total_force` (aggregate per sensing object) and `force_matrix` (per-counterpart breakdown, `None` when no counterparts)
- Add `sensing_obj_idx` (`list[int]`), `counterpart_indices` (`list[list[int]]`), `sensing_obj_type`, and `counterpart_type` attributes. Rename `include_total` to `measure_total`
- Replace verbose Apache 2.0 boilerplate with two-line SPDX-only license headers across all source and documentation files
- Add `custom_attributes` argument to `ModelBuilder.add_shape_convex_hull()`
- Improve wrench preservation in hydroelastic contacts with contact reduction.
- Show Newton deprecation warnings during example runs started via `python -m newton.examples ...` or `python -m newton.examples.<category>.<module>`; pass `-W ignore::DeprecationWarning` if you need the previous quiet behavior.
- Reorder `ModelBuilder.add_shape_gaussian()` parameters so `xform` precedes `gaussian`, in line with other `add_shape_*` methods. Callers using positional arguments should switch to keyword form (`gaussian=..., xform=...`); passing a `Gaussian` as the second positional argument still works but emits a `DeprecationWarning`
- Rename `ModelBuilder.add_shape_ellipsoid()` parameters `a`, `b`, `c` to `rx`, `ry`, `rz`. Old names are still accepted as keyword arguments but emit a `DeprecationWarning`
- Rename `collide_plane_cylinder()` parameter `cylinder_center` to `cylinder_pos` for consistency with other collide functions
- Add optional `state` parameter to `SolverBase.update_contacts()` to align the base-class signature with Kamino and MuJoCo solvers
- Use `Literal` types for `SolverImplicitMPM.Config` string fields with fixed option sets (`solver`, `warmstart_mode`, `collider_velocity_mode`, `grid_type`, `transfer_scheme`, `integration_scheme`)
- Migrate `wp.array(dtype=X)` type annotations to `wp.array[X]` bracket syntax (Warp 1.12+).
### Deprecated
- Deprecate `ModelBuilder.default_body_armature`, the `armature` argument on `ModelBuilder.add_link()` / `ModelBuilder.add_body()`, and USD-authored body armature via `newton:armature` in favor of adding any isotropic artificial inertia directly to `inertia`
- Deprecate `SensorContact.net_force` in favor of `SensorContact.total_force` and `SensorContact.force_matrix`
- Deprecate `SensorContact(include_total=...)` in favor of `SensorContact(measure_total=...)`
- Deprecate `SensorContact.sensing_objs` in favor of `SensorContact.sensing_obj_idx`
- Deprecate `SensorContact.counterparts` and `SensorContact.reading_indices` in favor of `SensorContact.counterpart_indices`
- Deprecate `SensorContact.shape` (use `total_force.shape` and `force_matrix.shape` instead)
- Deprecate `SensorTiledCamera.render_context`; prefer `SensorTiledCamera.utils` and `SensorTiledCamera.render_config`.
- Deprecate `SensorTiledCamera.RenderContext`; use `SensorTiledCamera.RenderConfig` for config types and `SensorTiledCamera.render_config` / `SensorTiledCamera.utils` for runtime access.
- Deprecate `SensorTiledCamera.Config`; prefer `SensorTiledCamera.RenderConfig` and `SensorTiledCamera.utils`.
- Deprecate `Viewer.update_shape_colors()` in favor of writing directly to `Model.shape_color`
- Deprecate `ModelBuilder.add_shape_ellipsoid()` parameters `a`, `b`, `c` in favor of `rx`, `ry`, `rz`
- Deprecate passing a `Gaussian` as the second positional argument to `ModelBuilder.add_shape_gaussian()`; use the `gaussian=` keyword argument instead
- Deprecate `SensorTiledCamera.utils.assign_random_colors_per_world()` and `assign_random_colors_per_shape()` in favor of per-shape colors via `ModelBuilder.add_shape_*(color=...)`
### Removed
- Remove `Heightfield.finalize()` and stop storing raw pointers for heightfields in `Model.shape_source_ptr`; heightfield collision data is accessed via `Model.shape_heightfield_index` / `Model.heightfield_data` / `Model.heightfield_elevations`
- Remove `robot_humanoid` example in favor of `basic_plotting` which uses the same humanoid model with diagnostics visualization
### Fixed
- Fix inertia validation spuriously inflating small but physically valid eigenvalues for lightweight components (< ~50 g) by using a relative threshold instead of an absolute 1e-6 cutoff
- Restore keyboard camera movement while hovering gizmos so keyboard controls remain active when the pointer is over gizmos
- Resolve USD asset references recursively in `resolve_usd_from_url` so nested stages are fully downloaded
- Unify CPU and GPU inertia validation to produce identical results for zero-mass bodies with `bound_mass`, singular inertia, non-symmetric tensors, and triangle-inequality boundary cases
- Fix `UnboundLocalError` crash in detailed inertia validation when eigenvalue decomposition encounters NaN/Inf input
- Handle NaN/Inf mass and inertia deterministically in both validation paths (zero out mass and inertia)
- Update `ModelBuilder` internal state after fast-path (GPU kernel) inertia validation so it matches the returned `Model`
- Fix MJCF mesh scale resolution to use the mesh asset's own class rather than the geom's default class, avoiding incorrect vertex scaling for models like Robotiq 2F-85 V4
- Fix articulated bodies drifting laterally on the ground in XPBD solver by solving rigid contacts before joints
- Fix viewer crash with `imgui_bundle>=1.92.6` when editing colors by normalizing `color_edit3` input/output in `_edit_color3`
- Fix `hide_collision_shapes=True` not hiding collision meshes that have bound PBR materials
- Filter inactive particles in viewer so only particles with `ParticleFlags.ACTIVE` are rendered
- Fix concurrent asset download races on Windows by using content-addressed cache directories
- Show prismatic joints in the GL viewer when "Show Joints" is enabled
- Fix body `gravcomp` not being written to the MuJoCo spec, causing it to be absent from XML saved via `save_to_mjcf`
- Fix `compute_world_offsets` grid ordering to match terrain grid row-major order so replicated world indices align with terrain block indices
- Fix `eq_solimp` not being written to the MuJoCo spec for equality constraints, causing it to be absent from XML saved via `save_to_mjcf`
- Fix WELD equality constraint quaternion written in xyzw format instead of MuJoCo's wxyz format in the spec, causing incorrect orientation in XML saved via `save_to_mjcf`
- Fix `update_contacts` not populating `rigid_contact_point0`/`rigid_contact_point1` when using `use_mujoco_contacts=True`
- Fix VSync toggle having no effect in `ViewerGL` on Windows 8+ due to a pyglet bug where `DwmFlush()` is never called when `_always_dwm` is True
- Fix loop joint coordinate mapping in the MuJoCo solver so joints after a loop joint read/write at correct qpos/qvel offsets
- Fix viewer crash when contact buffer overflows by clamping contact count to buffer size
- Decompose loop joint constraints by DOF type (WELD for fixed, CONNECT-pair for revolute, single CONNECT for ball) instead of always emitting 2x CONNECT
- Fix inertia box wireframe rotation for isotropic and axisymmetric bodies in viewer
- Implicit MPM solver now uses `mass=0` for kinematic particles instead of `ACTIVE` flag
- Suppress macOS OpenGL warning about unloadable textures by binding a 1x1 white fallback texture when no albedo or environment texture is set
- Fix MuJoCo solver freeze when immovable bodies (kinematic, static, or fixed-root) generate contacts with degenerate invweight
- Fix forward-kinematics child-origin linear velocity for articulated translated joints
- Fix `ModelBuilder.approximate_meshes()` to handle the duplication of per-shape custom attributes that results from convex decomposition
- Fix `get_tetmesh()` winding order for left-handed USD meshes
- Fix contact force conversion in `SolverMuJoCo` to include friction (tangential) components
- Fix URDF inertial parameters parsing in parse_urdf so inertia tensor is correctly calculated as R@I@R.T
- Fix Poisson surface reconstruction segfault under parallel test execution by defaulting to single-threaded Open3D Poisson (`n_threads=1`)
- Fix overly conservative broadphase AABB for mesh shapes by using the pre-computed local AABB with a rotated-box transform instead of a bounding-sphere fallback, eliminating false contacts between distant meshes
- Fix heightfield bounding-sphere radius underestimating Z extent for asymmetric height ranges (e.g. `min_z=0, max_z=10`)
- Fix VBD self-contact barrier C2 discontinuity at `d = tau` caused by a factor-of-two error in the log-barrier coefficient
- Fix fast inertia validation treating near-symmetric tensors within `np.allclose()` default tolerances as corrections, aligning CPU and GPU validation warnings
## [1.0.0] - 2026-03-10
Initial public release.
================================================
FILE: CITATION.cff
================================================
cff-version: 1.2.0
message: "If you use Newton, please cite it using this metadata."
title: "Newton: GPU-accelerated physics simulation for robotics and simulation research"
type: software
authors:
- name: "The Newton Contributors"
url: "https://github.com/newton-physics/newton"
license: Apache-2.0
date-released: "2025-04-22"
================================================
FILE: CLAUDE.md
================================================
@AGENTS.md
================================================
FILE: CODE_OF_CONDUCT.md
================================================
By participating in this community, you agree to abide by the Linux Foundation [Code of Conduct](https://lfprojects.org/policies/code-of-conduct/).
================================================
FILE: CONTRIBUTING.md
================================================
# Overview
Newton is a project of the Linux Foundation and aims to be governed in a transparent, accessible way for the benefit of the community. All participation in this project is open and not bound to corporate affiliation. Participants are all bound to the Linux Foundation [Code of Conduct](https://lfprojects.org/policies/code-of-conduct/).
# General Guidelines and Legal
Please refer to [the contribution guidelines](https://github.com/newton-physics/newton-governance/blob/main/CONTRIBUTING.md) in the `newton-governance` repository for general information, project membership, and legal requirements for making contributions to Newton.
# Contributing to Newton
Newton welcomes contributions from the community. In order to avoid any surprises and to increase the chance of contributions being merged, we encourage contributors to communicate their plans proactively by opening a GitHub Issue or starting a Discussion in the corresponding repository.
Please also refer to the [development guide](https://newton-physics.github.io/newton/latest/guide/development.html).
There are several ways to participate in the Newton community:
## Questions, Discussions, Suggestions
* Help answer questions or contribute to technical discussion in [GitHub Discussions](https://github.com/newton-physics/newton/discussions) and Issues.
* If you have a question, suggestion or discussion topic, start a new [GitHub Discussion](https://github.com/newton-physics/newton/discussions) if there is no existing topic.
* Once somebody shares a satisfying answer to the question, click "Mark as answer".
* [GitHub Issues](https://github.com/newton-physics/newton/issues) should only be used for bugs and features. Specifically, issues that result in a code or documentation change. We may convert issues to discussions if these conditions are not met.
## Reporting a Bug
* Check in the [GitHub Issues](https://github.com/newton-physics/newton/issues) if a report for the bug already exists.
* If the bug has not been reported yet, open a new Issue.
* Use a short, descriptive title and write a clear description of the bug.
* Document the Git hash or release version where the bug is present, and the hardware and environment by including the output of `nvidia-smi`.
* Add executable code samples or test cases with instructions for reproducing the bug.
## Documentation Issues
* Create a new issue if there is no existing report, or
* directly submit a fix following the "Fixing a Bug" workflow below.
## Fixing a Bug
* Ensure that the bug report issue has no assignee yet. If the issue is assigned and there is no linked PR, you're welcome to ask about the current status by commenting on the issue.
* Write a fix and regression unit test for the bug following the [style guide](https://newton-physics.github.io/newton/latest/guide/development.html#style-guide).
* Open a new pull request for the fix and test.
* Write a description of the bug and the fix.
* Mention related issues in the description: E.g. if the patch fixes Issue \#33, write Fixes \#33.
* Have a signed CLA on file (see [Legal Requirements](https://github.com/newton-physics/newton-governance/blob/main/CONTRIBUTING.md#legal-requirements)).
* Have the pull request approved by a [Project Member](https://github.com/newton-physics/newton-governance/blob/main/CONTRIBUTING.md#project-members) and merged into the codebase.
## Improving Performance
* Write an optimization that improves an existing or new benchmark following the [style guide](https://newton-physics.github.io/newton/latest/guide/development.html#style-guide).
* Open a new pull request with the optimization, and the benchmark, if applicable.
* Write a description of the performance optimization.
* Mention related issues in the description: E.g. if the optimization addresses Issue \#42, write Addresses \#42.
* Have a signed CLA on file (see [Legal Requirements](https://github.com/newton-physics/newton-governance/blob/main/CONTRIBUTING.md#legal-requirements)).
* Have the pull request approved by a [Project Member](https://github.com/newton-physics/newton-governance/blob/main/CONTRIBUTING.md#project-members) and merged into the codebase.
## Adding a Feature or Solver
* Discuss your proposal ideally before starting with implementation. Open a GitHub Issue or Discussion to:
* propose and motivate the new feature or solver;
* detail technical specifications;
* and list changes or additions to the Newton API.
* Wait for feedback from [Project Members](https://github.com/newton-physics/newton-governance/blob/main/CONTRIBUTING.md#project-members) before proceeding.
* Implement the feature or solver following the [style guide](https://newton-physics.github.io/newton/latest/guide/development.html#style-guide).
* Add comprehensive testing and benchmarking for the new feature or solver.
* Ensure all existing tests pass and that existing benchmarks do not regress.
* Update or add documentation for the new feature or solver.
* Have a signed CLA on file (see [Legal Requirements](https://github.com/newton-physics/newton-governance/blob/main/CONTRIBUTING.md#legal-requirements)).
* Have the pull request approved by a [Project Member](https://github.com/newton-physics/newton-governance/blob/main/CONTRIBUTING.md#project-members) and merged into the codebase.
## Adding Simulation Assets
* Before proposing to add any assets to the Newton project, make sure that the assets are properly licensed for use and distribution. If you are unsure about the license, open a new discussion.
* The Newton project hosts possibly large simulation assets such as models, textures, datasets, or pre-trained policies in the [newton-assets](https://github.com/newton-physics/newton-assets) repository to keep the main newton repository small.
* Therefore, along with a pull request in the main newton repository that relies on new assets, open a corresponding pull request in the [newton-assets](https://github.com/newton-physics/newton-assets) repository.
* Follow the instructions in the [README](https://github.com/newton-physics/newton-assets) of the newton-assets repository.
* Have a signed CLA on file (see [Legal Requirements](https://github.com/newton-physics/newton-governance/blob/main/CONTRIBUTING.md#legal-requirements)).
* Have the pull request approved by a [Project Member](https://github.com/newton-physics/newton-governance/blob/main/CONTRIBUTING.md#project-members) and merged into the asset repository.
================================================
FILE: LICENSE.md
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
================================================
FILE: README.md
================================================
[](https://opensource.org/licenses/Apache-2.0)

[](https://codecov.io/gh/newton-physics/newton)
[](https://github.com/newton-physics/newton/actions/workflows/push_aws_gpu.yml)
# Newton
Newton is a GPU-accelerated physics simulation engine built upon [NVIDIA Warp](https://github.com/NVIDIA/warp), specifically targeting roboticists and simulation researchers.
Newton extends and generalizes Warp's ([deprecated](https://github.com/NVIDIA/warp/discussions/735)) `warp.sim` module, and integrates
[MuJoCo Warp](https://github.com/google-deepmind/mujoco_warp) as its primary backend. Newton emphasizes GPU-based computation, [OpenUSD](https://openusd.org/) support, differentiability, and user-defined extensibility, facilitating rapid iteration and scalable robotics simulation.
Newton is a [Linux Foundation](https://www.linuxfoundation.org/) project that is community-built and maintained. Code is licensed under [Apache-2.0](https://github.com/newton-physics/newton/blob/main/LICENSE.md). Documentation is licensed under [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/). Additional and third-party license texts are available in [`newton/licenses`](https://github.com/newton-physics/newton/tree/main/newton/licenses).
Newton was initiated by [Disney Research](https://www.disneyresearch.com/), [Google DeepMind](https://deepmind.google/), and [NVIDIA](https://www.nvidia.com/).
## Requirements
- **Python** 3.10+
- **OS:** Linux (x86-64, aarch64), Windows (x86-64), or macOS (CPU only)
- **GPU:** NVIDIA GPU (Maxwell or newer), driver 545 or newer (CUDA 12). No local CUDA Toolkit installation required. macOS runs on CPU.
For detailed system requirements and tested configurations, see the [installation guide](https://newton-physics.github.io/newton/latest/guide/installation.html).
## Quickstart
```bash
pip install "newton[examples]"
python -m newton.examples basic_pendulum
```
To install from source with [uv](https://docs.astral.sh/uv/), see the [installation guide](https://newton-physics.github.io/newton/latest/guide/installation.html).
## Examples
Before running the examples below, install Newton with the examples extra:
```bash
pip install "newton[examples]"
```
If you installed from source with uv, substitute `uv run` for `python` in the commands below.
<table>
<tr>
<td colspan="3"><h3>Basic Examples</h3></td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/basic/example_basic_pendulum.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_basic_pendulum.jpg" alt="Pendulum">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/basic/example_basic_urdf.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_basic_urdf.jpg" alt="URDF">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/basic/example_basic_viewer.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_basic_viewer.jpg" alt="Viewer">
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples basic_pendulum</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples basic_urdf</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples basic_viewer</code>
</td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/basic/example_basic_shapes.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_basic_shapes.jpg" alt="Shapes">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/basic/example_basic_joints.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_basic_joints.jpg" alt="Joints">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/basic/example_basic_conveyor.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_basic_conveyor.jpg" alt="Conveyor">
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples basic_shapes</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples basic_joints</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples basic_conveyor</code>
</td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/basic/example_basic_heightfield.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_basic_heightfield.jpg" alt="Heightfield">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/basic/example_recording.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_recording.jpg" alt="Recording">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/basic/example_replay_viewer.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_replay_viewer.jpg" alt="Replay Viewer">
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples basic_heightfield</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples recording</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples replay_viewer</code>
</td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/basic/example_basic_plotting.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_basic_plotting.jpg" alt="Plotting">
</a>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples basic_plotting</code>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="3"><h3>Robot Examples</h3></td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/robot/example_robot_cartpole.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_robot_cartpole.jpg" alt="Cartpole">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/robot/example_robot_g1.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_robot_g1.jpg" alt="G1">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/robot/example_robot_h1.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_robot_h1.jpg" alt="H1">
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples robot_cartpole</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples robot_g1</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples robot_h1</code>
</td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/robot/example_robot_anymal_d.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_robot_anymal_d.jpg" alt="Anymal D">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/robot/example_robot_anymal_c_walk.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_robot_anymal_c_walk.jpg" alt="Anymal C Walk">
</a>
</td>
<td></td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples robot_anymal_d</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples robot_anymal_c_walk</code>
</td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/robot/example_robot_policy.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_robot_policy.jpg" alt="Policy">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/robot/example_robot_ur10.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_robot_ur10.jpg" alt="UR10">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/robot/example_robot_panda_hydro.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_robot_panda_hydro.jpg" alt="Panda Hydro">
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples robot_policy</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples robot_ur10</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples robot_panda_hydro</code>
</td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/robot/example_robot_allegro_hand.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_robot_allegro_hand.jpg" alt="Allegro Hand">
</a>
</td>
<td align="center" width="33%">
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples robot_allegro_hand</code>
</td>
<td align="center" width="33%">
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td colspan="3"><h3>Cable Examples</h3></td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/cable/example_cable_twist.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_cable_twist.jpg" alt="Cable Twist">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/cable/example_cable_y_junction.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_cable_y_junction.jpg" alt="Cable Y-Junction">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/cable/example_cable_bundle_hysteresis.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_cable_bundle_hysteresis.jpg" alt="Cable Bundle Hysteresis">
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples cable_twist</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples cable_y_junction</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples cable_bundle_hysteresis</code>
</td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/cable/example_cable_pile.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_cable_pile.jpg" alt="Cable Pile">
</a>
</td>
<td align="center" width="33%">
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples cable_pile</code>
</td>
<td align="center" width="33%">
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td colspan="3"><h3>Cloth Examples</h3></td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/cloth/example_cloth_bending.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_cloth_bending.jpg" alt="Cloth Bending">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/cloth/example_cloth_hanging.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_cloth_hanging.jpg" alt="Cloth Hanging">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/cloth/example_cloth_style3d.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_cloth_style3d.jpg" alt="Cloth Style3D">
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples cloth_bending</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples cloth_hanging</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples cloth_style3d</code>
</td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/cloth/example_cloth_h1.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_cloth_h1.jpg" alt="Cloth H1">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/cloth/example_cloth_twist.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_cloth_twist.jpg" alt="Cloth Twist">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/cloth/example_cloth_franka.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_cloth_franka.jpg" alt="Cloth Franka">
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples cloth_h1</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples cloth_twist</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples cloth_franka</code>
</td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/cloth/example_cloth_rollers.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_cloth_rollers.jpg" alt="Cloth Rollers">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/cloth/example_cloth_poker_cards.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_cloth_poker_cards.jpg" alt="Cloth Poker Cards">
</a>
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples cloth_rollers</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples cloth_poker_cards</code>
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td colspan="3"><h3>Inverse Kinematics Examples</h3></td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/ik/example_ik_franka.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_ik_franka.jpg" alt="IK Franka">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/ik/example_ik_h1.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_ik_h1.jpg" alt="IK H1">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/ik/example_ik_custom.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_ik_custom.jpg" alt="IK Custom">
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples ik_franka</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples ik_h1</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples ik_custom</code>
</td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/ik/example_ik_cube_stacking.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_ik_cube_stacking.jpg" alt="IK Cube Stacking">
</a>
</td>
<td align="center" width="33%">
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples ik_cube_stacking</code>
</td>
<td align="center" width="33%">
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td colspan="3"><h3>MPM Examples</h3></td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/mpm/example_mpm_granular.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_mpm_granular.jpg" alt="MPM Granular">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/mpm/example_mpm_anymal.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_mpm_anymal.jpg" alt="MPM Anymal">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/mpm/example_mpm_twoway_coupling.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_mpm_twoway_coupling.jpg" alt="MPM Two-Way Coupling">
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples mpm_granular</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples mpm_anymal</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples mpm_twoway_coupling</code>
</td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/mpm/example_mpm_grain_rendering.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_mpm_grain_rendering.jpg" alt="MPM Grain Rendering">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/mpm/example_mpm_multi_material.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_mpm_multi_material.jpg" alt="MPM Multi Material">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/mpm/example_mpm_viscous.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_mpm_viscous.jpg" alt="MPM Viscous">
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples mpm_grain_rendering</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples mpm_multi_material</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples mpm_viscous</code>
</td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/mpm/example_mpm_beam_twist.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_mpm_beam_twist.jpg" alt="MPM Beam Twist">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/mpm/example_mpm_snow_ball.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_mpm_snow_ball.jpg" alt="MPM Snow Ball">
</a>
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples mpm_beam_twist</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples mpm_snow_ball</code>
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td colspan="3"><h3>Sensor Examples</h3></td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/sensors/example_sensor_contact.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_sensor_contact.jpg" alt="Sensor Contact">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/sensors/example_sensor_tiled_camera.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_sensor_tiled_camera.jpg" alt="Sensor Tiled Camera">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/sensors/example_sensor_imu.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_sensor_imu.jpg" alt="Sensor IMU">
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples sensor_contact</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples sensor_tiled_camera</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples sensor_imu</code>
</td>
</tr>
<tr>
<td colspan="3"><h3>Selection Examples</h3></td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/selection/example_selection_cartpole.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_selection_cartpole.jpg" alt="Selection Cartpole">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/selection/example_selection_materials.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_selection_materials.jpg" alt="Selection Materials">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/selection/example_selection_articulations.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_selection_articulations.jpg" alt="Selection Articulations">
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples selection_cartpole</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples selection_materials</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples selection_articulations</code>
</td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/selection/example_selection_multiple.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_selection_multiple.jpg" alt="Selection Multiple">
</a>
</td>
<td align="center" width="33%">
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples selection_multiple</code>
</td>
<td align="center" width="33%">
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td colspan="3"><h3>DiffSim Examples</h3></td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/diffsim/example_diffsim_ball.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_diffsim_ball.jpg" alt="DiffSim Ball">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/diffsim/example_diffsim_cloth.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_diffsim_cloth.jpg" alt="DiffSim Cloth">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/diffsim/example_diffsim_drone.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_diffsim_drone.jpg" alt="DiffSim Drone">
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples diffsim_ball</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples diffsim_cloth</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples diffsim_drone</code>
</td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/diffsim/example_diffsim_spring_cage.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_diffsim_spring_cage.jpg" alt="DiffSim Spring Cage">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/diffsim/example_diffsim_soft_body.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_diffsim_soft_body.jpg" alt="DiffSim Soft Body">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/diffsim/example_diffsim_bear.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_diffsim_bear.jpg" alt="DiffSim Quadruped">
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples diffsim_spring_cage</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples diffsim_soft_body</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples diffsim_bear</code>
</td>
</tr>
<tr>
<td colspan="3"><h3>Multi-Physics Examples</h3></td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/multiphysics/example_softbody_gift.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_softbody_gift.jpg" alt="Softbody Gift">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/multiphysics/example_softbody_dropping_to_cloth.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_softbody_dropping_to_cloth.jpg" alt="Softbody Dropping to Cloth">
</a>
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples softbody_gift</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples softbody_dropping_to_cloth</code>
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td colspan="3"><h3>Contacts Examples</h3></td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/contacts/example_nut_bolt_hydro.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_nut_bolt_hydro.jpg" alt="Nut Bolt Hydro">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/contacts/example_nut_bolt_sdf.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_nut_bolt_sdf.jpg" alt="Nut Bolt SDF">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/contacts/example_brick_stacking.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_brick_stacking.jpg" alt="Brick Stacking">
</a>
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples nut_bolt_hydro</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples nut_bolt_sdf</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples brick_stacking</code>
</td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/contacts/example_pyramid.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_pyramid.jpg" alt="Pyramid">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/contacts/example_contacts_rj45_plug.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_contacts_rj45_plug.jpg" alt="RJ45 Plug">
</a>
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples pyramid</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples contacts_rj45_plug</code>
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td colspan="3"><h3>Softbody Examples</h3></td>
</tr>
<tr>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/softbody/example_softbody_hanging.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_softbody_hanging.jpg" alt="Softbody Hanging">
</a>
</td>
<td align="center" width="33%">
<a href="https://github.com/newton-physics/newton/blob/main/newton/examples/softbody/example_softbody_franka.py">
<img width="320" src="https://raw.githubusercontent.com/newton-physics/newton/main/docs/images/examples/example_softbody_franka.jpg" alt="Softbody Franka">
</a>
</td>
<td align="center" width="33%">
</td>
</tr>
<tr>
<td align="center" width="33%">
<code>python -m newton.examples softbody_hanging</code>
</td>
<td align="center" width="33%">
<code>python -m newton.examples softbody_franka</code>
</td>
<td align="center" width="33%">
</td>
</tr>
</table>
### Example Options
The examples support the following command-line arguments:
| Argument | Description | Default |
| --------------- | --------------------------------------------------------------------------------------------------- | ---------------------------- |
| `--viewer` | Viewer type: `gl` (OpenGL window), `usd` (USD file output), `rerun` (ReRun), or `null` (no viewer). | `gl` |
| `--device` | Compute device to use, e.g., `cpu`, `cuda:0`, etc. | `None` (default Warp device) |
| `--num-frames` | Number of frames to simulate (for USD output). | `100` |
| `--output-path` | Output path for USD files (required if `--viewer usd` is used). | `None` |
Some examples may add additional arguments (see their respective source files for details).
### Example Usage
```bash
# List available examples
python -m newton.examples
# Run with the USD viewer and save to my_output.usd
python -m newton.examples basic_viewer --viewer usd --output-path my_output.usd
# Run on a selected device
python -m newton.examples basic_urdf --device cuda:0
# Combine options
python -m newton.examples basic_viewer --viewer gl --num-frames 500 --device cpu
```
## Contributing and Development
See the [contribution guidelines](https://github.com/newton-physics/newton-governance/blob/main/CONTRIBUTING.md) and the [development guide](https://newton-physics.github.io/newton/latest/guide/development.html) for instructions on how to contribute to Newton.
## Support and Community Discussion
For questions, please consult the [Newton documentation](https://newton-physics.github.io/newton/latest/guide/overview.html) first before creating [a discussion in the main repository](https://github.com/newton-physics/newton/discussions).
## Code of Conduct
By participating in this community, you agree to abide by the Linux Foundation [Code of Conduct](https://lfprojects.org/policies/code-of-conduct/).
## Project Governance, Legal, and Members
Please see the [newton-governance repository](https://github.com/newton-physics/newton-governance) for more information about project governance.
================================================
FILE: SECURITY.md
================================================
Please refer to the [SECURITY.md](https://github.com/newton-physics/newton-governance/blob/main/SECURITY.md) in the newton-governance repository.
================================================
FILE: asv/benchmarks/__init__.py
================================================
================================================
FILE: asv/benchmarks/benchmark_ik.py
================================================
# SPDX-FileCopyrightText: Copyright (c) 2026 The Newton Developers
# SPDX-License-Identifier: Apache-2.0
###########################################################################
# Used for benchmarking the Newton IK solver.
#
# This module provides shared logic for IK benchmarks on the
# Franka Emika Panda robot.
###########################################################################
from __future__ import annotations
import numpy as np
import warp as wp
import newton
import newton.ik as ik
import newton.utils
def create_franka_model() -> newton.Model:
builder = newton.ModelBuilder()
builder.num_rigid_contacts_per_world = 0
builder.default_shape_cfg.density = 100.0
asset_path = newton.utils.download_asset("franka_emika_panda") / "urdf/fr3.urdf"
builder.add_urdf(asset_path, floating=False, scale=1.0)
return builder.finalize(requires_grad=False)
def random_solutions(model: newton.Model, n: int, rng: np.random.Generator) -> np.ndarray:
n_coords = model.joint_coord_count
lower = model.joint_limit_lower.numpy()[:n_coords]
upper = model.joint_limit_upper.numpy()[:n_coords]
span = upper - lower
mask = np.abs(span) > 1e5
span[mask] = 0.0
q = rng.random((n, n_coords)) * span + lower
q[:, mask] = 0.0
return q.astype(np.float32)
def build_ik_solver(model: newton.Model, n_problems: int, ee_links: tuple[int, ...]):
zero_pos = [wp.zeros(n_problems, dtype=wp.vec3) for _ in ee_links]
zero_rot = [wp.zeros(n_problems, dtype=wp.vec4) for _ in ee_links]
objectives = []
for ee, link in enumerate(ee_links):
objectives.append(ik.IKObjectivePosition(link, wp.vec3(), zero_pos[ee]))
for ee, link in enumerate(ee_links):
objectives.append(
ik.IKObjectiveRotation(
link,
wp.quat_identity(),
zero_rot[ee],
canonicalize_quat_err=False,
)
)
objectives.append(
ik.IKObjectiveJointLimit(
model.joint_limit_lower,
model.joint_limit_upper,
weight=1.0,
)
)
solver = ik.IKSolver(
model,
n_problems,
objectives,
sampler=ik.IKSampler.ROBERTS,
n_seeds=64,
lambda_factor=4.0,
jacobian_mode=ik.IKJacobianType.ANALYTIC,
)
return (
solver,
objectives[: len(ee_links)],
objectives[len(ee_links) : 2 * len(ee_links)],
)
def fk_targets(solver, model: newton.Model, q_batch: np.ndarray, ee_links: tuple[int, ...]):
batch_size = q_batch.shape[0]
solver._fk_two_pass(
model,
wp.array(q_batch, dtype=wp.float32),
solver.body_q,
solver.X_local,
batch_size,
)
wp.synchronize_device()
bq = solver.body_q.numpy()[:batch_size]
ee = np.asarray(ee_links)
return bq[:, ee, :3].copy(), bq[:, ee, 3:7].copy()
def eval_success(solver, model, q_best, tgt_pos, tgt_rot, ee_links, pos_thresh_m, ori_thresh_rad):
batch_size = q_best.shape[0]
solver._fk_two_pass(
model,
wp.array(q_best, dtype=wp.float32),
solver.body_q,
solver.X_local,
batch_size,
)
wp.synchronize_device()
bq = solver.body_q.numpy()[:batch_size]
ee = np.asarray(ee_links)
pos_err = np.linalg.norm(bq[:, ee, :3] - tgt_pos, axis=-1).max(axis=-1)
def _qmul(a, b):
# Quaternions stored as (x, y, z, w) — scalar-last, matching Warp convention.
x1, y1, z1, w1 = np.moveaxis(a, -1, 0)
x2, y2, z2, w2 = np.moveaxis(b, -1, 0)
return np.stack(
(
w1 * x2 + x1 * w2 + y1 * z2 - z1 * y2,
w1 * y2 - x1 * z2 + y1 * w2 + z1 * x2,
w1 * z2 + x1 * y2 - y1 * x2 + z1 * w2,
w1 * w2 - x1 * x2 - y1 * y2 - z1 * z2,
),
axis=-1,
)
tgt_conj = np.concatenate([-tgt_rot[..., :3], tgt_rot[..., 3:]], axis=-1)
rel = _qmul(tgt_conj, bq[:, ee, 3:7])
rot_err = (2 * np.arctan2(np.linalg.norm(rel[..., :3], axis=-1), np.abs(rel[..., 3]))).max(axis=-1)
success = (pos_err < pos_thresh_m) & (rot_err < ori_thresh_rad)
return success
================================================
FILE: asv/benchmarks/benchmark_mujoco.py
================================================
# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers
# SPDX-License-Identifier: Apache-2.0
###########################################################################
# Used for benchmarking MjWarp.
#
# This script allows us to choose between several predefined robots and
# provides a large range of customizable options.
#
###########################################################################
import time
import numpy as np
import warp as wp
wp.config.enable_backward = False
import newton
import newton.examples
import newton.utils
from newton.sensors import SensorContact
from newton.utils import EventTracer
ROBOT_CONFIGS = {
"humanoid": {
"solver": "newton",
"integrator": "implicitfast",
"njmax": 80,
"nconmax": 25,
"ls_parallel": False,
"cone": "pyramidal",
"sensing_bodies": ["*thigh*", "*shin*", "*foot*", "*arm*"],
},
"g1": {
"solver": "newton",
"integrator": "implicitfast",
"njmax": 210,
"nconmax": 35,
"ls_parallel": False,
"cone": "pyramidal",
},
"h1": {
"solver": "newton",
"integrator": "implicitfast",
"njmax": 65,
"nconmax": 15,
"ls_parallel": False,
"cone": "pyramidal",
},
"cartpole": {
"solver": "newton",
"integrator": "implicitfast",
"njmax": 5,
"nconmax": 0,
"ls_parallel": False,
"cone": "pyramidal",
},
"ant": {
"solver": "newton",
"integrator": "implicitfast",
"njmax": 38,
"nconmax": 15,
"ls_parallel": False,
"cone": "pyramidal",
},
"quadruped": {
"solver": "newton",
"integrator": "implicitfast",
"njmax": 75,
"nconmax": 50,
"ls_parallel": False,
"cone": "pyramidal",
},
"allegro": {
"solver": "newton",
"integrator": "implicitfast",
"njmax": 60,
"nconmax": 40,
"ls_parallel": False,
"cone": "elliptic",
},
"kitchen": {
"setup_builder": lambda x: _setup_kitchen(x),
"njmax": 3800,
"nconmax": 900,
},
"tabletop": {
"setup_builder": lambda x: _setup_tabletop(x),
"njmax": 100,
"nconmax": 20,
},
}
def _setup_humanoid(articulation_builder):
articulation_builder.add_mjcf(
newton.examples.get_asset("nv_humanoid.xml"),
ignore_names=["floor", "ground"],
up_axis="Z",
parse_sites=False, # AD: remove once asset is fixed
enable_self_collisions=False, # Keep False for consistent benchmark performance
)
# Setting root pose
root_dofs = 7
articulation_builder.joint_q[:3] = [0.0, 0.0, 1.5]
return root_dofs
def _setup_g1(articulation_builder):
articulation_builder.default_joint_cfg = newton.ModelBuilder.JointDofConfig(
limit_ke=1.0e3, limit_kd=1.0e1, friction=1e-5
)
articulation_builder.default_shape_cfg.ke = 5.0e4
articulation_builder.default_shape_cfg.kd = 5.0e2
articulation_builder.default_shape_cfg.kf = 1.0e3
articulation_builder.default_shape_cfg.mu = 0.75
asset_path = newton.utils.download_asset("unitree_g1")
articulation_builder.add_usd(
str(asset_path / "usd" / "g1_isaac.usd"),
xform=wp.transform(wp.vec3(0, 0, 0.8)),
collapse_fixed_joints=True,
enable_self_collisions=False,
hide_collision_shapes=True,
)
for i in range(6, articulation_builder.joint_dof_count):
articulation_builder.joint_target_ke[i] = 1000.0
articulation_builder.joint_target_kd[i] = 5.0
# approximate meshes for faster collision detection
articulation_builder.approximate_meshes("bounding_box")
root_dofs = 7
return root_dofs
def _setup_h1(articulation_builder):
articulation_builder.default_joint_cfg = newton.ModelBuilder.JointDofConfig(
limit_ke=1.0e3, limit_kd=1.0e1, friction=1e-5
)
articulation_builder.default_shape_cfg.ke = 5.0e4
articulation_builder.default_shape_cfg.kd = 5.0e2
articulation_builder.default_shape_cfg.kf = 1.0e3
articulation_builder.default_shape_cfg.mu = 0.75
asset_path = newton.utils.download_asset("unitree_h1")
asset_file = str(asset_path / "usd" / "h1_minimal.usda")
articulation_builder.add_usd(
asset_file,
ignore_paths=["/GroundPlane"],
collapse_fixed_joints=False,
enable_self_collisions=False,
hide_collision_shapes=True,
)
# approximate meshes for faster collision detection
articulation_builder.approximate_meshes("bounding_box")
for i in range(articulation_builder.joint_dof_count):
articulation_builder.joint_target_ke[i] = 150
articulation_builder.joint_target_kd[i] = 5
root_dofs = 7
return root_dofs
def _setup_cartpole(articulation_builder):
articulation_builder.default_shape_cfg.density = 100.0
articulation_builder.default_joint_cfg.armature = 0.1
articulation_builder.add_usd(
newton.examples.get_asset("cartpole_single_pendulum.usda"),
enable_self_collisions=False,
collapse_fixed_joints=True,
)
armature_inertia = wp.mat33(np.eye(3, dtype=np.float32)) * 0.1
for i in range(articulation_builder.body_count):
articulation_builder.body_inertia[i] = articulation_builder.body_inertia[i] + armature_inertia
# set initial joint positions (cartpole has 2 joints: prismatic slider + revolute pole)
# joint_q[0] = slider position, joint_q[1] = pole angle
articulation_builder.joint_q[0] = 0.0 # slider at origin
articulation_builder.joint_q[1] = 0.3 # pole tilted
# Setting root pose
root_dofs = 1
return root_dofs
def _setup_ant(articulation_builder):
articulation_builder.add_usd(
newton.examples.get_asset("ant.usda"),
collapse_fixed_joints=True,
)
# Setting root pose
root_dofs = 7
articulation_builder.joint_q[:3] = [0.0, 0.0, 1.5]
return root_dofs
def _setup_quadruped(articulation_builder):
articulation_builder.default_joint_cfg.armature = 0.01
articulation_builder.default_shape_cfg.ke = 1.0e4
articulation_builder.default_shape_cfg.kd = 1.0e2
articulation_builder.default_shape_cfg.kf = 1.0e2
articulation_builder.default_shape_cfg.mu = 1.0
articulation_builder.add_urdf(
newton.examples.get_asset("quadruped.urdf"),
xform=wp.transform([0.0, 0.0, 0.7], wp.quat_identity()),
floating=True,
enable_self_collisions=False,
)
armature_inertia = wp.mat33(np.eye(3, dtype=np.float32)) * 0.01
for i in range(articulation_builder.body_count):
articulation_builder.body_inertia[i] = articulation_builder.body_inertia[i] + armature_inertia
root_dofs = 7
return root_dofs
def _setup_allegro(articulation_builder):
asset_path = newton.utils.download_asset("wonik_allegro")
asset_file = str(asset_path / "usd" / "allegro_left_hand_with_cube.usda")
articulation_builder.add_usd(
asset_file,
xform=wp.transform(wp.vec3(0, 0, 0.5)),
enable_self_collisions=True,
ignore_paths=[".*Dummy", ".*CollisionPlane", ".*goal", ".*DexCube/visuals"],
)
# set joint targets and joint drive gains
for i in range(articulation_builder.joint_dof_count):
articulation_builder.joint_target_ke[i] = 150
articulation_builder.joint_target_kd[i] = 5
articulation_builder.joint_target_pos[i] = 0.0
root_dofs = 1
return root_dofs
def _setup_kitchen(articulation_builder):
asset_path = newton.utils.download_asset("kitchen")
asset_file = str(asset_path / "mjcf" / "kitchen.xml")
articulation_builder.add_mjcf(
asset_file,
collapse_fixed_joints=True,
enable_self_collisions=False, # Keep False for consistent benchmark performance
)
# Change pose of the robot to minimize overlap
articulation_builder.joint_q[:2] = [1.5, -1.5]
def _setup_tabletop(articulation_builder):
articulation_builder.add_mjcf(
newton.examples.get_asset("tabletop.xml"),
collapse_fixed_joints=True,
)
class Example:
def __init__(
self,
robot="humanoid",
environment="None",
stage_path=None,
world_count=1,
use_cuda_graph=True,
use_mujoco_cpu=False,
randomize=False,
headless=False,
actuation="None",
solver=None,
integrator=None,
solver_iteration=None,
ls_iteration=None,
njmax=None,
nconmax=None,
builder=None,
ls_parallel=None,
cone=None,
):
fps = 600
self.sim_time = 0.0
self.benchmark_time = 0.0
self.frame_dt = 1.0 / fps
self.sim_substeps = 10
self.contacts = None
self.sim_dt = self.frame_dt / self.sim_substeps
self.world_count = world_count
self.use_cuda_graph = use_cuda_graph
self.use_mujoco_cpu = use_mujoco_cpu
self.actuation = actuation
# set numpy random seed
self.seed = 123
self.rng = np.random.default_rng(self.seed)
if not stage_path:
stage_path = "example_" + robot + ".usd"
if builder is None:
builder = Example.create_model_builder(robot, world_count, environment, randomize, self.seed)
# finalize model
self.model = builder.finalize()
self.solver = Example.create_solver(
self.model,
robot,
use_mujoco_cpu=use_mujoco_cpu,
environment=environment,
solver=solver,
integrator=integrator,
solver_iteration=solver_iteration,
ls_iteration=ls_iteration,
njmax=njmax,
nconmax=nconmax,
ls_parallel=ls_parallel,
cone=cone,
)
if stage_path and not headless:
self.renderer = newton.viewer.ViewerGL()
self.renderer.set_model(self.model)
self.renderer.set_world_offsets((4.0, 4.0, 0.0))
else:
self.renderer = None
self.control = self.model.control()
self.state_0, self.state_1 = self.model.state(), self.model.state()
newton.eval_fk(self.model, self.model.joint_q, self.model.joint_qd, self.state_0)
self.sensor_contact = None
sensing_bodies = ROBOT_CONFIGS.get(robot, {}).get("sensing_bodies", None)
if sensing_bodies is not None:
self.sensor_contact = SensorContact(self.model, sensing_obj_bodies=sensing_bodies, counterpart_bodies="*")
self.contacts = newton.Contacts(
self.solver.get_max_contact_count(),
0,
device=self.model.device,
requested_attributes=self.model.get_requested_contact_attributes(),
)
self.graph = None
if self.use_cuda_graph:
# simulate() allocates memory via a clone, so we can't use graph capture if the device does not support mempools
cuda_graph_comp = wp.get_device().is_cuda and wp.is_mempool_enabled(wp.get_device())
if not cuda_graph_comp:
print("Cannot use graph capture. Graph capture is disabled.")
else:
with wp.ScopedCapture() as capture:
self.simulate()
self.graph = capture.graph
def simulate(self):
for _ in range(self.sim_substeps):
self.state_0.clear_forces()
self.solver.step(self.state_0, self.state_1, self.control, self.contacts, self.sim_dt)
self.state_0, self.state_1 = self.state_1, self.state_0
if self.sensor_contact is not None:
self.solver.update_contacts(self.contacts, self.state_0)
self.sensor_contact.update(self.state_0, self.contacts)
def step(self):
if self.actuation == "random":
joint_target = wp.array(self.rng.uniform(-1.0, 1.0, size=self.model.joint_dof_count), dtype=wp.float32)
wp.copy(self.control.joint_target_pos, joint_target)
wp.synchronize_device()
start_time = time.time()
if self.use_cuda_graph:
wp.capture_launch(self.graph)
else:
self.simulate()
wp.synchronize_device()
end_time = time.time()
self.benchmark_time += end_time - start_time
self.sim_time += self.frame_dt
def render(self):
if self.renderer is None:
return
self.renderer.begin_frame(self.sim_time)
self.renderer.log_state(self.state_0)
self.renderer.end_frame()
@staticmethod
def create_model_builder(robot, world_count, environment="None", randomize=False, seed=123) -> newton.ModelBuilder:
rng = np.random.default_rng(seed)
articulation_builder = newton.ModelBuilder()
articulation_builder.default_shape_cfg.ke = 1.0e3
articulation_builder.default_shape_cfg.kd = 1.0e2
newton.solvers.SolverMuJoCo.register_custom_attributes(articulation_builder)
if robot == "humanoid":
root_dofs = _setup_humanoid(articulation_builder)
elif robot == "g1":
root_dofs = _setup_g1(articulation_builder)
elif robot == "h1":
root_dofs = _setup_h1(articulation_builder)
elif robot == "cartpole":
root_dofs = _setup_cartpole(articulation_builder)
elif robot == "ant":
root_dofs = _setup_ant(articulation_builder)
elif robot == "quadruped":
root_dofs = _setup_quadruped(articulation_builder)
elif robot == "allegro":
root_dofs = _setup_allegro(articulation_builder)
else:
raise ValueError(f"Name of the provided robot not recognized: {robot}")
custom_setup_fn = ROBOT_CONFIGS.get(environment, {}).get("setup_builder", None)
if custom_setup_fn is not None:
custom_setup_fn(articulation_builder)
builder = newton.ModelBuilder()
builder.replicate(articulation_builder, world_count)
if randomize:
njoint = len(articulation_builder.joint_q)
for i in range(world_count):
istart = i * njoint
builder.joint_q[istart + root_dofs : istart + njoint] = rng.uniform(
-1.0, 1.0, size=(njoint - root_dofs)
).tolist()
builder.default_shape_cfg.ke = 1.0e3
builder.default_shape_cfg.kd = 1.0e2
if robot != "cartpole":
# Disable all collisions for the cartpole benchmark
builder.add_ground_plane()
return builder
@staticmethod
def create_solver(
model,
robot,
*,
use_mujoco_cpu=False,
environment="None",
solver=None,
integrator=None,
solver_iteration=None,
ls_iteration=None,
njmax=None,
nconmax=None,
ls_parallel=None,
cone=None,
):
solver_iteration = solver_iteration if solver_iteration is not None else 100
ls_iteration = ls_iteration if ls_iteration is not None else 50
solver = solver if solver is not None else ROBOT_CONFIGS[robot]["solver"]
integrator = integrator if integrator is not None else ROBOT_CONFIGS[robot]["integrator"]
njmax = njmax if njmax is not None else ROBOT_CONFIGS[robot]["njmax"]
nconmax = nconmax if nconmax is not None else ROBOT_CONFIGS[robot]["nconmax"]
ls_parallel = ls_parallel if ls_parallel is not None else ROBOT_CONFIGS[robot]["ls_parallel"]
cone = cone if cone is not None else ROBOT_CONFIGS[robot]["cone"]
njmax += ROBOT_CONFIGS.get(environment, {}).get("njmax", 0)
nconmax += ROBOT_CONFIGS.get(environment, {}).get("nconmax", 0)
return newton.solvers.SolverMuJoCo(
model,
use_mujoco_cpu=use_mujoco_cpu,
solver=solver,
integrator=integrator,
iterations=solver_iteration,
ls_iterations=ls_iteration,
njmax=njmax,
nconmax=nconmax,
ls_parallel=ls_parallel,
cone=cone,
)
def print_trace(trace, indent, steps):
if indent == 0:
print("================= Profiling =================")
for k, v in trace.items():
times, sub_trace = v
print(" " * indent + f"{k}: {times / steps:.4f}")
print_trace(sub_trace, indent + 1, steps)
if indent == 0:
step_time = trace["step"][0]
step_trace = trace["step"][1]
mujoco_warp_step_time = step_trace["_mujoco_warp_step"][0]
overhead = 100.0 * (step_time - mujoco_warp_step_time) / step_time
print("---------------------------------------------")
print(f"Newton overhead:\t{overhead:.2f} %")
print("=============================================")
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("--robot", type=str, default="humanoid", help="Name of the robot to simulate.")
parser.add_argument("--env", type=str, default="None", help="Name of the environment where the robot is located.")
parser.add_argument(
"--event-trace", default=False, action=argparse.BooleanOptionalAction, help="Print profiling information."
)
parser.add_argument("--device", type=str, default=None, help="Override the default Warp device.")
parser.add_argument(
"--stage-path",
type=lambda x: None if x == "None" else str(x),
default=None,
help="Path to the output USD file.",
)
parser.add_argument("--num-frames", type=int, default=12000, help="Total number of frames.")
parser.add_argument("--world-count", type=int, default=1, help="Total number of simulated worlds.")
parser.add_argument("--use-cuda-graph", default=True, action=argparse.BooleanOptionalAction)
parser.add_argument(
"--use-mujoco-cpu",
default=False,
action=argparse.BooleanOptionalAction,
help="Use Mujoco-C CPU (Not yet supported).",
)
parser.add_argument(
"--headless", default=False, action=argparse.BooleanOptionalAction, help="Run the simulation in headless mode."
)
parser.add_argument(
"--random-init", default=False, action=argparse.BooleanOptionalAction, help="Randomize initial pose."
)
parser.add_argument(
"--actuation",
type=str,
default="None",
choices=["None", "random"],
help="Type of action to apply at each step.",
)
parser.add_argument(
"--solver", type=str, default=None, choices=["cg", "newton"], help="Mujoco model constraint solver used."
)
parser.add_argument(
"--integrator", type=str, default=None, choices=["euler", "rk4", "implicit"], help="Mujoco integrator used."
)
parser.add_argument("--solver-iteration", type=int, default=None, help="Number of solver iterations.")
parser.add_argument("--ls-iteration", type=int, default=None, help="Number of linesearch iterations.")
parser.add_argument("--njmax", type=int, default=None, help="Maximum number of constraints per world.")
parser.add_argument("--nconmax", type=int, default=None, help="Maximum number of collision per world.")
parser.add_argument(
"--ls-parallel", default=None, action=argparse.BooleanOptionalAction, help="Use parallel line search."
)
parser.add_argument("--cone", type=str, default=None, choices=["pyramidal", "elliptic"], help="Friction cone type.")
args = parser.parse_known_args()[0]
if args.use_mujoco_cpu:
args.use_mujoco_cpu = False
print("The option ``use-mujoco-cpu`` is not yet supported. Disabling it.")
trace = {}
with EventTracer(enabled=args.event_trace) as tracer:
with wp.ScopedDevice(args.device):
example = Example(
robot=args.robot,
environment=args.env,
stage_path=args.stage_path,
world_count=args.world_count,
use_cuda_graph=args.use_cuda_graph,
use_mujoco_cpu=args.use_mujoco_cpu,
randomize=args.random_init,
headless=args.headless,
actuation=args.actuation,
solver=args.solver,
integrator=args.integrator,
solver_iteration=args.solver_iteratio
gitextract_nsnm_v9o/
├── .claude/
│ └── skills/
│ └── newton-api-design/
│ └── SKILL.md
├── .coderabbit.yml
├── .gitattributes
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── 1-bug-report.yml
│ │ ├── 2-feature-request.yml
│ │ ├── 3-documentation.yml
│ │ └── config.yml
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── codecov.yml
│ └── workflows/
│ ├── aws_gpu_benchmarks.yml
│ ├── aws_gpu_tests.yml
│ ├── ci.yml
│ ├── docs-dev.yml
│ ├── docs-release.yml
│ ├── merge_queue_aws_gpu.yml
│ ├── minimum_deps_tests.yml
│ ├── mujoco_warp_tests.yml
│ ├── pr.yml
│ ├── pr_closed.yml
│ ├── pr_license_check.yml
│ ├── pr_target_aws_gpu_benchmarks.yml
│ ├── pr_target_aws_gpu_tests.yml
│ ├── push_aws_gpu.yml
│ ├── release.yml
│ ├── scheduled_nightly.yml
│ └── warp_nightly_tests.yml
├── .gitignore
├── .licenserc-docs.yaml
├── .licenserc.yaml
├── .pre-commit-config.yaml
├── .python-version
├── AGENTS.md
├── CHANGELOG.md
├── CITATION.cff
├── CLAUDE.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md
├── SECURITY.md
├── asv/
│ └── benchmarks/
│ ├── __init__.py
│ ├── benchmark_ik.py
│ ├── benchmark_mujoco.py
│ ├── compilation/
│ │ ├── __init__.py
│ │ └── bench_example_load.py
│ ├── setup/
│ │ ├── __init__.py
│ │ └── bench_model.py
│ └── simulation/
│ ├── __init__.py
│ ├── bench_anymal.py
│ ├── bench_cable.py
│ ├── bench_cloth.py
│ ├── bench_contacts.py
│ ├── bench_heightfield.py
│ ├── bench_ik.py
│ ├── bench_mujoco.py
│ ├── bench_quadruped_xpbd.py
│ ├── bench_selection.py
│ ├── bench_sensor_tiled_camera.py
│ └── bench_viewer.py
├── asv.conf.json
├── docs/
│ ├── Makefile
│ ├── _ext/
│ │ ├── autodoc_filter.py
│ │ └── autodoc_wpfunc.py
│ ├── _static/
│ │ ├── custom.css
│ │ ├── gh-pages-404.html
│ │ └── switcher.json
│ ├── _templates/
│ │ ├── autosummary/
│ │ │ └── class.rst
│ │ ├── class.rst
│ │ ├── genindex.html
│ │ ├── py-modindex.html
│ │ ├── search.html
│ │ └── sidebar-nav-bs.html
│ ├── api/
│ │ ├── newton.rst
│ │ ├── newton_geometry.rst
│ │ ├── newton_ik.rst
│ │ ├── newton_math.rst
│ │ ├── newton_selection.rst
│ │ ├── newton_sensors.rst
│ │ ├── newton_solvers.rst
│ │ ├── newton_solvers_style3d.rst
│ │ ├── newton_usd.rst
│ │ ├── newton_utils.rst
│ │ └── newton_viewer.rst
│ ├── concepts/
│ │ ├── articulations.rst
│ │ ├── collisions.rst
│ │ ├── conventions.rst
│ │ ├── custom_attributes.rst
│ │ ├── extended_attributes.rst
│ │ ├── mass_inertia.rst
│ │ ├── sensors.rst
│ │ ├── sites.rst
│ │ ├── usd_parsing.rst
│ │ └── worlds.rst
│ ├── conf.py
│ ├── faq.rst
│ ├── generate_api.py
│ ├── guide/
│ │ ├── development.rst
│ │ ├── installation.rst
│ │ ├── overview.rst
│ │ ├── release.rst
│ │ ├── tutorials.rst
│ │ └── visualization.rst
│ ├── images/
│ │ └── examples/
│ │ ├── resize.bat
│ │ └── resize.sh
│ ├── index.rst
│ ├── integrations/
│ │ ├── index.rst
│ │ ├── isaac-lab.rst
│ │ └── mujoco.rst
│ ├── make.bat
│ ├── migration.rst
│ ├── print_api.py
│ ├── serve.py
│ └── tutorials/
│ └── 00_introduction.ipynb
├── newton/
│ ├── __init__.py
│ ├── _src/
│ │ ├── core/
│ │ │ ├── __init__.py
│ │ │ └── types.py
│ │ ├── geometry/
│ │ │ ├── __init__.py
│ │ │ ├── broad_phase_common.py
│ │ │ ├── broad_phase_nxn.py
│ │ │ ├── broad_phase_sap.py
│ │ │ ├── collision_convex.py
│ │ │ ├── collision_core.py
│ │ │ ├── collision_primitive.py
│ │ │ ├── contact_data.py
│ │ │ ├── contact_reduction.py
│ │ │ ├── contact_reduction_global.py
│ │ │ ├── contact_reduction_hydroelastic.py
│ │ │ ├── differentiable_contacts.py
│ │ │ ├── flags.py
│ │ │ ├── hashtable.py
│ │ │ ├── inertia.py
│ │ │ ├── kernels.py
│ │ │ ├── mpr.py
│ │ │ ├── multicontact.py
│ │ │ ├── narrow_phase.py
│ │ │ ├── raycast.py
│ │ │ ├── remesh.py
│ │ │ ├── sdf_contact.py
│ │ │ ├── sdf_hydroelastic.py
│ │ │ ├── sdf_mc.py
│ │ │ ├── sdf_texture.py
│ │ │ ├── sdf_utils.py
│ │ │ ├── simplex_solver.py
│ │ │ ├── support_function.py
│ │ │ ├── terrain_generator.py
│ │ │ ├── types.py
│ │ │ └── utils.py
│ │ ├── math/
│ │ │ ├── __init__.py
│ │ │ └── spatial.py
│ │ ├── sensors/
│ │ │ ├── __init__.py
│ │ │ ├── sensor_contact.py
│ │ │ ├── sensor_frame_transform.py
│ │ │ ├── sensor_imu.py
│ │ │ ├── sensor_raycast.py
│ │ │ ├── sensor_tiled_camera.py
│ │ │ └── warp_raytrace/
│ │ │ ├── __init__.py
│ │ │ ├── bvh.py
│ │ │ ├── gaussians.py
│ │ │ ├── lighting.py
│ │ │ ├── ray_intersect.py
│ │ │ ├── raytrace.py
│ │ │ ├── render.py
│ │ │ ├── render_context.py
│ │ │ ├── textures.py
│ │ │ ├── tiling.py
│ │ │ ├── types.py
│ │ │ └── utils.py
│ │ ├── sim/
│ │ │ ├── __init__.py
│ │ │ ├── articulation.py
│ │ │ ├── builder.py
│ │ │ ├── collide.py
│ │ │ ├── contacts.py
│ │ │ ├── control.py
│ │ │ ├── enums.py
│ │ │ ├── graph_coloring.py
│ │ │ ├── ik/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── ik_common.py
│ │ │ │ ├── ik_lbfgs_optimizer.py
│ │ │ │ ├── ik_lm_optimizer.py
│ │ │ │ ├── ik_objectives.py
│ │ │ │ └── ik_solver.py
│ │ │ ├── model.py
│ │ │ └── state.py
│ │ ├── solvers/
│ │ │ ├── __init__.py
│ │ │ ├── featherstone/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── kernels.py
│ │ │ │ └── solver_featherstone.py
│ │ │ ├── flags.py
│ │ │ ├── implicit_mpm/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── contact_solver_kernels.py
│ │ │ │ ├── implicit_mpm_model.py
│ │ │ │ ├── implicit_mpm_solver_kernels.py
│ │ │ │ ├── rasterized_collisions.py
│ │ │ │ ├── render_grains.py
│ │ │ │ ├── rheology_solver_kernels.py
│ │ │ │ ├── solve_rheology.py
│ │ │ │ └── solver_implicit_mpm.py
│ │ │ ├── kamino/
│ │ │ │ ├── README.md
│ │ │ │ ├── __init__.py
│ │ │ │ ├── _src/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── core/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── bodies.py
│ │ │ │ │ │ ├── builder.py
│ │ │ │ │ │ ├── control.py
│ │ │ │ │ │ ├── conversions.py
│ │ │ │ │ │ ├── data.py
│ │ │ │ │ │ ├── geometry.py
│ │ │ │ │ │ ├── gravity.py
│ │ │ │ │ │ ├── inertia.py
│ │ │ │ │ │ ├── joints.py
│ │ │ │ │ │ ├── materials.py
│ │ │ │ │ │ ├── math.py
│ │ │ │ │ │ ├── model.py
│ │ │ │ │ │ ├── shapes.py
│ │ │ │ │ │ ├── size.py
│ │ │ │ │ │ ├── state.py
│ │ │ │ │ │ ├── time.py
│ │ │ │ │ │ ├── types.py
│ │ │ │ │ │ └── world.py
│ │ │ │ │ ├── dynamics/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── delassus.py
│ │ │ │ │ │ ├── dual.py
│ │ │ │ │ │ └── wrenches.py
│ │ │ │ │ ├── geometry/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── aggregation.py
│ │ │ │ │ │ ├── contacts.py
│ │ │ │ │ │ ├── detector.py
│ │ │ │ │ │ ├── keying.py
│ │ │ │ │ │ ├── primitive/
│ │ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ │ ├── broadphase.py
│ │ │ │ │ │ │ ├── narrowphase.py
│ │ │ │ │ │ │ └── pipeline.py
│ │ │ │ │ │ └── unified.py
│ │ │ │ │ ├── integrators/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── euler.py
│ │ │ │ │ │ ├── integrator.py
│ │ │ │ │ │ └── moreau.py
│ │ │ │ │ ├── kinematics/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── constraints.py
│ │ │ │ │ │ ├── jacobians.py
│ │ │ │ │ │ ├── joints.py
│ │ │ │ │ │ ├── limits.py
│ │ │ │ │ │ └── resets.py
│ │ │ │ │ ├── linalg/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── blas.py
│ │ │ │ │ │ ├── conjugate.py
│ │ │ │ │ │ ├── core.py
│ │ │ │ │ │ ├── factorize/
│ │ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ │ ├── llt_blocked.py
│ │ │ │ │ │ │ ├── llt_blocked_semi_sparse.py
│ │ │ │ │ │ │ └── llt_sequential.py
│ │ │ │ │ │ ├── linear.py
│ │ │ │ │ │ ├── sparse_matrix.py
│ │ │ │ │ │ ├── sparse_operator.py
│ │ │ │ │ │ └── utils/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── matrix.py
│ │ │ │ │ │ ├── rand.py
│ │ │ │ │ │ └── range.py
│ │ │ │ │ ├── models/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── assets/
│ │ │ │ │ │ │ ├── basics/
│ │ │ │ │ │ │ │ ├── box_on_plane.usda
│ │ │ │ │ │ │ │ ├── box_pendulum.usda
│ │ │ │ │ │ │ │ ├── boxes_fourbar.usda
│ │ │ │ │ │ │ │ ├── boxes_hinged.usda
│ │ │ │ │ │ │ │ ├── boxes_nunchaku.usda
│ │ │ │ │ │ │ │ └── cartpole.usda
│ │ │ │ │ │ │ └── testing/
│ │ │ │ │ │ │ ├── geoms/
│ │ │ │ │ │ │ │ ├── test_geom_box.usda
│ │ │ │ │ │ │ │ ├── test_geom_capsule.usda
│ │ │ │ │ │ │ │ ├── test_geom_cone.usda
│ │ │ │ │ │ │ │ ├── test_geom_cylinder.usda
│ │ │ │ │ │ │ │ ├── test_geom_ellipsoid.usda
│ │ │ │ │ │ │ │ └── test_geom_sphere.usda
│ │ │ │ │ │ │ └── joints/
│ │ │ │ │ │ │ ├── test_joint_cartesian_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_cartesian_actuated_unary.usda
│ │ │ │ │ │ │ ├── test_joint_cartesian_passive.usda
│ │ │ │ │ │ │ ├── test_joint_cartesian_passive_unary.usda
│ │ │ │ │ │ │ ├── test_joint_cylindrical_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_cylindrical_actuated_unary.usda
│ │ │ │ │ │ │ ├── test_joint_cylindrical_passive.usda
│ │ │ │ │ │ │ ├── test_joint_cylindrical_passive_unary.usda
│ │ │ │ │ │ │ ├── test_joint_d6_6dof_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_d6_6dof_passive.usda
│ │ │ │ │ │ │ ├── test_joint_d6_cartesian_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_d6_cartesian_passive.usda
│ │ │ │ │ │ │ ├── test_joint_d6_cylindrical_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_d6_cylindrical_passive.usda
│ │ │ │ │ │ │ ├── test_joint_d6_prismatic_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_d6_prismatic_passive.usda
│ │ │ │ │ │ │ ├── test_joint_d6_revolute_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_d6_revolute_passive.usda
│ │ │ │ │ │ │ ├── test_joint_d6_spherical_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_d6_spherical_passive.usda
│ │ │ │ │ │ │ ├── test_joint_d6_universal_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_d6_universal_passive.usda
│ │ │ │ │ │ │ ├── test_joint_fixed.usda
│ │ │ │ │ │ │ ├── test_joint_fixed_unary.usda
│ │ │ │ │ │ │ ├── test_joint_prismatic_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_prismatic_actuated_unary.usda
│ │ │ │ │ │ │ ├── test_joint_prismatic_passive.usda
│ │ │ │ │ │ │ ├── test_joint_prismatic_passive_unary.usda
│ │ │ │ │ │ │ ├── test_joint_revolute_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_revolute_actuated_unary.usda
│ │ │ │ │ │ │ ├── test_joint_revolute_passive.usda
│ │ │ │ │ │ │ ├── test_joint_revolute_passive_unary.usda
│ │ │ │ │ │ │ ├── test_joint_spherical.usda
│ │ │ │ │ │ │ ├── test_joint_spherical_unary.usda
│ │ │ │ │ │ │ ├── test_joint_universal_actuated.usda
│ │ │ │ │ │ │ ├── test_joint_universal_actuated_unary.usda
│ │ │ │ │ │ │ ├── test_joint_universal_passive.usda
│ │ │ │ │ │ │ └── test_joint_universal_passive_unary.usda
│ │ │ │ │ │ └── builders/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── basics.py
│ │ │ │ │ │ ├── basics_newton.py
│ │ │ │ │ │ ├── testing.py
│ │ │ │ │ │ └── utils.py
│ │ │ │ │ ├── solver_kamino_impl.py
│ │ │ │ │ ├── solvers/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── fk.py
│ │ │ │ │ │ ├── metrics.py
│ │ │ │ │ │ ├── padmm/
│ │ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ │ ├── kernels.py
│ │ │ │ │ │ │ ├── math.py
│ │ │ │ │ │ │ ├── solver.py
│ │ │ │ │ │ │ └── types.py
│ │ │ │ │ │ └── warmstart.py
│ │ │ │ │ └── utils/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── benchmark/
│ │ │ │ │ │ ├── .gitignore
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── __main__.py
│ │ │ │ │ │ ├── configs.py
│ │ │ │ │ │ ├── metrics.py
│ │ │ │ │ │ ├── problems.py
│ │ │ │ │ │ ├── render.py
│ │ │ │ │ │ └── runner.py
│ │ │ │ │ ├── control/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── animation.py
│ │ │ │ │ │ ├── pid.py
│ │ │ │ │ │ └── rand.py
│ │ │ │ │ ├── device.py
│ │ │ │ │ ├── io/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ └── usd.py
│ │ │ │ │ ├── logger.py
│ │ │ │ │ ├── profiles.py
│ │ │ │ │ ├── sim/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── datalog.py
│ │ │ │ │ │ ├── runner.py
│ │ │ │ │ │ ├── simulator.py
│ │ │ │ │ │ └── viewer.py
│ │ │ │ │ ├── sparse.py
│ │ │ │ │ └── viewer.py
│ │ │ │ ├── config.py
│ │ │ │ ├── examples/
│ │ │ │ │ ├── .gitignore
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── newton/
│ │ │ │ │ │ ├── example_anymal_d.py
│ │ │ │ │ │ ├── example_dr_legs.py
│ │ │ │ │ │ └── example_fourbar.py
│ │ │ │ │ ├── reset/
│ │ │ │ │ │ └── example_reset_dr_legs.py
│ │ │ │ │ ├── rl/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── camera_follow.py
│ │ │ │ │ │ ├── example_rl_bipedal.py
│ │ │ │ │ │ ├── example_rl_drlegs.py
│ │ │ │ │ │ ├── joystick.py
│ │ │ │ │ │ ├── observations.py
│ │ │ │ │ │ ├── simulation.py
│ │ │ │ │ │ ├── simulation_runner.py
│ │ │ │ │ │ ├── test_multi_env_dr_legs.py
│ │ │ │ │ │ └── utils.py
│ │ │ │ │ └── sim/
│ │ │ │ │ ├── example_sim_basics_all_heterogeneous.py
│ │ │ │ │ ├── example_sim_basics_box_on_plane.py
│ │ │ │ │ ├── example_sim_basics_box_pendulum.py
│ │ │ │ │ ├── example_sim_basics_boxes_fourbar.py
│ │ │ │ │ ├── example_sim_basics_boxes_hinged.py
│ │ │ │ │ ├── example_sim_basics_cartpole.py
│ │ │ │ │ ├── example_sim_dr_legs.py
│ │ │ │ │ ├── example_sim_dr_testmech.py
│ │ │ │ │ ├── example_sim_test_all_geoms.py
│ │ │ │ │ └── example_sim_test_all_joints.py
│ │ │ │ ├── solver_kamino.py
│ │ │ │ └── tests/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── README.md
│ │ │ │ ├── __init__.py
│ │ │ │ ├── __main__.py
│ │ │ │ ├── test_core_builder.py
│ │ │ │ ├── test_core_geometry.py
│ │ │ │ ├── test_core_joints.py
│ │ │ │ ├── test_core_materials.py
│ │ │ │ ├── test_core_model.py
│ │ │ │ ├── test_core_shapes.py
│ │ │ │ ├── test_core_world.py
│ │ │ │ ├── test_dynamics_delassus.py
│ │ │ │ ├── test_dynamics_dual.py
│ │ │ │ ├── test_dynamics_wrenches.py
│ │ │ │ ├── test_geometry_aggregation.py
│ │ │ │ ├── test_geometry_contacts.py
│ │ │ │ ├── test_geometry_detector.py
│ │ │ │ ├── test_geometry_keying.py
│ │ │ │ ├── test_geometry_margin_gap.py
│ │ │ │ ├── test_geometry_primitive.py
│ │ │ │ ├── test_geometry_unified.py
│ │ │ │ ├── test_kinematics_constraints.py
│ │ │ │ ├── test_kinematics_jacobians.py
│ │ │ │ ├── test_kinematics_joints.py
│ │ │ │ ├── test_kinematics_limits.py
│ │ │ │ ├── test_linalg_core.py
│ │ │ │ ├── test_linalg_factorize_llt_blocked.py
│ │ │ │ ├── test_linalg_factorize_llt_sequential.py
│ │ │ │ ├── test_linalg_solve_cg.py
│ │ │ │ ├── test_linalg_solver_llt_blocked.py
│ │ │ │ ├── test_linalg_solver_llt_sequential.py
│ │ │ │ ├── test_linalg_sparse.py
│ │ │ │ ├── test_linalg_utils_matrix.py
│ │ │ │ ├── test_linalg_utils_rand.py
│ │ │ │ ├── test_solver_kamino.py
│ │ │ │ ├── test_solvers_forward_kinematics.py
│ │ │ │ ├── test_solvers_metrics.py
│ │ │ │ ├── test_solvers_padmm.py
│ │ │ │ ├── test_utils_control_animation.py
│ │ │ │ ├── test_utils_control_pid.py
│ │ │ │ ├── test_utils_control_rand.py
│ │ │ │ ├── test_utils_io_usd.py
│ │ │ │ ├── test_utils_logger.py
│ │ │ │ ├── test_utils_profiles.py
│ │ │ │ ├── test_utils_random.py
│ │ │ │ ├── test_utils_sim_simulator.py
│ │ │ │ └── utils/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── checks.py
│ │ │ │ ├── diff_check.py
│ │ │ │ ├── extract.py
│ │ │ │ ├── make.py
│ │ │ │ ├── print.py
│ │ │ │ └── rand.py
│ │ │ ├── mujoco/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── kernels.py
│ │ │ │ └── solver_mujoco.py
│ │ │ ├── semi_implicit/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── kernels_body.py
│ │ │ │ ├── kernels_contact.py
│ │ │ │ ├── kernels_muscle.py
│ │ │ │ ├── kernels_particle.py
│ │ │ │ └── solver_semi_implicit.py
│ │ │ ├── solver.py
│ │ │ ├── style3d/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── builder.py
│ │ │ │ ├── cloth.py
│ │ │ │ ├── collision/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── bvh/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── bvh.py
│ │ │ │ │ │ └── kernels.py
│ │ │ │ │ ├── collision.py
│ │ │ │ │ ├── collision_legacy.py
│ │ │ │ │ └── kernels.py
│ │ │ │ ├── kernels.py
│ │ │ │ ├── linear_solver.py
│ │ │ │ └── solver_style3d.py
│ │ │ ├── vbd/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── particle_vbd_kernels.py
│ │ │ │ ├── rigid_vbd_kernels.py
│ │ │ │ ├── solver_vbd.py
│ │ │ │ └── tri_mesh_collision.py
│ │ │ └── xpbd/
│ │ │ ├── __init__.py
│ │ │ ├── kernels.py
│ │ │ └── solver_xpbd.py
│ │ ├── usd/
│ │ │ ├── __init__.py
│ │ │ ├── schema_resolver.py
│ │ │ ├── schemas.py
│ │ │ └── utils.py
│ │ ├── utils/
│ │ │ ├── __init__.py
│ │ │ ├── benchmark.py
│ │ │ ├── cable.py
│ │ │ ├── download_assets.py
│ │ │ ├── heightfield.py
│ │ │ ├── import_mjcf.py
│ │ │ ├── import_urdf.py
│ │ │ ├── import_usd.py
│ │ │ ├── import_utils.py
│ │ │ ├── mesh.py
│ │ │ ├── render.py
│ │ │ ├── selection.py
│ │ │ ├── texture.py
│ │ │ └── topology.py
│ │ └── viewer/
│ │ ├── __init__.py
│ │ ├── camera.py
│ │ ├── gl/
│ │ │ ├── gui.py
│ │ │ ├── icon.py
│ │ │ ├── opengl.py
│ │ │ └── shaders.py
│ │ ├── kernels.py
│ │ ├── picking.py
│ │ ├── viewer.py
│ │ ├── viewer_file.py
│ │ ├── viewer_gl.py
│ │ ├── viewer_null.py
│ │ ├── viewer_rerun.py
│ │ ├── viewer_usd.py
│ │ ├── viewer_viser.py
│ │ ├── viser/
│ │ │ └── static/
│ │ │ ├── assets/
│ │ │ │ ├── Sorter-Df0J3ZWJ.wasm
│ │ │ │ ├── SplatSortWorker-DiSpcAPr.js
│ │ │ │ ├── WebsocketServerWorker-C6PJJ7Dx.js
│ │ │ │ ├── __vite-browser-external-BIHI7g3E.js
│ │ │ │ ├── index-BVvA0mmR.css
│ │ │ │ └── index-H4DT9vxj.js
│ │ │ ├── index.html
│ │ │ ├── manifest.json
│ │ │ └── robots.txt
│ │ └── wind.py
│ ├── _version.py
│ ├── examples/
│ │ ├── __init__.py
│ │ ├── __main__.py
│ │ ├── assets/
│ │ │ ├── ant.usda
│ │ │ ├── anymal_walking_policy.pt
│ │ │ ├── axis_cube.usda
│ │ │ ├── bear.usd
│ │ │ ├── boxes_fourbar.usda
│ │ │ ├── bunny.usd
│ │ │ ├── cartpole.urdf
│ │ │ ├── cartpole.usda
│ │ │ ├── cartpole_single_pendulum.usda
│ │ │ ├── crazyflie.usd
│ │ │ ├── curvedSurface.usd
│ │ │ ├── humanoid.usda
│ │ │ ├── nv_ant.xml
│ │ │ ├── nv_humanoid.xml
│ │ │ ├── quadruped.urdf
│ │ │ ├── rj45_plug.usd
│ │ │ ├── sensor_contact_scene.usda
│ │ │ ├── tabletop.xml
│ │ │ └── unisex_shirt.usd
│ │ ├── basic/
│ │ │ ├── example_basic_conveyor.py
│ │ │ ├── example_basic_heightfield.py
│ │ │ ├── example_basic_joints.py
│ │ │ ├── example_basic_pendulum.py
│ │ │ ├── example_basic_plotting.py
│ │ │ ├── example_basic_shapes.py
│ │ │ ├── example_basic_urdf.py
│ │ │ ├── example_basic_viewer.py
│ │ │ ├── example_recording.py
│ │ │ └── example_replay_viewer.py
│ │ ├── cable/
│ │ │ ├── example_cable_bundle_hysteresis.py
│ │ │ ├── example_cable_pile.py
│ │ │ ├── example_cable_twist.py
│ │ │ └── example_cable_y_junction.py
│ │ ├── cloth/
│ │ │ ├── example_cloth_bending.py
│ │ │ ├── example_cloth_franka.py
│ │ │ ├── example_cloth_h1.py
│ │ │ ├── example_cloth_hanging.py
│ │ │ ├── example_cloth_poker_cards.py
│ │ │ ├── example_cloth_rollers.py
│ │ │ ├── example_cloth_style3d.py
│ │ │ └── example_cloth_twist.py
│ │ ├── contacts/
│ │ │ ├── example_brick_stacking.py
│ │ │ ├── example_contacts_rj45_plug.py
│ │ │ ├── example_nut_bolt_hydro.py
│ │ │ ├── example_nut_bolt_sdf.py
│ │ │ └── example_pyramid.py
│ │ ├── diffsim/
│ │ │ ├── example_diffsim_ball.py
│ │ │ ├── example_diffsim_bear.py
│ │ │ ├── example_diffsim_cloth.py
│ │ │ ├── example_diffsim_drone.py
│ │ │ ├── example_diffsim_soft_body.py
│ │ │ └── example_diffsim_spring_cage.py
│ │ ├── ik/
│ │ │ ├── example_ik_cube_stacking.py
│ │ │ ├── example_ik_custom.py
│ │ │ ├── example_ik_franka.py
│ │ │ └── example_ik_h1.py
│ │ ├── mpm/
│ │ │ ├── example_mpm_anymal.py
│ │ │ ├── example_mpm_beam_twist.py
│ │ │ ├── example_mpm_grain_rendering.py
│ │ │ ├── example_mpm_granular.py
│ │ │ ├── example_mpm_multi_material.py
│ │ │ ├── example_mpm_snow_ball.py
│ │ │ ├── example_mpm_twoway_coupling.py
│ │ │ └── example_mpm_viscous.py
│ │ ├── multiphysics/
│ │ │ ├── example_softbody_dropping_to_cloth.py
│ │ │ └── example_softbody_gift.py
│ │ ├── robot/
│ │ │ ├── example_robot_allegro_hand.py
│ │ │ ├── example_robot_anymal_c_walk.py
│ │ │ ├── example_robot_anymal_d.py
│ │ │ ├── example_robot_cartpole.py
│ │ │ ├── example_robot_g1.py
│ │ │ ├── example_robot_h1.py
│ │ │ ├── example_robot_panda_hydro.py
│ │ │ ├── example_robot_policy.py
│ │ │ └── example_robot_ur10.py
│ │ ├── selection/
│ │ │ ├── example_selection_articulations.py
│ │ │ ├── example_selection_cartpole.py
│ │ │ ├── example_selection_materials.py
│ │ │ └── example_selection_multiple.py
│ │ ├── sensors/
│ │ │ ├── example_sensor_contact.py
│ │ │ ├── example_sensor_imu.py
│ │ │ └── example_sensor_tiled_camera.py
│ │ └── softbody/
│ │ ├── example_softbody_franka.py
│ │ └── example_softbody_hanging.py
│ ├── geometry.py
│ ├── ik.py
│ ├── licenses/
│ │ ├── CC-BY-4.0.txt
│ │ ├── unittest-parallel-LICENSE.txt
│ │ └── viser_and_inter-font-family.txt
│ ├── math.py
│ ├── py.typed
│ ├── selection.py
│ ├── sensors.py
│ ├── solvers.py
│ ├── tests/
│ │ ├── __init__.py
│ │ ├── __main__.py
│ │ ├── assets/
│ │ │ ├── actuator_test.usda
│ │ │ ├── ant.usda
│ │ │ ├── ant_mixed.usda
│ │ │ ├── ant_multi.usda
│ │ │ ├── cartpole_mjc.usda
│ │ │ ├── constraints.xml
│ │ │ ├── cube_cylinder.usda
│ │ │ ├── four_link_chain_articulation.usda
│ │ │ ├── humanoid.urdf
│ │ │ ├── humanoid.usda
│ │ │ ├── mjcf_exclude_hyphen_test.xml
│ │ │ ├── mjcf_exclude_test.xml
│ │ │ ├── pendulum_revolute_vs_d6.usda
│ │ │ ├── revolute_articulation.usda
│ │ │ ├── simple_articulation_with_mesh.usda
│ │ │ ├── tetmesh_custom_attrs.usda
│ │ │ ├── tetmesh_multi.usda
│ │ │ ├── tetmesh_simple.usda
│ │ │ └── tetmesh_with_material.usda
│ │ ├── golden_data/
│ │ │ └── test_sensor_tiled_camera/
│ │ │ ├── color.npy
│ │ │ └── depth.npy
│ │ ├── test_actuators.py
│ │ ├── test_anymal_reset.py
│ │ ├── test_api.py
│ │ ├── test_body_force.py
│ │ ├── test_body_velocity.py
│ │ ├── test_broad_phase.py
│ │ ├── test_cable.py
│ │ ├── test_cloth.py
│ │ ├── test_collision_cloth.py
│ │ ├── test_collision_pipeline.py
│ │ ├── test_collision_primitives.py
│ │ ├── test_coloring.py
│ │ ├── test_cone_orientation.py
│ │ ├── test_contact_reduction.py
│ │ ├── test_contact_reduction_global.py
│ │ ├── test_control_force.py
│ │ ├── test_custom_attributes.py
│ │ ├── test_differentiable_contacts.py
│ │ ├── test_download_assets.py
│ │ ├── test_environment_group_collision.py
│ │ ├── test_equality_constraints.py
│ │ ├── test_example_browser.py
│ │ ├── test_examples.py
│ │ ├── test_fixed_tendon.py
│ │ ├── test_gjk.py
│ │ ├── test_hashtable.py
│ │ ├── test_heightfield.py
│ │ ├── test_hydroelastic.py
│ │ ├── test_ik.py
│ │ ├── test_ik_fk_kernels.py
│ │ ├── test_ik_lbfgs.py
│ │ ├── test_implicit_mpm.py
│ │ ├── test_implicit_mpm_flow_rule.py
│ │ ├── test_import_mjcf.py
│ │ ├── test_import_urdf.py
│ │ ├── test_import_usd.py
│ │ ├── test_inertia.py
│ │ ├── test_inertia_validation.py
│ │ ├── test_jacobian_mass_matrix.py
│ │ ├── test_joint_controllers.py
│ │ ├── test_joint_drive.py
│ │ ├── test_joint_limits.py
│ │ ├── test_kinematic_links.py
│ │ ├── test_kinematics.py
│ │ ├── test_match_labels.py
│ │ ├── test_menagerie_mujoco.py
│ │ ├── test_menagerie_usd_mujoco.py
│ │ ├── test_mesh_aabb.py
│ │ ├── test_model.py
│ │ ├── test_mujoco_general_actuators.py
│ │ ├── test_mujoco_solver.py
│ │ ├── test_narrow_phase.py
│ │ ├── test_obb.py
│ │ ├── test_parent_force.py
│ │ ├── test_pendulum_revolute_vs_d6.py
│ │ ├── test_physics_validation.py
│ │ ├── test_raycast.py
│ │ ├── test_recorder.py
│ │ ├── test_remesh.py
│ │ ├── test_rigid_contact.py
│ │ ├── test_robot_composer.py
│ │ ├── test_runtime_gravity.py
│ │ ├── test_schema_resolver.py
│ │ ├── test_sdf_compute.py
│ │ ├── test_sdf_primitive.py
│ │ ├── test_sdf_texture.py
│ │ ├── test_selection.py
│ │ ├── test_sensor_contact.py
│ │ ├── test_sensor_frame_transform.py
│ │ ├── test_sensor_imu.py
│ │ ├── test_sensor_raycast.py
│ │ ├── test_sensor_tiled_camera.py
│ │ ├── test_sensor_tiled_camera_forward_depth.py
│ │ ├── test_sensor_tiled_camera_particles_multiworld.py
│ │ ├── test_shape_colors.py
│ │ ├── test_shapes_no_bounce.py
│ │ ├── test_sites.py
│ │ ├── test_sites_mjcf_import.py
│ │ ├── test_sites_mujoco_export.py
│ │ ├── test_sites_usd_import.py
│ │ ├── test_softbody.py
│ │ ├── test_solver_vbd.py
│ │ ├── test_solver_xpbd.py
│ │ ├── test_spatial_tendon.py
│ │ ├── test_terrain_generator.py
│ │ ├── test_tolerance_clamping.py
│ │ ├── test_up_axis.py
│ │ ├── test_viewer_geometry_batching.py
│ │ ├── test_viewer_log_shapes.py
│ │ ├── test_viewer_particle_flags.py
│ │ ├── test_viewer_picking.py
│ │ ├── test_viewer_rerun_hidden.py
│ │ ├── test_viewer_rerun_init_args.py
│ │ ├── test_viewer_usd.py
│ │ ├── test_viewer_world_offsets.py
│ │ ├── test_warp_config_cli.py
│ │ ├── thirdparty/
│ │ │ ├── __init__.py
│ │ │ └── unittest_parallel.py
│ │ └── unittest_utils.py
│ ├── usd.py
│ ├── utils.py
│ └── viewer.py
├── pyproject.toml
└── scripts/
├── check_warp_array_syntax.py
└── ci/
├── dispatch_workflow_and_wait.py
└── update_docs_switcher.py
Showing preview only (1,364K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (14598 symbols across 479 files)
FILE: asv/benchmarks/benchmark_ik.py
function create_franka_model (line 21) | def create_franka_model() -> newton.Model:
function random_solutions (line 30) | def random_solutions(model: newton.Model, n: int, rng: np.random.Generat...
function build_ik_solver (line 42) | def build_ik_solver(model: newton.Model, n_problems: int, ee_links: tupl...
function fk_targets (line 80) | def fk_targets(solver, model: newton.Model, q_batch: np.ndarray, ee_link...
function eval_success (line 95) | def eval_success(solver, model, q_best, tgt_pos, tgt_rot, ee_links, pos_...
FILE: asv/benchmarks/benchmark_mujoco.py
function _setup_humanoid (line 97) | def _setup_humanoid(articulation_builder):
function _setup_g1 (line 113) | def _setup_g1(articulation_builder):
function _setup_h1 (line 144) | def _setup_h1(articulation_builder):
function _setup_cartpole (line 174) | def _setup_cartpole(articulation_builder):
function _setup_ant (line 197) | def _setup_ant(articulation_builder):
function _setup_quadruped (line 210) | def _setup_quadruped(articulation_builder):
function _setup_allegro (line 230) | def _setup_allegro(articulation_builder):
function _setup_kitchen (line 250) | def _setup_kitchen(articulation_builder):
function _setup_tabletop (line 263) | def _setup_tabletop(articulation_builder):
class Example (line 270) | class Example:
method __init__ (line 271) | def __init__(
method simulate (line 365) | def simulate(self):
method step (line 374) | def step(self):
method render (line 391) | def render(self):
method create_model_builder (line 400) | def create_model_builder(robot, world_count, environment="None", rando...
method create_solver (line 445) | def create_solver(
function print_trace (line 486) | def print_trace(trace, indent, steps):
FILE: asv/benchmarks/compilation/bench_example_load.py
class SlowExampleRobotAnymal (line 15) | class SlowExampleRobotAnymal:
method setup (line 21) | def setup(self):
method time_load (line 26) | def time_load(self):
class SlowExampleRobotCartpole (line 43) | class SlowExampleRobotCartpole:
method setup (line 49) | def setup(self):
method time_load (line 54) | def time_load(self):
class SlowExampleClothFranka (line 71) | class SlowExampleClothFranka:
method setup (line 76) | def setup(self):
method time_load (line 81) | def time_load(self):
class SlowExampleClothTwist (line 98) | class SlowExampleClothTwist:
method setup (line 103) | def setup(self):
method time_load (line 108) | def time_load(self):
class SlowExampleBasicUrdf (line 125) | class SlowExampleBasicUrdf:
method setup (line 131) | def setup(self):
method time_load (line 136) | def time_load(self):
FILE: asv/benchmarks/setup/bench_model.py
class KpiInitializeModel (line 26) | class KpiInitializeModel:
method setup (line 36) | def setup(self, robot, world_count):
method time_initialize_model (line 40) | def time_initialize_model(self, robot, world_count):
class KpiInitializeSolver (line 48) | class KpiInitializeSolver:
method setup (line 58) | def setup(self, robot, world_count):
method time_initialize_solver (line 66) | def time_initialize_solver(self, robot, world_count):
method teardown (line 70) | def teardown(self, robot, world_count):
class KpiInitializeViewerGL (line 75) | class KpiInitializeViewerGL:
method setup (line 84) | def setup(self, robot, world_count):
method time_initialize_renderer (line 92) | def time_initialize_renderer(self, robot, world_count):
method teardown (line 100) | def teardown(self, robot, world_count):
class FastInitializeModel (line 104) | class FastInitializeModel:
method setup_cache (line 113) | def setup_cache(self):
method time_initialize_model (line 122) | def time_initialize_model(self, robot, world_count):
method peakmem_initialize_model_cpu (line 129) | def peakmem_initialize_model_cpu(self, robot, world_count):
class FastInitializeSolver (line 141) | class FastInitializeSolver:
method setup (line 150) | def setup(self, robot, world_count):
method time_initialize_solver (line 158) | def time_initialize_solver(self, robot, world_count):
method teardown (line 162) | def teardown(self, robot, world_count):
class FastInitializeViewerGL (line 167) | class FastInitializeViewerGL:
method setup (line 176) | def setup(self, robot, world_count):
method time_initialize_renderer (line 184) | def time_initialize_renderer(self, robot, world_count):
method teardown (line 192) | def teardown(self, robot, world_count):
FILE: asv/benchmarks/simulation/bench_anymal.py
class FastExampleAnymalPretrained (line 15) | class FastExampleAnymalPretrained:
method setup (line 19) | def setup(self):
method time_simulate (line 28) | def time_simulate(self):
FILE: asv/benchmarks/simulation/bench_cable.py
class FastExampleCablePile (line 15) | class FastExampleCablePile:
method setup (line 20) | def setup(self):
method time_simulate (line 30) | def time_simulate(self):
FILE: asv/benchmarks/simulation/bench_cloth.py
class FastExampleClothManipulation (line 15) | class FastExampleClothManipulation:
method setup (line 20) | def setup(self):
method time_simulate (line 29) | def time_simulate(self):
class FastExampleClothTwist (line 35) | class FastExampleClothTwist:
method setup (line 39) | def setup(self):
method time_simulate (line 48) | def time_simulate(self):
FILE: asv/benchmarks/simulation/bench_contacts.py
function _import_example_class (line 24) | def _import_example_class(module_names: list[str]):
class FastExampleContactSdfDefaults (line 46) | class FastExampleContactSdfDefaults:
method setup_cache (line 52) | def setup_cache(self):
method setup (line 55) | def setup(self):
method time_simulate (line 76) | def time_simulate(self):
class FastExampleContactHydroWorkingDefaults (line 82) | class FastExampleContactHydroWorkingDefaults:
method setup_cache (line 88) | def setup_cache(self):
method setup (line 91) | def setup(self):
method time_simulate (line 112) | def time_simulate(self):
class FastExampleContactPyramidDefaults (line 118) | class FastExampleContactPyramidDefaults:
method setup (line 124) | def setup(self):
method time_simulate (line 142) | def time_simulate(self):
FILE: asv/benchmarks/simulation/bench_heightfield.py
function _build_heightfield_scene (line 15) | def _build_heightfield_scene(num_bodies=200, nrow=100, ncol=100):
class HeightfieldCollision (line 49) | class HeightfieldCollision:
method setup (line 55) | def setup(self):
method time_simulate (line 83) | def time_simulate(self):
FILE: asv/benchmarks/simulation/bench_ik.py
class _IKBenchmark (line 22) | class _IKBenchmark:
method setup (line 39) | def setup(self, batch_size):
method time_solve (line 68) | def time_solve(self, batch_size):
method teardown (line 73) | def teardown(self, batch_size):
class FastIKSolve (line 90) | class FastIKSolve(_IKBenchmark):
FILE: asv/benchmarks/simulation/bench_mujoco.py
function apply_random_control (line 23) | def apply_random_control(state: wp.uint32, joint_target: wp.array[float]):
class _FastBenchmark (line 29) | class _FastBenchmark:
method setup (line 41) | def setup(self):
method time_simulate (line 78) | def time_simulate(self):
class _KpiBenchmark (line 84) | class _KpiBenchmark:
method setup (line 96) | def setup(self, world_count):
method track_simulate (line 105) | def track_simulate(self, world_count):
class _NewtonOverheadBenchmark (line 131) | class _NewtonOverheadBenchmark:
method setup (line 142) | def setup(self, world_count):
method track_simulate (line 151) | def track_simulate(self, world_count):
class FastCartpole (line 180) | class FastCartpole(_FastBenchmark):
class KpiCartpole (line 189) | class KpiCartpole(_KpiBenchmark):
class FastG1 (line 199) | class FastG1(_FastBenchmark):
class KpiG1 (line 208) | class KpiG1(_KpiBenchmark):
class FastNewtonOverheadG1 (line 219) | class FastNewtonOverheadG1(_NewtonOverheadBenchmark):
class KpiNewtonOverheadG1 (line 228) | class KpiNewtonOverheadG1(_NewtonOverheadBenchmark):
class FastHumanoid (line 238) | class FastHumanoid(_FastBenchmark):
class KpiHumanoid (line 247) | class KpiHumanoid(_KpiBenchmark):
class FastNewtonOverheadHumanoid (line 257) | class FastNewtonOverheadHumanoid(_NewtonOverheadBenchmark):
class KpiNewtonOverheadHumanoid (line 266) | class KpiNewtonOverheadHumanoid(_NewtonOverheadBenchmark):
class FastAllegro (line 275) | class FastAllegro(_FastBenchmark):
class KpiAllegro (line 284) | class KpiAllegro(_KpiBenchmark):
class FastKitchenG1 (line 294) | class FastKitchenG1(_FastBenchmark):
class KpiKitchenG1 (line 303) | class KpiKitchenG1(_KpiBenchmark):
FILE: asv/benchmarks/simulation/bench_quadruped_xpbd.py
class FastExampleQuadrupedXPBD (line 15) | class FastExampleQuadrupedXPBD:
method setup (line 19) | def setup(self):
method time_simulate (line 29) | def time_simulate(self):
FILE: asv/benchmarks/simulation/bench_selection.py
class FastExampleSelectionCartpoleMuJoCo (line 15) | class FastExampleSelectionCartpoleMuJoCo:
method setup (line 19) | def setup(self):
method time_simulate (line 30) | def time_simulate(self):
FILE: asv/benchmarks/simulation/bench_sensor_tiled_camera.py
function nice_name (line 18) | def nice_name(value):
function nice_name_collector (line 26) | def nice_name_collector():
class SensorTiledCameraBenchmark (line 37) | class SensorTiledCameraBenchmark:
method setup (line 41) | def setup(self, resolution: int, world_count: int, iterations: int):
method time_rendering_pixel_priority_color_depth (line 110) | def time_rendering_pixel_priority_color_depth(self, resolution: int, w...
method time_rendering_pixel_priority_color_only (line 125) | def time_rendering_pixel_priority_color_only(self, resolution: int, wo...
method time_rendering_pixel_priority_depth_only (line 139) | def time_rendering_pixel_priority_depth_only(self, resolution: int, wo...
method time_rendering_tiled_color_depth (line 153) | def time_rendering_tiled_color_depth(self, resolution: int, world_coun...
method time_rendering_tiled_color_only (line 170) | def time_rendering_tiled_color_only(self, resolution: int, world_count...
method time_rendering_tiled_depth_only (line 186) | def time_rendering_tiled_depth_only(self, resolution: int, world_count...
function print_fps (line 201) | def print_fps(name: str, duration: float, resolution: int, world_count: ...
function print_fps_results (line 214) | def print_fps_results(results: dict[tuple[str, tuple[int, int, int]], fl...
FILE: asv/benchmarks/simulation/bench_viewer.py
class KpiViewerGL (line 25) | class KpiViewerGL:
method setup (line 34) | def setup(self, robot, world_count):
method time_rendering_frame (line 47) | def time_rendering_frame(self, robot, world_count):
method teardown (line 54) | def teardown(self, robot, world_count):
class FastViewerGL (line 61) | class FastViewerGL:
method setup (line 70) | def setup(self, robot, world_count):
method time_rendering_frame (line 83) | def time_rendering_frame(self, robot, world_count):
method teardown (line 90) | def teardown(self, robot, world_count):
FILE: docs/_ext/autodoc_filter.py
function _should_skip_member (line 18) | def _should_skip_member(
function setup (line 89) | def setup(app): # type: ignore[override]
FILE: docs/_ext/autodoc_wpfunc.py
class WarpFunctionDocumenter (line 30) | class WarpFunctionDocumenter(FunctionDocumenter):
method _looks_like_warp_function (line 42) | def _looks_like_warp_function(obj: Any) -> bool:
method can_document_member (line 48) | def can_document_member(
method _unwrap (line 61) | def _unwrap(self):
method format_args (line 70) | def format_args(self):
method get_doc (line 74) | def get_doc(self, *args: Any, **kwargs: Any) -> list[list[str]]:
method add_directive_header (line 78) | def add_directive_header(self, sig: str) -> None:
function setup (line 88) | def setup(app): # type: ignore[override]
FILE: docs/conf.py
function linkcode_resolve (line 311) | def linkcode_resolve(domain: str, info: dict[str, str]) -> str | None:
function _copy_viser_client_into_output_static (line 394) | def _copy_viser_client_into_output_static(*, outdir: Path) -> None:
function _on_builder_inited (line 430) | def _on_builder_inited(_app: Any) -> None:
function setup (line 435) | def setup(app: Any) -> None:
FILE: docs/generate_api.py
function public_symbols (line 67) | def public_symbols(mod: ModuleType) -> list[str]:
function _is_solver_only_module (line 81) | def _is_solver_only_module(mod: ModuleType) -> bool:
function solver_submodule_pages (line 88) | def solver_submodule_pages() -> list[str]:
function write_module_page (line 113) | def write_module_page(mod_name: str) -> None:
function generate_all (line 285) | def generate_all() -> None:
FILE: docs/print_api.py
function public_symbols (line 8) | def public_symbols(mod) -> list[str]:
function get_symbols (line 22) | def get_symbols(mod_name: str):
function print_symbols (line 37) | def print_symbols(sym_dict, indent=0):
FILE: docs/serve.py
class CORSHTTPRequestHandler (line 36) | class CORSHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
method guess_type (line 59) | def guess_type(self, path):
method end_headers (line 70) | def end_headers(self):
method do_OPTIONS (line 77) | def do_OPTIONS(self):
function main (line 83) | def main():
FILE: newton/_src/core/types.py
function _override_noop (line 19) | def _override_noop(func: _F, /) -> _F:
function flag_to_int (line 41) | def flag_to_int(flag):
class Axis (line 81) | class Axis(IntEnum):
method from_string (line 92) | def from_string(cls, axis_str: str) -> Axis:
method from_any (line 115) | def from_any(cls, value: AxisType) -> Axis:
method __str__ (line 138) | def __str__(self):
method __repr__ (line 142) | def __repr__(self):
method __eq__ (line 146) | def __eq__(self, other):
method __hash__ (line 154) | def __hash__(self):
method to_vector (line 157) | def to_vector(self) -> tuple[float, float, float]:
method to_vec3 (line 171) | def to_vec3(self) -> wp.vec3:
method quat_between_axes (line 180) | def quat_between_axes(self, other: Axis) -> wp.quat:
function axis_to_vec3 (line 191) | def axis_to_vec3(axis: AxisType | Vec3) -> wp.vec3:
FILE: newton/_src/geometry/broad_phase_common.py
function check_aabb_overlap (line 19) | def check_aabb_overlap(
function binary_search (line 39) | def binary_search(values: wp.array[Any], value: Any, lower: int, upper: ...
function _vec2i_less (line 51) | def _vec2i_less(p: wp.vec2i, q: wp.vec2i) -> bool:
function _vec2i_equal (line 69) | def _vec2i_equal(p: wp.vec2i, q: wp.vec2i) -> bool:
function is_pair_excluded (line 83) | def is_pair_excluded(
function write_pair (line 117) | def write_pair(
function test_group_pair (line 133) | def test_group_pair(group_a: int, group_b: int) -> bool:
function test_world_and_group_pair (line 154) | def test_world_and_group_pair(world_a: int, world_b: int, collision_grou...
function precompute_world_map (line 183) | def precompute_world_map(shape_world: np.ndarray | list[int], shape_flag...
FILE: newton/_src/geometry/broad_phase_nxn.py
function _nxn_broadphase_precomputed_pairs (line 29) | def _nxn_broadphase_precomputed_pairs(
function _get_lower_triangular_indices (line 70) | def _get_lower_triangular_indices(index: int, matrix_size: int) -> tuple...
function _find_world_and_local_id (line 92) | def _find_world_and_local_id(
function _nxn_broadphase_kernel (line 130) | def _nxn_broadphase_kernel(
class BroadPhaseAllPairs (line 217) | class BroadPhaseAllPairs:
method __init__ (line 233) | def __init__(
method launch (line 305) | def launch(
class BroadPhaseExplicit (line 388) | class BroadPhaseExplicit:
method __init__ (line 399) | def __init__(self) -> None:
method launch (line 402) | def launch(
FILE: newton/_src/geometry/broad_phase_sap.py
function _normalize_sort_mode (line 36) | def _normalize_sort_mode(mode: str) -> SAPSortMode:
function _sap_project_aabb (line 44) | def _sap_project_aabb(
function binary_search_segment (line 67) | def binary_search_segment(
function _create_tile_sort_kernel (line 99) | def _create_tile_sort_kernel(tile_size: int):
function _sap_project_kernel (line 145) | def _sap_project_kernel(
function _sap_range_kernel (line 190) | def _sap_range_kernel(
function _process_single_sap_pair (line 243) | def _process_single_sap_pair(
function _sap_broadphase_kernel (line 285) | def _sap_broadphase_kernel(
class BroadPhaseSAP (line 397) | class BroadPhaseSAP:
method __init__ (line 405) | def __init__(
method launch (line 510) | def launch(
FILE: newton/_src/geometry/collision_convex.py
function create_solve_convex_multi_contact (line 26) | def create_solve_convex_multi_contact(support_func: Any, writer_func: An...
function create_solve_convex_single_contact (line 121) | def create_solve_convex_single_contact(support_func: Any, writer_func: A...
FILE: newton/_src/geometry/collision_core.py
function is_discrete_shape (line 38) | def is_discrete_shape(shape_type: int) -> bool:
function project_point_onto_plane (line 49) | def project_point_onto_plane(point: wp.vec3, plane_point: wp.vec3, plane...
function compute_plane_normal_from_contacts (line 68) | def compute_plane_normal_from_contacts(
function no_post_process_contact (line 130) | def no_post_process_contact(
function post_process_minkowski_only (line 143) | def post_process_minkowski_only(
function post_process_axial_on_discrete_contact (line 171) | def post_process_axial_on_discrete_contact(
function create_compute_gjk_mpr_contacts (line 276) | def create_compute_gjk_mpr_contacts(
function compute_tight_aabb_from_support (line 394) | def compute_tight_aabb_from_support(
function compute_bounding_sphere_from_aabb (line 492) | def compute_bounding_sphere_from_aabb(aabb_lower: wp.vec3, aabb_upper: w...
function convert_infinite_plane_to_cube (line 506) | def convert_infinite_plane_to_cube(
function check_infinite_plane_bsphere_overlap (line 568) | def check_infinite_plane_bsphere_overlap(
function create_find_contacts (line 623) | def create_find_contacts(writer_func: Any, support_func: Any = None, pos...
function pre_contact_check (line 726) | def pre_contact_check(
function mesh_vs_convex_midphase (line 855) | def mesh_vs_convex_midphase(
function find_pair_from_cumulative_index (line 969) | def find_pair_from_cumulative_index(
function get_triangle_shape_from_mesh (line 1003) | def get_triangle_shape_from_mesh(
function get_box_axes (line 1056) | def get_box_axes(q: wp.quat) -> wp.mat33:
function project_box_onto_axis (line 1072) | def project_box_onto_axis(transform: wp.transform, extents: wp.vec3, axi...
function test_axis_separation (line 1090) | def test_axis_separation(
function sat_box_intersection (line 1110) | def sat_box_intersection(
FILE: newton/_src/geometry/collision_primitive.py
function closest_segment_point (line 49) | def closest_segment_point(a: wp.vec3, b: wp.vec3, pt: wp.vec3) -> wp.vec3:
function closest_segment_point_and_dist (line 57) | def closest_segment_point_and_dist(a: wp.vec3, b: wp.vec3, pt: wp.vec3) ...
function closest_segment_to_segment_points (line 65) | def closest_segment_to_segment_points(a0: wp.vec3, a1: wp.vec3, b0: wp.v...
function collide_plane_sphere (line 101) | def collide_plane_sphere(
function collide_sphere_sphere (line 111) | def collide_sphere_sphere(
function collide_sphere_capsule (line 144) | def collide_sphere_capsule(
function collide_capsule_capsule (line 181) | def collide_capsule_capsule(
function collide_plane_capsule (line 279) | def collide_plane_capsule(
function collide_plane_ellipsoid (line 334) | def collide_plane_ellipsoid(
function collide_plane_box (line 366) | def collide_plane_box(
function collide_sphere_cylinder (line 443) | def collide_sphere_cylinder(
function collide_plane_cylinder (line 516) | def collide_plane_cylinder(
function _compute_rotmore (line 672) | def _compute_rotmore(face_idx: int) -> wp.mat33:
function collide_box_box (line 704) | def collide_box_box(
function collide_sphere_box (line 1162) | def collide_sphere_box(
function collide_capsule_box (line 1219) | def collide_capsule_box(
FILE: newton/_src/geometry/contact_data.py
class ContactData (line 18) | class ContactData:
function contact_passes_gap_check (line 58) | def contact_passes_gap_check(
FILE: newton/_src/geometry/contact_reduction.py
function float_flip (line 109) | def float_flip(f: float) -> wp.uint32: ...
function synchronize (line 117) | def synchronize(): ...
function get_slot (line 219) | def get_slot(normal: wp.vec3) -> int:
function project_point_to_plane (line 328) | def project_point_to_plane(bin_normal_idx: wp.int32, point: wp.vec3) -> ...
function get_spatial_direction_2d (line 355) | def get_spatial_direction_2d(dir_idx: int) -> wp.vec2:
function compute_num_reduction_slots (line 368) | def compute_num_reduction_slots() -> int:
function compute_voxel_index (line 379) | def compute_voxel_index(
function create_shared_memory_pointer_block_dim_func (line 418) | def create_shared_memory_pointer_block_dim_func(
function create_shared_memory_pointer_block_dim_mul_func (line 447) | def create_shared_memory_pointer_block_dim_mul_func(
FILE: newton/_src/geometry/contact_reduction_global.py
function is_contact_already_exported (line 96) | def is_contact_already_exported(
function compute_effective_radius (line 120) | def compute_effective_radius(shape_type: int, shape_scale: wp.vec4) -> f...
function reduction_update_slot (line 147) | def reduction_update_slot(
function reduction_insert_slot (line 173) | def reduction_insert_slot(
function make_contact_key (line 227) | def make_contact_key(shape_a: int, shape_b: int, bin_id: int) -> wp.uint64:
function make_contact_value (line 246) | def make_contact_value(score: float, contact_id: int) -> wp.uint64:
function unpack_contact_id (line 265) | def unpack_contact_id(packed: wp.uint64) -> int:
function encode_oct (line 271) | def encode_oct(n: wp.vec3) -> wp.vec2:
function decode_oct (line 301) | def decode_oct(e: wp.vec2) -> wp.vec3:
class GlobalContactReducerData (line 326) | class GlobalContactReducerData:
function _clear_active_kernel (line 381) | def _clear_active_kernel(
function _zero_count_and_contacts_kernel (line 447) | def _zero_count_and_contacts_kernel(
class GlobalContactReducer (line 459) | class GlobalContactReducer:
method __init__ (line 507) | def __init__(
method clear (line 595) | def clear(self):
method clear_active (line 602) | def clear_active(self):
method get_data_struct (line 648) | def get_data_struct(self) -> GlobalContactReducerData:
function export_contact_to_buffer (line 678) | def export_contact_to_buffer(
function reduce_contact_in_hashtable (line 714) | def reduce_contact_in_hashtable(
function export_and_reduce_contact (line 819) | def export_and_reduce_contact(
function export_and_reduce_contact_centered (line 850) | def export_and_reduce_contact_centered(
function reduce_buffered_contacts_kernel (line 973) | def reduce_buffered_contacts_kernel(
function unpack_contact (line 1017) | def unpack_contact(
function write_contact_to_reducer (line 1044) | def write_contact_to_reducer(
function create_export_reduced_contacts_kernel (line 1082) | def create_export_reduced_contacts_kernel(writer_func: Any):
function mesh_triangle_contacts_to_reducer_kernel (line 1218) | def mesh_triangle_contacts_to_reducer_kernel(
FILE: newton/_src/geometry/contact_reduction_hydroelastic.py
function _compute_normal_matching_rotation (line 69) | def _compute_normal_matching_rotation(
function _effective_stiffness (line 99) | def _effective_stiffness(k_a: wp.float32, k_b: wp.float32) -> wp.float32:
function export_hydroelastic_contact_to_buffer (line 112) | def export_hydroelastic_contact_to_buffer(
function get_reduce_hydroelastic_contacts_kernel (line 155) | def get_reduce_hydroelastic_contacts_kernel():
function _create_accumulate_reduced_depth_kernel (line 285) | def _create_accumulate_reduced_depth_kernel():
function _create_accumulate_moments_kernel (line 355) | def _create_accumulate_moments_kernel(normal_matching: bool = True):
function create_export_hydroelastic_reduced_contacts_kernel (line 449) | def create_export_hydroelastic_reduced_contacts_kernel(
class HydroelasticReductionConfig (line 880) | class HydroelasticReductionConfig:
class HydroelasticContactReduction (line 900) | class HydroelasticContactReduction:
method __init__ (line 953) | def __init__(
method contact_count (line 1006) | def contact_count(self) -> wp.array:
method capacity (line 1011) | def capacity(self) -> int:
method get_data_struct (line 1015) | def get_data_struct(self) -> GlobalContactReducerData:
method clear (line 1024) | def clear(self):
method reduce (line 1032) | def reduce(
method export (line 1077) | def export(
method reduce_and_export (line 1168) | def reduce_and_export(
FILE: newton/_src/geometry/differentiable_contacts.py
function differentiable_contact_augment_kernel (line 25) | def differentiable_contact_augment_kernel(
function launch_differentiable_contact_augment (line 91) | def launch_differentiable_contact_augment(
FILE: newton/_src/geometry/flags.py
class ParticleFlags (line 8) | class ParticleFlags(IntEnum):
class ShapeFlags (line 18) | class ShapeFlags(IntEnum):
FILE: newton/_src/geometry/hashtable.py
function _next_power_of_two (line 41) | def _next_power_of_two(n: int) -> int:
function _hashtable_hash (line 56) | def _hashtable_hash(key: wp.uint64, capacity_mask: int) -> int:
function hashtable_find (line 66) | def hashtable_find(
function hashtable_find_or_insert (line 107) | def hashtable_find_or_insert(
function _hashtable_clear_keys_kernel (line 163) | def _hashtable_clear_keys_kernel(
function _zero_count_kernel (line 189) | def _zero_count_kernel(
class HashTable (line 197) | class HashTable:
method __init__ (line 214) | def __init__(self, capacity: int, device: str | None = None):
method clear (line 230) | def clear(self):
method clear_active (line 235) | def clear_active(self):
FILE: newton/_src/geometry/inertia.py
function compute_inertia_sphere (line 42) | def compute_inertia_sphere(density: float, radius: float) -> tuple[float...
function compute_inertia_capsule (line 64) | def compute_inertia_capsule(density: float, radius: float, half_height: ...
function compute_inertia_cylinder (line 97) | def compute_inertia_cylinder(density: float, radius: float, half_height:...
function compute_inertia_cone (line 123) | def compute_inertia_cone(density: float, radius: float, half_height: flo...
function compute_inertia_ellipsoid (line 154) | def compute_inertia_ellipsoid(density: float, rx: float, ry: float, rz: ...
function compute_inertia_box_from_mass (line 186) | def compute_inertia_box_from_mass(mass: float, hx: float, hy: float, hz:...
function compute_inertia_box (line 208) | def compute_inertia_box(density: float, hx: float, hy: float, hz: float)...
function triangle_inertia (line 230) | def triangle_inertia(
function compute_solid_mesh_inertia (line 250) | def compute_solid_mesh_inertia(
function compute_hollow_mesh_inertia (line 270) | def compute_hollow_mesh_inertia(
function compute_inertia_mesh (line 343) | def compute_inertia_mesh(
function transform_inertia (line 436) | def transform_inertia(mass: float, inertia: wp.mat33, offset: wp.vec3, q...
function compute_inertia_shape (line 474) | def compute_inertia_shape(
function verify_and_correct_inertia (line 608) | def verify_and_correct_inertia(
function validate_and_correct_inertia_kernel (line 806) | def validate_and_correct_inertia_kernel(
FILE: newton/_src/geometry/kernels.py
function triangle_closest_point_barycentric (line 16) | def triangle_closest_point_barycentric(a: wp.vec3, b: wp.vec3, c: wp.vec...
function triangle_closest_point (line 64) | def triangle_closest_point(a: wp.vec3, b: wp.vec3, c: wp.vec3, p: wp.vec3):
function _sdf_point_to_z_up (line 132) | def _sdf_point_to_z_up(point: wp.vec3, up_axis: int):
function _sdf_capped_cone_z (line 141) | def _sdf_capped_cone_z(bottom_radius: float, top_radius: float, half_hei...
function sdf_sphere (line 165) | def sdf_sphere(point: wp.vec3, radius: float):
function sdf_sphere_grad (line 179) | def sdf_sphere_grad(point: wp.vec3, radius: float):
function sdf_box (line 198) | def sdf_box(point: wp.vec3, hx: float, hy: float, hz: float):
function sdf_box_grad (line 221) | def sdf_box_grad(point: wp.vec3, hx: float, hy: float, hz: float):
function sdf_capsule (line 262) | def sdf_capsule(point: wp.vec3, radius: float, half_height: float, up_ax...
function _sdf_vector_from_z_up (line 285) | def _sdf_vector_from_z_up(v: wp.vec3, up_axis: int):
function sdf_capsule_grad (line 294) | def sdf_capsule_grad(point: wp.vec3, radius: float, half_height: float, ...
function sdf_cylinder (line 332) | def sdf_cylinder(
function sdf_cylinder_grad (line 360) | def sdf_cylinder_grad(
function sdf_ellipsoid (line 449) | def sdf_ellipsoid(point: wp.vec3, radii: wp.vec3):
function sdf_ellipsoid_grad (line 480) | def sdf_ellipsoid_grad(point: wp.vec3, radii: wp.vec3):
function sdf_cone (line 515) | def sdf_cone(point: wp.vec3, radius: float, half_height: float, up_axis:...
function sdf_cone_grad (line 532) | def sdf_cone_grad(point: wp.vec3, radius: float, half_height: float, up_...
function sdf_plane (line 568) | def sdf_plane(point: wp.vec3, width: float, length: float):
function sdf_plane_grad (line 592) | def sdf_plane_grad(point: wp.vec3, width: float, length: float):
function closest_point_plane (line 608) | def closest_point_plane(width: float, length: float, point: wp.vec3):
function closest_point_line_segment (line 622) | def closest_point_line_segment(a: wp.vec3, b: wp.vec3, point: wp.vec3):
function closest_point_box (line 631) | def closest_point_box(upper: wp.vec3, point: wp.vec3):
function get_box_vertex (line 652) | def get_box_vertex(point_id: int, upper: wp.vec3):
function get_box_edge (line 668) | def get_box_edge(edge_id: int, upper: wp.vec3):
function get_plane_edge (line 689) | def get_plane_edge(edge_id: int, plane_width: float, plane_length: float):
function closest_edge_coordinate_box (line 703) | def closest_edge_coordinate_box(upper: wp.vec3, edge_a: wp.vec3, edge_b:...
function closest_edge_coordinate_plane (line 742) | def closest_edge_coordinate_plane(
function closest_edge_coordinate_capsule (line 787) | def closest_edge_coordinate_capsule(radius: float, half_height: float, e...
function closest_edge_coordinate_cylinder (line 827) | def closest_edge_coordinate_cylinder(
function mesh_sdf (line 869) | def mesh_sdf(mesh: wp.uint64, point: wp.vec3, max_dist: float):
function sdf_mesh (line 883) | def sdf_mesh(mesh: wp.uint64, point: wp.vec3, max_dist: float):
function closest_point_mesh (line 898) | def closest_point_mesh(mesh: wp.uint64, point: wp.vec3, max_dist: float):
function closest_edge_coordinate_mesh (line 912) | def closest_edge_coordinate_mesh(mesh: wp.uint64, edge_a: wp.vec3, edge_...
function volume_grad (line 951) | def volume_grad(volume: wp.uint64, p: wp.vec3):
function counter_increment (line 970) | def counter_increment(counter: wp.array[int], counter_index: int, tids: ...
function counter_increment_replay (line 994) | def counter_increment_replay(
function create_soft_contacts (line 1001) | def create_soft_contacts(
function compute_tri_aabb (line 1163) | def compute_tri_aabb(
function compute_tri_aabbs (line 1175) | def compute_tri_aabbs(
function compute_edge_aabbs (line 1194) | def compute_edge_aabbs(
function tri_is_neighbor (line 1210) | def tri_is_neighbor(a_1: wp.int32, a_2: wp.int32, a_3: wp.int32, b_1: wp...
function vertex_adjacent_to_triangle (line 1227) | def vertex_adjacent_to_triangle(v: wp.int32, a: wp.int32, b: wp.int32, c...
function init_triangle_collision_data_kernel (line 1232) | def init_triangle_collision_data_kernel(
function vertex_triangle_collision_detection_kernel (line 1250) | def vertex_triangle_collision_detection_kernel(
function edge_colliding_edges_detection_kernel (line 1389) | def edge_colliding_edges_detection_kernel(
function triangle_triangle_collision_detection_kernel (line 1499) | def triangle_triangle_collision_detection_kernel(
FILE: newton/_src/geometry/mpr.py
class Vert (line 40) | class Vert:
function vert_a (line 48) | def vert_a(vert: Vert) -> wp.vec3:
function create_support_map_function (line 53) | def create_support_map_function(support_func: Any):
function create_solve_mpr (line 183) | def create_solve_mpr(support_func: Any, _support_funcs: Any = None):
FILE: newton/_src/geometry/multicontact.py
function should_include_deepest_contact (line 38) | def should_include_deepest_contact(normal_dot: float) -> bool:
function excess_normal_deviation (line 43) | def excess_normal_deviation(dir_a: wp.vec3, dir_b: wp.vec3) -> bool:
function signed_area (line 62) | def signed_area(a: wp.vec2, b: wp.vec2, query_point: wp.vec2) -> float:
function ray_plane_intersection (line 87) | def ray_plane_intersection(
class BodyProjector (line 117) | class BodyProjector:
class IncrementalPlaneTracker (line 133) | class IncrementalPlaneTracker:
function update_incremental_plane_tracker (line 141) | def update_incremental_plane_tracker(
function compute_line_segment_projector_normal (line 167) | def compute_line_segment_projector_normal(
function create_body_projectors (line 189) | def create_body_projectors(
function body_projector_project (line 239) | def body_projector_project(
function intersection_point (line 263) | def intersection_point(trim_seg_start: wp.vec2, trim_seg_end: wp.vec2, a...
function insert_vec2 (line 289) | def insert_vec2(arr: wp.array[wp.vec2], arr_count: int, index: int, elem...
function trim_in_place (line 307) | def trim_in_place(
function trim_all_in_place (line 398) | def trim_all_in_place(
function approx_max_quadrilateral_area_with_calipers (line 485) | def approx_max_quadrilateral_area_with_calipers(hull: wp.array[wp.vec2],...
function remove_zero_length_edges (line 581) | def remove_zero_length_edges(loop: wp.array[wp.vec2], loop_count: int, e...
function add_avoid_duplicates_vec2 (line 621) | def add_avoid_duplicates_vec2(arr: wp.array[wp.vec2], arr_count: int, ve...
function get_ptr (line 651) | def get_ptr(a: wp.array[wp.vec2]) -> wp.uint64: ...
function create_build_manifold (line 654) | def create_build_manifold(support_func: Any, writer_func: Any, post_proc...
FILE: newton/_src/geometry/narrow_phase.py
class ContactWriterData (line 65) | class ContactWriterData:
function write_contact_simple (line 76) | def write_contact_simple(
function create_narrow_phase_primitive_kernel (line 128) | def create_narrow_phase_primitive_kernel(writer_func: Any):
function create_narrow_phase_kernel_gjk_mpr (line 595) | def create_narrow_phase_kernel_gjk_mpr(
function narrow_phase_find_mesh_triangle_overlaps_kernel (line 766) | def narrow_phase_find_mesh_triangle_overlaps_kernel(
function create_narrow_phase_process_mesh_triangle_contacts_kernel (line 873) | def create_narrow_phase_process_mesh_triangle_contacts_kernel(writer_fun...
function compute_mesh_plane_vert_counts (line 963) | def compute_mesh_plane_vert_counts(
function compute_mesh_plane_block_offsets_scan (line 988) | def compute_mesh_plane_block_offsets_scan(
function create_narrow_phase_process_mesh_plane_contacts_kernel (line 1035) | def create_narrow_phase_process_mesh_plane_contacts_kernel(
function verify_narrow_phase_buffers (line 1294) | def verify_narrow_phase_buffers(
class NarrowPhase (line 1368) | class NarrowPhase:
method __init__ (line 1378) | def __init__(
method launch_custom_write (line 1630) | def launch_custom_write(
method launch (line 2046) | def launch(
FILE: newton/_src/geometry/raycast.py
function _spinlock_acquire (line 17) | def _spinlock_acquire(lock: wp.array[wp.int32]):
function _spinlock_release (line 24) | def _spinlock_release(lock: wp.array[wp.int32]):
function ray_intersect_sphere (line 30) | def ray_intersect_sphere(geom_to_world: wp.transform, ray_origin: wp.vec...
function ray_intersect_particle_sphere (line 74) | def ray_intersect_particle_sphere(ray_origin: wp.vec3, ray_direction: wp...
function ray_intersect_ellipsoid (line 107) | def ray_intersect_ellipsoid(
function ray_intersect_box (line 168) | def ray_intersect_box(geom_to_world: wp.transform, ray_origin: wp.vec3, ...
function ray_intersect_capsule (line 216) | def ray_intersect_capsule(geom_to_world: wp.transform, ray_origin: wp.ve...
function ray_intersect_cylinder (line 307) | def ray_intersect_cylinder(
function ray_intersect_cone (line 377) | def ray_intersect_cone(
function ray_intersect_mesh (line 460) | def ray_intersect_mesh(
function ray_intersect_geom (line 520) | def ray_intersect_geom(
function raycast_kernel (line 576) | def raycast_kernel(
function ray_for_pixel (line 657) | def ray_for_pixel(
function sensor_raycast_kernel (line 710) | def sensor_raycast_kernel(
function sensor_raycast_particles_kernel (line 795) | def sensor_raycast_particles_kernel(
FILE: newton/_src/geometry/remesh.py
function _split_by_3 (line 87) | def _split_by_3(x: wp.uint64) -> wp.uint64:
function morton_encode_3d (line 101) | def morton_encode_3d(cx: wp.int32, cy: wp.int32, cz: wp.int32) -> wp.uin...
function compute_voxel_key (line 116) | def compute_voxel_key(
function rand_init (line 138) | def rand_init(seed: wp.uint32, thread_id: wp.uint32) -> wp.uint32:
function rand_next (line 150) | def rand_next(state: wp.uint32) -> wp.uint32:
function rand_float (line 156) | def rand_float(state: wp.uint32) -> float:
function rand_next_float (line 163) | def rand_next_float(state: wp.uint32) -> tuple[wp.uint32, float]:
function _accumulate_point_kernel (line 179) | def _accumulate_point_kernel(
function _finalize_voxels_kernel (line 212) | def _finalize_voxels_kernel(
class VoxelHashGrid (line 262) | class VoxelHashGrid:
method __init__ (line 284) | def __init__(
method keys (line 313) | def keys(self) -> wp.array:
method active_slots (line 318) | def active_slots(self) -> wp.array:
method clear (line 322) | def clear(self):
method get_num_voxels (line 334) | def get_num_voxels(self) -> int:
method finalize (line 338) | def finalize(self) -> tuple[np.ndarray, np.ndarray, int]:
function compute_bounding_sphere (line 391) | def compute_bounding_sphere(vertices: np.ndarray) -> tuple[np.ndarray, f...
function create_icosahedron_directions (line 424) | def create_icosahedron_directions(edge_segments: int = 2) -> np.ndarray:
function compute_hemisphere_edge_segments (line 573) | def compute_hemisphere_edge_segments(target_rays: int) -> int:
function create_hemisphere_directions (line 593) | def create_hemisphere_directions(target_rays: int) -> np.ndarray:
function compute_camera_basis (line 618) | def compute_camera_basis(direction: np.ndarray) -> tuple[np.ndarray, np....
function raycast_orthographic_kernel (line 651) | def raycast_orthographic_kernel(
function raycast_hemisphere_kernel (line 783) | def raycast_hemisphere_kernel(
class PointCloudExtractor (line 876) | class PointCloudExtractor:
method __init__ (line 939) | def __init__(
method extract (line 982) | def extract(
class SurfaceReconstructor (line 1350) | class SurfaceReconstructor:
method __init__ (line 1393) | def __init__(
method reconstruct (line 1429) | def reconstruct(
method _simplify_pyfqmr (line 1514) | def _simplify_pyfqmr(self, mesh, num_triangles_before: int, verbose: b...
method _simplify_open3d (line 1550) | def _simplify_open3d(self, mesh, num_triangles_before: int, verbose: b...
function extract_largest_island (line 1582) | def extract_largest_island(
function remesh_poisson (line 1700) | def remesh_poisson(
FILE: newton/_src/geometry/sdf_contact.py
function scale_sdf_result_to_world (line 27) | def scale_sdf_result_to_world(
function sample_sdf_using_mesh (line 62) | def sample_sdf_using_mesh(
function sample_sdf_grad_using_mesh (line 97) | def sample_sdf_grad_using_mesh(
function closest_pt_point_bary_triangle (line 160) | def closest_pt_point_bary_triangle(c: wp.vec3) -> wp.vec3:
function get_triangle_from_mesh (line 227) | def get_triangle_from_mesh(
function get_bounding_sphere (line 276) | def get_bounding_sphere(v0: wp.vec3, v1: wp.vec3, v2: wp.vec3) -> tuple[...
function add_to_shared_buffer_atomic (line 302) | def add_to_shared_buffer_atomic(
function get_triangle_from_heightfield (line 362) | def get_triangle_from_heightfield(
function get_triangle_count (line 423) | def get_triangle_count(shape_type: int, mesh_id: wp.uint64, hfd: Heightf...
function _create_sdf_contact_funcs (line 432) | def _create_sdf_contact_funcs(enable_heightfields: bool):
function compute_mesh_mesh_tri_counts (line 704) | def compute_mesh_mesh_tri_counts(
function compute_block_counts_from_weights (line 743) | def compute_block_counts_from_weights(
function compute_mesh_mesh_block_offsets_scan (line 778) | def compute_mesh_mesh_block_offsets_scan(
function create_narrow_phase_process_mesh_mesh_contacts_kernel (line 834) | def create_narrow_phase_process_mesh_mesh_contacts_kernel(
FILE: newton/_src/geometry/sdf_hydroelastic.py
function map_shape_texture_sdf_data_kernel (line 67) | def map_shape_texture_sdf_data_kernel(
function int_to_vec3f (line 86) | def int_to_vec3f(x: wp.int32, y: wp.int32, z: wp.int32):
function get_effective_stiffness (line 91) | def get_effective_stiffness(k_a: wp.float32, k_b: wp.float32) -> wp.floa...
function mc_calc_face_texture (line 100) | def mc_calc_face_texture(
class HydroelasticSDF (line 160) | class HydroelasticSDF:
class Config (line 205) | class Config:
class ContactSurfaceData (line 257) | class ContactSurfaceData:
method __init__ (line 276) | def __init__(
method _from_model (line 423) | def _from_model(
method get_contact_surface (line 503) | def get_contact_surface(self) -> ContactSurfaceData | None:
method launch (line 520) | def launch(
method _broadphase_sdfs (line 625) | def _broadphase_sdfs(
method _find_iso_voxels (line 696) | def _find_iso_voxels(
method _generate_contacts (line 759) | def _generate_contacts(
method _decode_contacts (line 815) | def _decode_contacts(
method _reduce_decode_contacts (line 846) | def _reduce_decode_contacts(
function broadphase_collision_pairs_count (line 878) | def broadphase_collision_pairs_count(
function broadphase_collision_pairs_scatter (line 930) | def broadphase_collision_pairs_scatter(
function broadphase_get_block_coords (line 979) | def broadphase_get_block_coords(
function encode_coords_8 (line 996) | def encode_coords_8(x: wp.int32, y: wp.int32, z: wp.int32) -> wp.uint8:
function decode_coords_8 (line 1002) | def decode_coords_8(bit_pos: wp.uint8) -> wp.vec3ub:
function get_rel_stiffness (line 1010) | def get_rel_stiffness(k_a: wp.float32, k_b: wp.float32) -> tuple[wp.floa...
function sdf_diff_sdf (line 1016) | def sdf_diff_sdf(
function sdf_diff_sdf (line 1050) | def sdf_diff_sdf(
function count_iso_voxels_block (line 1080) | def count_iso_voxels_block(
function scatter_iso_subblock (line 1159) | def scatter_iso_subblock(
function mc_iterate_voxel_vertices (line 1193) | def mc_iterate_voxel_vertices(
function get_decode_contacts_kernel (line 1251) | def get_decode_contacts_kernel(margin_contact_area: float = 1e-4, writer...
function get_generate_contacts_kernel (line 1363) | def get_generate_contacts_kernel(
function verify_collision_step (line 1670) | def verify_collision_step(
FILE: newton/_src/geometry/sdf_mc.py
function get_mc_tables (line 24) | def get_mc_tables(device):
function int_to_vec3f (line 80) | def int_to_vec3f(x: wp.int32, y: wp.int32, z: wp.int32):
function get_triangle_fraction (line 86) | def get_triangle_fraction(vert_depths: wp.vec3f, num_inside: wp.int32) -...
function mc_calc_face (line 135) | def mc_calc_face(
FILE: newton/_src/geometry/sdf_texture.py
class QuantizationMode (line 39) | class QuantizationMode:
class TextureSDFData (line 48) | class TextureSDFData:
function _idx3d (line 89) | def _idx3d(x: int, y: int, z: int, size_x: int, size_y: int) -> int:
function _id_to_xyz (line 95) | def _id_to_xyz(idx: int, size_x: int, size_y: int) -> wp.vec3i:
function _check_subgrid_occupied_kernel (line 105) | def _check_subgrid_occupied_kernel(
function _check_subgrid_linearity_kernel (line 130) | def _check_subgrid_linearity_kernel(
function _build_coarse_sdf_from_mesh_kernel (line 221) | def _build_coarse_sdf_from_mesh_kernel(
function _populate_subgrid_texture_float32_kernel (line 254) | def _populate_subgrid_texture_float32_kernel(
function _populate_subgrid_texture_uint16_kernel (line 328) | def _populate_subgrid_texture_uint16_kernel(
function _populate_subgrid_texture_uint8_kernel (line 407) | def _populate_subgrid_texture_uint8_kernel(
function _sample_volume_at_positions_kernel (line 491) | def _sample_volume_at_positions_kernel(
function apply_subgrid_start (line 509) | def apply_subgrid_start(start_slot: wp.uint32, local_f: wp.vec3, subgrid...
function apply_subgrid_sdf_scale (line 523) | def apply_subgrid_sdf_scale(raw_value: float, min_value: float, value_ra...
function _read_cell_corners (line 532) | def _read_cell_corners(
function _trilinear (line 640) | def _trilinear(corners: vec8f, tx: float, ty: float, tz: float) -> float:
function texture_sample_sdf_at_voxel (line 652) | def texture_sample_sdf_at_voxel(
function texture_sample_sdf (line 711) | def texture_sample_sdf(
function texture_sample_sdf_grad (line 833) | def texture_sample_sdf_grad(
function build_sparse_sdf_from_mesh (line 894) | def build_sparse_sdf_from_mesh(
function create_sparse_sdf_textures (line 1207) | def create_sparse_sdf_textures(
function create_texture_sdf_from_mesh (line 1266) | def create_texture_sdf_from_mesh(
function create_texture_sdf_from_volume (line 1353) | def create_texture_sdf_from_volume(
function block_coords_from_subgrid_required (line 1714) | def block_coords_from_subgrid_required(
function create_empty_texture_sdf_data (line 1755) | def create_empty_texture_sdf_data() -> TextureSDFData:
function _count_isomesh_faces_texture_kernel (line 1786) | def _count_isomesh_faces_texture_kernel(
function _generate_isomesh_texture_kernel (line 1819) | def _generate_isomesh_texture_kernel(
function compute_isomesh_from_texture_sdf (line 1879) | def compute_isomesh_from_texture_sdf(
FILE: newton/_src/geometry/sdf_utils.py
class SDFData (line 23) | class SDFData:
function sample_sdf_extrapolated (line 51) | def sample_sdf_extrapolated(
function sample_sdf_grad_extrapolated (line 103) | def sample_sdf_grad_extrapolated(
class SDF (line 165) | class SDF:
method __init__ (line 168) | def __init__(
method to_kernel_data (line 197) | def to_kernel_data(self) -> SDFData:
method to_texture_kernel_data (line 201) | def to_texture_kernel_data(self) -> "TextureSDFData | None":
method is_empty (line 205) | def is_empty(self) -> bool:
method validate (line 209) | def validate(self) -> None:
method extract_isomesh (line 216) | def extract_isomesh(self, isovalue: float = 0.0, device: "Devicelike |...
method __copy__ (line 255) | def __copy__(self) -> "SDF":
method __deepcopy__ (line 259) | def __deepcopy__(self, memo: dict[int, object]) -> "SDF":
method create_from_points (line 269) | def create_from_points(
method create_from_mesh (line 313) | def create_from_mesh(
method create_from_data (line 426) | def create_from_data(
function create_empty_sdf_data (line 474) | def create_empty_sdf_data() -> SDFData:
function compute_mesh_signed_volume_kernel (line 494) | def compute_mesh_signed_volume_kernel(
function compute_mesh_signed_volume (line 507) | def compute_mesh_signed_volume(points: wp.array, indices: wp.array) -> f...
function get_distance_to_mesh (line 516) | def get_distance_to_mesh(mesh: wp.uint64, point: wp.vec3, max_dist: wp.f...
function sdf_from_mesh_kernel (line 531) | def sdf_from_mesh_kernel(
function sdf_from_primitive_kernel (line 557) | def sdf_from_primitive_kernel(
function check_tile_occupied_mesh_kernel (line 594) | def check_tile_occupied_mesh_kernel(
function check_tile_occupied_primitive_kernel (line 614) | def check_tile_occupied_primitive_kernel(
function get_primitive_extents (line 646) | def get_primitive_extents(shape_type: int, shape_scale: Sequence[float])...
function _compute_sdf_from_shape_impl (line 682) | def _compute_sdf_from_shape_impl(
function compute_sdf_from_shape (line 912) | def compute_sdf_from_shape(
function compute_isomesh (line 979) | def compute_isomesh(volume: wp.Volume, isovalue: float = 0.0, device: De...
function compute_offset_mesh (line 1043) | def compute_offset_mesh(
function count_isomesh_faces_kernel (line 1134) | def count_isomesh_faces_kernel(
function generate_isomesh_kernel (line 1175) | def generate_isomesh_kernel(
function _populate_dense_sdf_kernel (line 1262) | def _populate_dense_sdf_kernel(
function _count_dense_mc_faces_kernel (line 1296) | def _count_dense_mc_faces_kernel(
function _generate_dense_mc_kernel (line 1320) | def _generate_dense_mc_kernel(
function compute_offset_mesh_analytical (line 1383) | def compute_offset_mesh_analytical(
FILE: newton/_src/geometry/simplex_solver.py
function create_solve_closest_distance (line 44) | def create_solve_closest_distance(support_func: Any, _support_funcs: Any...
FILE: newton/_src/geometry/support_function.py
class GeoTypeEx (line 38) | class GeoTypeEx(enum.IntEnum):
class SupportMapDataProvider (line 43) | class SupportMapDataProvider:
function pack_mesh_ptr (line 55) | def pack_mesh_ptr(ptr: wp.uint64) -> wp.vec3:
function unpack_mesh_ptr (line 66) | def unpack_mesh_ptr(arr: wp.vec3) -> wp.uint64:
class GenericShapeData (line 77) | class GenericShapeData:
function support_map (line 100) | def support_map(geom: GenericShapeData, direction: wp.vec3, data_provide...
function support_map_lean (line 285) | def support_map_lean(geom: GenericShapeData, direction: wp.vec3, data_pr...
function extract_shape_data (line 327) | def extract_shape_data(
FILE: newton/_src/geometry/terrain_generator.py
function _create_box (line 19) | def _create_box(
function _flat_terrain (line 158) | def _flat_terrain(size: tuple[float, float], height: float = 0.0) -> tup...
function _pyramid_stairs_terrain (line 178) | def _pyramid_stairs_terrain(
function _random_grid_terrain (line 234) | def _random_grid_terrain(
function _wave_terrain (line 293) | def _wave_terrain(
function _box_terrain (line 333) | def _box_terrain(
function _gap_terrain (line 360) | def _gap_terrain(
function _heightfield_terrain (line 401) | def _heightfield_terrain(
function create_mesh_terrain (line 445) | def create_mesh_terrain(
function _combine_meshes (line 547) | def _combine_meshes(meshes: list[tuple[np.ndarray, np.ndarray]]) -> tupl...
function _to_newton_mesh (line 576) | def _to_newton_mesh(vertices: np.ndarray, indices: np.ndarray) -> tuple[...
function create_mesh_heightfield (line 591) | def create_mesh_heightfield(
FILE: newton/_src/geometry/types.py
function _normalize_texture_input (line 21) | def _normalize_texture_input(texture: str | os.PathLike[str] | np.ndarra...
class GeoType (line 38) | class GeoType(enum.IntEnum):
class Mesh (line 83) | class Mesh:
method __init__ (line 115) | def __init__(
method create_sphere (line 182) | def create_sphere(
method create_ellipsoid (line 225) | def create_ellipsoid(
method create_capsule (line 274) | def create_capsule(
method create_cylinder (line 317) | def create_cylinder(
method create_cone (line 363) | def create_cone(
method create_arrow (line 406) | def create_arrow(
method create_box (line 457) | def create_box(
method create_plane (line 505) | def create_plane(
method create_terrain (line 544) | def create_terrain(
method create_heightfield (line 597) | def create_heightfield(
method copy (line 650) | def copy(
method build_sdf (line 694) | def build_sdf(
method clear_sdf (line 763) | def clear_sdf(self) -> None:
method vertices (line 772) | def vertices(self):
method vertices (line 776) | def vertices(self, value):
method indices (line 781) | def indices(self):
method indices (line 785) | def indices(self, value):
method normals (line 790) | def normals(self):
method uvs (line 794) | def uvs(self):
method color (line 798) | def color(self) -> Vec3 | None:
method color (line 803) | def color(self, value: Vec3 | None):
method texture (line 807) | def texture(self) -> str | np.ndarray | None:
method texture (line 812) | def texture(self, value: str | np.ndarray | None):
method texture_hash (line 819) | def texture_hash(self) -> int:
method _compute_texture_hash (line 828) | def _compute_texture_hash(self) -> int:
method roughness (line 834) | def roughness(self) -> float | None:
method roughness (line 838) | def roughness(self, value: float | None):
method metallic (line 843) | def metallic(self) -> float | None:
method metallic (line 847) | def metallic(self, value: float | None):
method finalize (line 852) | def finalize(self, device: Devicelike = None, requires_grad: bool = Fa...
method compute_convex_hull (line 871) | def compute_convex_hull(self, replace: bool = False) -> "Mesh":
method __hash__ (line 901) | def __hash__(self) -> int:
method create_from_usd (line 927) | def create_from_usd(prim, **kwargs) -> "Mesh":
method create_from_file (line 949) | def create_from_file(filename: str, method: str | None = None, **kwarg...
class TetMesh (line 975) | class TetMesh:
method __init__ (line 1002) | def __init__(
method _broadcast_material (line 1072) | def _broadcast_material(value: np.ndarray | float | None, tet_count: i...
method _infer_frequency (line 1086) | def _infer_frequency(
method compute_surface_triangles (line 1128) | def compute_surface_triangles(tet_indices: np.ndarray) -> np.ndarray:
method _compute_surface_triangles (line 1174) | def _compute_surface_triangles(self) -> np.ndarray:
method vertices (line 1180) | def vertices(self) -> np.ndarray:
method tet_indices (line 1185) | def tet_indices(self) -> np.ndarray:
method tet_count (line 1190) | def tet_count(self) -> int:
method vertex_count (line 1195) | def vertex_count(self) -> int:
method surface_tri_indices (line 1200) | def surface_tri_indices(self) -> np.ndarray:
method k_mu (line 1209) | def k_mu(self) -> np.ndarray | None:
method k_lambda (line 1214) | def k_lambda(self) -> np.ndarray | None:
method k_damp (line 1219) | def k_damp(self) -> np.ndarray | None:
method density (line 1224) | def density(self) -> float | None:
method create_from_usd (line 1231) | def create_from_usd(prim) -> "TetMesh":
method create_from_file (line 1268) | def create_from_file(filename: str) -> "TetMesh":
method save (line 1381) | def save(self, filename: str):
method __eq__ (line 1454) | def __eq__(self, other):
method __hash__ (line 1459) | def __hash__(self):
class Heightfield (line 1465) | class Heightfield:
method __init__ (line 1511) | def __init__(
method data (line 1570) | def data(self):
method data (line 1575) | def data(self, value):
method __hash__ (line 1588) | def __hash__(self) -> int:
class Gaussian (line 1610) | class Gaussian:
class Data (line 1630) | class Data:
method __init__ (line 1639) | def __init__(
method count (line 1719) | def count(self) -> int:
method positions (line 1724) | def positions(self) -> np.ndarray:
method rotations (line 1729) | def rotations(self) -> np.ndarray:
method scales (line 1734) | def scales(self) -> np.ndarray:
method opacities (line 1739) | def opacities(self) -> np.ndarray:
method sh_coeffs (line 1744) | def sh_coeffs(self) -> np.ndarray | None:
method sh_degree (line 1749) | def sh_degree(self) -> int:
method min_response (line 1754) | def min_response(self) -> float:
method _find_sh_degree (line 1758) | def _find_sh_degree(self) -> int:
method finalize (line 1770) | def finalize(self, device: Devicelike = None) -> Data:
method create_from_ply (line 1809) | def create_from_ply(filename: str, min_response: float = 0.1) -> "Gaus...
method create_from_usd (line 1924) | def create_from_usd(prim, min_response: float = 0.1) -> "Gaussian":
method compute_aabb (line 1943) | def compute_aabb(self) -> tuple[np.ndarray, np.ndarray]:
method compute_proxy_mesh (line 1953) | def compute_proxy_mesh(self, method: str = "convex_hull") -> "Mesh":
method compute_points_mesh (line 1980) | def compute_points_mesh(self) -> "Mesh":
method __hash__ (line 2002) | def __hash__(self) -> int:
method __eq__ (line 2017) | def __eq__(self, other: object) -> bool:
FILE: newton/_src/geometry/utils.py
function compute_obb_candidates (line 24) | def compute_obb_candidates(
function compute_shape_radius (line 73) | def compute_shape_radius(geo_type: int, scale: Vec3, src: Mesh | Heightf...
function compute_aabb (line 119) | def compute_aabb(vertices: np.ndarray) -> tuple[Vec3, Vec3]:
function compute_inertia_box_mesh (line 126) | def compute_inertia_box_mesh(
function compute_pca_obb (line 194) | def compute_pca_obb(vertices: np.ndarray) -> tuple[wp.transform, wp.vec3]:
function compute_inertia_obb (line 264) | def compute_inertia_obb(
function load_mesh (line 355) | def load_mesh(filename: str, method: str | None = None):
function visualize_meshes (line 428) | def visualize_meshes(
function silence_stdio (line 472) | def silence_stdio():
function remesh_ftetwild (line 499) | def remesh_ftetwild(
function remesh_alphashape (line 572) | def remesh_alphashape(vertices: np.ndarray, alpha: float = 3.0):
function remesh_quadratic (line 590) | def remesh_quadratic(
function remesh_convex_hull (line 615) | def remesh_convex_hull(vertices: np.ndarray, maxhullvert: int = 0):
function remesh (line 662) | def remesh(
function remesh_mesh (line 710) | def remesh_mesh(
function transform_points (line 747) | def transform_points(points: np.ndarray, transform: wp.transform, scale:...
function get_total_kernel (line 754) | def get_total_kernel(
function scan_with_total (line 774) | def scan_with_total(
FILE: newton/_src/math/__init__.py
function boltzmann (line 20) | def boltzmann(a: float, b: float, alpha: float):
function smooth_max (line 42) | def smooth_max(a: float, b: float, eps: float):
function smooth_min (line 62) | def smooth_min(a: float, b: float, eps: float):
function leaky_max (line 82) | def leaky_max(a: float, b: float):
function leaky_min (line 99) | def leaky_min(a: float, b: float):
function vec_min (line 116) | def vec_min(a: wp.vec3, b: wp.vec3):
function vec_max (line 131) | def vec_max(a: wp.vec3, b: wp.vec3):
function vec_leaky_min (line 146) | def vec_leaky_min(a: wp.vec3, b: wp.vec3):
function vec_leaky_max (line 163) | def vec_leaky_max(a: wp.vec3, b: wp.vec3):
function vec_abs (line 180) | def vec_abs(a: wp.vec3):
function vec_allclose (line 194) | def vec_allclose(a: Any, b: Any, rtol: float = 1e-5, atol: float = 1e-8)...
function vec_inside_limits (line 216) | def vec_inside_limits(a: Any, lower: Any, upper: Any) -> bool:
function orthonormal_basis (line 236) | def orthonormal_basis(n: wp.vec3):
function safe_div (line 282) | def safe_div(x: Any, y: Any, eps: float = EPSILON) -> Any:
function normalize_with_norm (line 297) | def normalize_with_norm(x: Any):
FILE: newton/_src/math/spatial.py
function quat_between_vectors_robust (line 10) | def quat_between_vectors_robust(from_vec: wp.vec3, to_vec: wp.vec3, eps:...
function velocity_at_point (line 54) | def velocity_at_point(qd: wp.spatial_vector, r: wp.vec3) -> wp.vec3:
function transform_twist (line 82) | def transform_twist(t: wp.transform, x: wp.spatial_vector) -> wp.spatial...
function transform_wrench (line 108) | def transform_wrench(t: wp.transform, x: wp.spatial_vector) -> wp.spatia...
function _wrap_angle_pm_pi (line 134) | def _wrap_angle_pm_pi(theta: float) -> float:
function quat_decompose (line 151) | def quat_decompose(q: wp.quat) -> wp.vec3:
function quat_velocity (line 179) | def quat_velocity(q_now: wp.quat, q_prev: wp.quat, dt: float) -> wp.vec3:
function quat_between_axes (line 215) | def quat_between_axes(*axes: AxisType) -> wp.quat:
FILE: newton/_src/sensors/sensor_contact.py
function compute_sensing_obj_transforms_kernel (line 23) | def compute_sensing_obj_transforms_kernel(
function accumulate_contact_forces_kernel (line 46) | def accumulate_contact_forces_kernel(
function expand_body_to_shape_kernel (line 104) | def expand_body_to_shape_kernel(
function _check_index_bounds (line 129) | def _check_index_bounds(indices: list[int], count: int, param_name: str,...
function _split_globals (line 136) | def _split_globals(indices: list[int], local_start: int, tail_global_sta...
function _normalize_world_start (line 147) | def _normalize_world_start(ws: list[int], world_count: int) -> list[int]:
function _ensure_sorted_unique (line 159) | def _ensure_sorted_unique(indices: list[int], param_name: str) -> list[i...
function _assign_counterpart_columns (line 173) | def _assign_counterpart_columns(
class SensorContact (line 211) | class SensorContact:
class ObjectType (line 282) | class ObjectType(Enum):
method __init__ (line 330) | def __init__(
method _init_deprecated_shims (line 552) | def _init_deprecated_shims(self, measure_total: bool, world_count: int...
method shape (line 562) | def shape(self) -> tuple[int, int]:
method sensing_objs (line 572) | def sensing_objs(self) -> list[list[tuple[int, ObjectType]]]:
method counterparts (line 589) | def counterparts(self) -> list[list[tuple[int, ObjectType]]]:
method reading_indices (line 623) | def reading_indices(self) -> list[list[list[int]]]:
method update (line 640) | def update(self, state: State | None, contacts: Contacts):
method net_force (line 682) | def net_force(self) -> wp.array2d:
method _eval_forces (line 692) | def _eval_forces(self, contacts: Contacts):
FILE: newton/_src/sensors/sensor_frame_transform.py
function compute_shape_transforms_kernel (line 15) | def compute_shape_transforms_kernel(
function compute_relative_transforms_kernel (line 47) | def compute_relative_transforms_kernel(
class SensorFrameTransform (line 79) | class SensorFrameTransform:
method __init__ (line 120) | def __init__(
method update (line 217) | def update(self, state: State):
FILE: newton/_src/sensors/sensor_imu.py
function compute_sensor_imu_kernel (line 15) | def compute_sensor_imu_kernel(
class SensorIMU (line 67) | class SensorIMU:
method __init__ (line 114) | def __init__(
method _validate_sensor_sites (line 164) | def _validate_sensor_sites(self, sensor_sites: list[int]):
method update (line 173) | def update(self, state: State):
FILE: newton/_src/sensors/sensor_raycast.py
function clamp_no_hits_kernel (line 15) | def clamp_no_hits_kernel(depth_image: wp.array[float], max_dist: float):
class SensorRaycast (line 27) | class SensorRaycast:
method __init__ (line 63) | def __init__(
method _compute_camera_basis (line 115) | def _compute_camera_basis(self, direction: np.ndarray, up: np.ndarray):
method update (line 143) | def update(
method _get_particle_grid (line 216) | def _get_particle_grid(self) -> wp.HashGrid:
method _raycast_particles (line 223) | def _raycast_particles(
method _does_state_have_particles (line 282) | def _does_state_have_particles(self, state: State) -> bool:
method _compute_particle_march_steps (line 293) | def _compute_particle_march_steps(self, step: float) -> tuple[int, boo...
method _clamp_no_hits (line 314) | def _clamp_no_hits(self):
method get_depth_image (line 326) | def get_depth_image(self) -> wp.array2d:
method get_depth_image_numpy (line 336) | def get_depth_image_numpy(self) -> np.ndarray:
method update_camera_pose (line 345) | def update_camera_pose(
method update_camera_parameters (line 369) | def update_camera_parameters(
method point_camera_at (line 407) | def point_camera_at(
FILE: newton/_src/sensors/sensor_tiled_camera.py
class _SensorTiledCameraMeta (line 24) | class _SensorTiledCameraMeta(type):
method RenderContext (line 26) | def RenderContext(cls) -> type[RenderContext]:
class SensorTiledCamera (line 35) | class SensorTiledCamera(metaclass=_SensorTiledCameraMeta):
class Config (line 76) | class Config:
method __init__ (line 110) | def __init__(self, model: Model, *, config: Config | RenderConfig | No...
method sync_transforms (line 164) | def sync_transforms(self, state: State):
method update (line 174) | def update(
method compute_pinhole_camera_rays (line 223) | def compute_pinhole_camera_rays(
method flatten_color_image_to_rgba (line 250) | def flatten_color_image_to_rgba(
method flatten_normal_image_to_rgba (line 275) | def flatten_normal_image_to_rgba(
method flatten_depth_image_to_rgba (line 300) | def flatten_depth_image_to_rgba(
method assign_random_colors_per_world (line 328) | def assign_random_colors_per_world(self, seed: int = 100):
method assign_random_colors_per_shape (line 344) | def assign_random_colors_per_shape(self, seed: int = 100):
method create_default_light (line 360) | def create_default_light(self, enable_shadows: bool = True):
method assign_checkerboard_material_to_all_shapes (line 376) | def assign_checkerboard_material_to_all_shapes(self, resolution: int =...
method create_color_image_output (line 396) | def create_color_image_output(self, width: int, height: int, camera_co...
method create_depth_image_output (line 417) | def create_depth_image_output(self, width: int, height: int, camera_co...
method create_shape_index_image_output (line 438) | def create_shape_index_image_output(self, width: int, height: int, cam...
method create_normal_image_output (line 459) | def create_normal_image_output(self, width: int, height: int, camera_c...
method create_albedo_image_output (line 480) | def create_albedo_image_output(self, width: int, height: int, camera_c...
method render_context (line 502) | def render_context(self) -> RenderContext:
method render_config (line 521) | def render_config(self) -> RenderConfig:
method utils (line 535) | def utils(self) -> Utils:
FILE: newton/_src/sensors/warp_raytrace/bvh.py
function compute_shape_bounds (line 11) | def compute_shape_bounds(
function compute_box_bounds (line 56) | def compute_box_bounds(transform: wp.transformf, size: wp.vec3f) -> tupl...
function compute_sphere_bounds (line 76) | def compute_sphere_bounds(pos: wp.vec3f, radius: wp.float32) -> tuple[wp...
function compute_capsule_bounds (line 81) | def compute_capsule_bounds(transform: wp.transformf, size: wp.vec3f) -> ...
function compute_cylinder_bounds (line 89) | def compute_cylinder_bounds(transform: wp.transformf, size: wp.vec3f) ->...
function compute_cone_bounds (line 97) | def compute_cone_bounds(transform: wp.transformf, size: wp.vec3f) -> tup...
function compute_plane_bounds (line 103) | def compute_plane_bounds(transform: wp.transformf, size: wp.vec3f) -> tu...
function compute_ellipsoid_bounds (line 128) | def compute_ellipsoid_bounds(transform: wp.transformf, size: wp.vec3f) -...
function compute_shape_bvh_bounds (line 134) | def compute_shape_bvh_bounds(
function compute_particle_bvh_bounds (line 193) | def compute_particle_bvh_bounds(
function compute_bvh_group_roots (line 225) | def compute_bvh_group_roots(bvh_id: wp.uint64, out_bvh_group_roots: wp.a...
FILE: newton/_src/sensors/warp_raytrace/gaussians.py
function compute_gaussian_bounds (line 24) | def compute_gaussian_bounds(gaussians_data: Gaussian.Data, tid: wp.int32...
function compute_gaussian_bvh_bounds (line 37) | def compute_gaussian_bvh_bounds(
function canonical_ray_hit_distance (line 49) | def canonical_ray_hit_distance(ray_origin: wp.vec3f, ray_direction: wp.v...
function canonical_ray_min_squared_distance (line 55) | def canonical_ray_min_squared_distance(ray_origin: wp.vec3f, ray_directi...
function canonical_ray_max_kernel_response (line 61) | def canonical_ray_max_kernel_response(ray_origin: wp.vec3f, ray_directio...
function ray_gsplat_hit_response (line 66) | def ray_gsplat_hit_response(
function create_shade_function (line 90) | def create_shade_function(config: RenderContext.Config, state: RenderCon...
FILE: newton/_src/sensors/warp_raytrace/lighting.py
function create_compute_lighting_function (line 17) | def create_compute_lighting_function(config: RenderContext.Config, state...
FILE: newton/_src/sensors/warp_raytrace/ray_intersect.py
class GeomHit (line 13) | class GeomHit:
function safe_div_vec3 (line 20) | def safe_div_vec3(x: wp.vec3f, y: wp.vec3f) -> wp.vec3f:
function map_ray_to_local (line 29) | def map_ray_to_local(
function map_ray_to_local_scaled (line 50) | def map_ray_to_local_scaled(
function ray_intersect_plane (line 60) | def ray_intersect_plane(
function ray_intersect_plane_with_normal (line 96) | def ray_intersect_plane_with_normal(
function ray_intersect_sphere_with_normal (line 114) | def ray_intersect_sphere_with_normal(
function ray_intersect_particle_sphere_with_normal (line 129) | def ray_intersect_particle_sphere_with_normal(
function ray_intersect_capsule_with_normal (line 142) | def ray_intersect_capsule_with_normal(
function ray_intersect_ellipsoid_with_normal (line 161) | def ray_intersect_ellipsoid_with_normal(
function ray_intersect_cylinder_with_normal (line 182) | def ray_intersect_cylinder_with_normal(
function ray_intersect_cone_with_normal (line 203) | def ray_intersect_cone_with_normal(
function ray_intersect_box_with_normal (line 240) | def ray_intersect_box_with_normal(
function ray_intersect_mesh_no_transform (line 273) | def ray_intersect_mesh_no_transform(
function ray_intersect_mesh_with_normal (line 299) | def ray_intersect_mesh_with_normal(
function ray_intersect_mesh (line 344) | def ray_intersect_mesh(
FILE: newton/_src/sensors/warp_raytrace/raytrace.py
class ClosestHit (line 25) | class ClosestHit:
function get_group_roots (line 36) | def get_group_roots(group_roots: wp.array[wp.int32], world_index: wp.int...
function create_closest_hit_function (line 42) | def create_closest_hit_function(config: RenderContext.Config, state: Ren...
function create_closest_hit_depth_only_function (line 331) | def create_closest_hit_depth_only_function(config: RenderContext.Config,...
function create_first_hit_function (line 577) | def create_first_hit_function(config: RenderContext.Config, state: Rende...
FILE: newton/_src/sensors/warp_raytrace/render.py
function create_kernel (line 18) | def create_kernel(
FILE: newton/_src/sensors/warp_raytrace/render_context.py
function compute_shape_bounds (line 29) | def compute_shape_bounds(
function convert_newton_transform (line 58) | def convert_newton_transform(
function is_supported_shape_type (line 78) | def is_supported_shape_type(shape_type: wp.int32) -> wp.bool:
function compute_enabled_shapes (line 102) | def compute_enabled_shapes(
class RenderContext (line 120) | class RenderContext:
class State (line 125) | class State:
method __init__ (line 137) | def __init__(self, world_count: int = 1, config: Config | None = None,...
method init_from_model (line 195) | def init_from_model(self, model: Model, load_textures: bool = True):
method update (line 258) | def update(self, model: Model, state: State):
method refit_bvh (line 288) | def refit_bvh(self):
method render (line 310) | def render(
method world_count_total (line 473) | def world_count_total(self) -> int:
method particle_count_total (line 479) | def particle_count_total(self) -> int:
method light_count (line 485) | def light_count(self) -> int:
method gaussians_count_total (line 491) | def gaussians_count_total(self) -> int:
method has_shapes (line 497) | def has_shapes(self) -> bool:
method has_particles (line 501) | def has_particles(self) -> bool:
method has_triangle_mesh (line 505) | def has_triangle_mesh(self) -> bool:
method has_gaussians (line 509) | def has_gaussians(self) -> bool:
method triangle_points (line 513) | def triangle_points(self) -> wp.array[wp.vec3f]:
method triangle_points (line 517) | def triangle_points(self, triangle_points: wp.array[wp.vec3f]):
method triangle_indices (line 523) | def triangle_indices(self) -> wp.array[wp.int32]:
method triangle_indices (line 527) | def triangle_indices(self, triangle_indices: wp.array[wp.int32]):
method particles_position (line 533) | def particles_position(self) -> wp.array[wp.vec3f]:
method particles_position (line 537) | def particles_position(self, particles_position: wp.array[wp.vec3f]):
method particles_radius (line 543) | def particles_radius(self) -> wp.array[wp.float32]:
method particles_radius (line 547) | def particles_radius(self, particles_radius: wp.array[wp.float32]):
method particles_world_index (line 553) | def particles_world_index(self) -> wp.array[wp.int32]:
method particles_world_index (line 557) | def particles_world_index(self, particles_world_index: wp.array[wp.int...
method gaussians_data (line 563) | def gaussians_data(self) -> wp.array[Gaussian.Data]:
method gaussians_data (line 567) | def gaussians_data(self, gaussians_data: wp.array[Gaussian.Data]):
method __update_bvh (line 574) | def __update_bvh(
method __compute_bvh_bounds_shapes (line 619) | def __compute_bvh_bounds_shapes(
method __compute_bvh_bounds_particles (line 642) | def __compute_bvh_bounds_particles(
method __compute_shape_bounds (line 662) | def __compute_shape_bounds(self):
method __load_texture_and_mesh_data (line 676) | def __load_texture_and_mesh_data(self, model: Model, load_textures: bo...
method create_color_image_output (line 753) | def create_color_image_output(self, width: int, height: int, camera_co...
method create_depth_image_output (line 766) | def create_depth_image_output(self, width: int, height: int, camera_co...
method create_shape_index_image_output (line 779) | def create_shape_index_image_output(self, width: int, height: int, cam...
method create_normal_image_output (line 792) | def create_normal_image_output(self, width: int, height: int, camera_c...
method create_albedo_image_output (line 805) | def create_albedo_image_output(self, width: int, height: int, camera_c...
FILE: newton/_src/sensors/warp_raytrace/textures.py
function flip_v (line 11) | def flip_v(uv: wp.vec2f) -> wp.vec2f:
function sample_texture_2d (line 16) | def sample_texture_2d(uv: wp.vec2f, texture_data: TextureData) -> wp.vec3f:
function sample_texture_plane (line 22) | def sample_texture_plane(
function sample_texture_mesh (line 34) | def sample_texture_mesh(
function sample_texture (line 51) | def sample_texture(
FILE: newton/_src/sensors/warp_raytrace/tiling.py
function tid_to_coord_tiled (line 8) | def tid_to_coord_tiled(
function tid_to_coord_pixel_priority (line 39) | def tid_to_coord_pixel_priority(tid: wp.int32, world_count: wp.int32, ca...
function tid_to_coord_view_priority (line 55) | def tid_to_coord_view_priority(tid: wp.int32, camera_count: wp.int32, wi...
function pack_rgba_to_uint32 (line 71) | def pack_rgba_to_uint32(rgb: wp.vec3f, alpha: wp.float32) -> wp.uint32:
FILE: newton/_src/sensors/warp_raytrace/types.py
class RenderLightType (line 10) | class RenderLightType(enum.IntEnum):
class RenderOrder (line 20) | class RenderOrder(enum.IntEnum):
class GaussianRenderMode (line 31) | class GaussianRenderMode(enum.IntEnum):
class RenderConfig (line 42) | class RenderConfig:
class ClearData (line 86) | class ClearData:
class MeshData (line 97) | class MeshData:
class TextureData (line 110) | class TextureData:
FILE: newton/_src/sensors/warp_raytrace/utils.py
function compute_pinhole_camera_rays (line 21) | def compute_pinhole_camera_rays(
function flatten_color_image (line 38) | def flatten_color_image(
function flatten_normal_image (line 64) | def flatten_normal_image(
function find_depth_range (line 90) | def find_depth_range(depth_image: wp.array4d[wp.float32], depth_range: w...
function flatten_depth_image (line 99) | def flatten_depth_image(
function convert_ray_depth_to_forward_depth_kernel (line 131) | def convert_ray_depth_to_forward_depth_kernel(
class Utils (line 148) | class Utils:
method __init__ (line 151) | def __init__(self, render_context: RenderContext):
method create_color_image_output (line 154) | def create_color_image_output(self, width: int, height: int, camera_co...
method create_depth_image_output (line 171) | def create_depth_image_output(self, width: int, height: int, camera_co...
method create_shape_index_image_output (line 188) | def create_shape_index_image_output(self, width: int, height: int, cam...
method create_normal_image_output (line 205) | def create_normal_image_output(self, width: int, height: int, camera_c...
method create_albedo_image_output (line 222) | def create_albedo_image_output(self, width: int, height: int, camera_c...
method compute_pinhole_camera_rays (line 239) | def compute_pinhole_camera_rays(
method convert_ray_depth_to_forward_depth (line 280) | def convert_ray_depth_to_forward_depth(
method flatten_color_image_to_rgba (line 330) | def flatten_color_image_to_rgba(
method flatten_normal_image_to_rgba (line 373) | def flatten_normal_image_to_rgba(
method flatten_depth_image_to_rgba (line 416) | def flatten_depth_image_to_rgba(
method assign_random_colors_per_world (line 467) | def assign_random_colors_per_world(self, seed: int = 100):
method assign_random_colors_per_shape (line 491) | def assign_random_colors_per_shape(self, seed: int = 100):
method create_default_light (line 509) | def create_default_light(self, enable_shadows: bool = True, direction:...
method assign_checkerboard_material_to_all_shapes (line 532) | def assign_checkerboard_material_to_all_shapes(self, resolution: int =...
method __reshape_buffer_for_flatten (line 570) | def __reshape_buffer_for_flatten(
FILE: newton/_src/sim/articulation.py
function compute_2d_rotational_dofs (line 15) | def compute_2d_rotational_dofs(
function invert_2d_rotational_dofs (line 46) | def invert_2d_rotational_dofs(
function compute_3d_rotational_dofs (line 88) | def compute_3d_rotational_dofs(
function invert_3d_rotational_dofs (line 126) | def invert_3d_rotational_dofs(
function eval_single_articulation_fk (line 169) | def eval_single_articulation_fk(
function eval_articulation_fk (line 345) | def eval_articulation_fk(
function eval_fk (line 417) | def eval_fk(
function compute_shape_world_transforms (line 484) | def compute_shape_world_transforms(
function reconstruct_angular_q_qd (line 525) | def reconstruct_angular_q_qd(q_pc: wp.quat, w_err: wp.vec3, X_wp: wp.tra...
function eval_articulation_ik (line 548) | def eval_articulation_ik(
function eval_ik (line 766) | def eval_ik(
function jcalc_motion_subspace (line 832) | def jcalc_motion_subspace(
function eval_articulation_jacobian (line 907) | def eval_articulation_jacobian(
function eval_jacobian (line 993) | def eval_jacobian(
function transform_spatial_inertia (line 1068) | def transform_spatial_inertia(t: wp.transform, I: wp.spatial_matrix):
function compute_body_spatial_inertia (line 1100) | def compute_body_spatial_inertia(
function eval_articulation_mass_matrix (line 1137) | def eval_articulation_mass_matrix(
function eval_mass_matrix (line 1196) | def eval_mass_matrix(
FILE: newton/_src/sim/builder.py
class ModelBuilder (line 79) | class ModelBuilder:
method _shape_palette_color (line 190) | def _shape_palette_color(index: int) -> tuple[float, float, float]:
class ActuatorEntry (line 195) | class ActuatorEntry:
class ShapeConfig (line 208) | class ShapeConfig:
method configure_sdf (line 283) | def configure_sdf(
method validate (line 326) | def validate(self, shape_type: int | None = None) -> None:
method mark_as_site (line 366) | def mark_as_site(self) -> None:
method flags (line 383) | def flags(self) -> int:
method flags (line 394) | def flags(self, value: int):
method copy (line 416) | def copy(self) -> ModelBuilder.ShapeConfig:
class JointDofConfig (line 419) | class JointDofConfig:
method __init__ (line 424) | def __init__(
method create_unlimited (line 477) | def create_unlimited(cls, axis: AxisType | Vec3) -> ModelBuilder.Joi...
class CustomAttribute (line 493) | class CustomAttribute:
method __post_init__ (line 585) | def __post_init__(self):
method _default_for_dtype (line 610) | def _default_for_dtype(dtype: object) -> Any:
method key (line 624) | def key(self) -> str:
method is_custom_frequency (line 629) | def is_custom_frequency(self) -> bool:
method _create_empty_values_container (line 638) | def _create_empty_values_container(self) -> list | dict:
method _get_values_count (line 642) | def _get_values_count(self) -> int:
method build_array (line 648) | def build_array(
class CustomFrequency (line 674) | class CustomFrequency:
method __post_init__ (line 758) | def __post_init__(self):
method key (line 768) | def key(self) -> str:
method __init__ (line 772) | def __init__(self, up_axis: AxisType = Axis.Z, gravity: float = -9.81):
method add_shape_collision_filter_pair (line 1224) | def add_shape_collision_filter_pair(self, shape_a: int, shape_b: int) ...
method add_custom_attribute (line 1233) | def add_custom_attribute(self, attribute: CustomAttribute) -> None:
method add_custom_frequency (line 1306) | def add_custom_frequency(self, frequency: CustomFrequency) -> None:
method has_custom_attribute (line 1350) | def has_custom_attribute(self, key: str) -> bool:
method get_custom_attributes_by_frequency (line 1354) | def get_custom_attributes_by_frequency(
method get_custom_frequency_keys (line 1370) | def get_custom_frequency_keys(self) -> set[str]:
method add_custom_values (line 1374) | def add_custom_values(self, **kwargs: Any) -> dict[str, int]:
method add_custom_values_batch (line 1450) | def add_custom_values_batch(self, entries: Sequence[dict[str, Any]]) -...
method _process_custom_attributes (line 1465) | def _process_custom_attributes(
method _process_joint_custom_attributes (line 1523) | def _process_joint_custom_attributes(
method add_actuator (line 1677) | def add_actuator(
method _stack_args_to_arrays (line 1741) | def _stack_args_to_arrays(
method _build_index_array (line 1768) | def _build_index_array(indices: list[list[int]], device: Devicelike) -...
method default_site_cfg (line 1803) | def default_site_cfg(self) -> ShapeConfig:
method up_vector (line 1821) | def up_vector(self) -> tuple[float, float, float]:
method up_vector (line 1834) | def up_vector(self, _):
method current_world (line 1840) | def current_world(self) -> int:
method current_world (line 1853) | def current_world(self, _):
method shape_count (line 1863) | def shape_count(self):
method body_count (line 1870) | def body_count(self):
method joint_count (line 1877) | def joint_count(self):
method particle_count (line 1884) | def particle_count(self):
method tri_count (line 1891) | def tri_count(self):
method tet_count (line 1898) | def tet_count(self):
method edge_count (line 1905) | def edge_count(self):
method spring_count (line 1912) | def spring_count(self):
method muscle_count (line 1919) | def muscle_count(self):
method articulation_count (line 1926) | def articulation_count(self):
method replicate (line 1934) | def replicate(
method add_articulation (line 1965) | def add_articulation(
method add_urdf (line 2073) | def add_urdf(
method add_usd (line 2216) | def add_usd(
method add_mjcf (line 2442) | def add_mjcf(
method begin_world (line 2626) | def begin_world(
method end_world (line 2696) | def end_world(self):
method add_world (line 2720) | def add_world(
method add_builder (line 2765) | def add_builder(
method _coerce_mat33 (line 3279) | def _coerce_mat33(value: Any) -> wp.mat33:
method _external_warning_stacklevel (line 3304) | def _external_warning_stacklevel() -> int:
method _warn_body_armature_arg_deprecated (line 3320) | def _warn_body_armature_arg_deprecated(cls) -> None:
method _warn_default_body_armature_deprecated (line 3328) | def _warn_default_body_armature_deprecated(cls) -> None:
method default_body_armature (line 3336) | def default_body_armature(self) -> float:
method default_body_armature (line 3346) | def default_body_armature(self, value: float) -> None:
method add_link (line 3350) | def add_link(
method add_body (line 3447) | def add_body(
method add_joint (line 3521) | def add_joint(
method add_joint_revolute (line 3691) | def add_joint_revolute(
method add_joint_prismatic (line 3784) | def add_joint_prismatic(
method add_joint_ball (line 3875) | def add_joint_ball(
method add_joint_fixed (line 3948) | def add_joint_fixed(
method add_joint_free (line 3994) | def add_joint_free(
method add_joint_distance (line 4050) | def add_joint_distance(
method add_joint_d6 (line 4109) | def add_joint_d6(
method add_joint_cable (line 4162) | def add_joint_cable(
method add_equality_constraint (line 4240) | def add_equality_constraint(
method add_equality_constraint_connect (line 4315) | def add_equality_constraint_connect(
method add_equality_constraint_joint (line 4349) | def add_equality_constraint_joint(
method add_equality_constraint_weld (line 4383) | def add_equality_constraint_weld(
method add_constraint_mimic (line 4423) | def add_constraint_mimic(
method plot_articulation (line 4486) | def plot_articulation(
method collapse_fixed_joints (line 4624) | def collapse_fixed_joints(
method add_muscle (line 5141) | def add_muscle(
method add_shape (line 5177) | def add_shape(
method add_shape_plane (line 5338) | def add_shape_plane(
method add_ground_plane (line 5403) | def add_ground_plane(
method add_shape_sphere (line 5430) | def add_shape_sphere(
method add_shape_ellipsoid (line 5474) | def add_shape_ellipsoid(
method add_shape_box (line 5569) | def add_shape_box(
method add_shape_capsule (line 5619) | def add_shape_capsule(
method add_shape_cylinder (line 5672) | def add_shape_cylinder(
method add_shape_cone (line 5725) | def add_shape_cone(
method add_shape_mesh (line 5779) | def add_shape_mesh(
method add_shape_convex_hull (line 5820) | def add_shape_convex_hull(
method add_shape_heightfield (line 5861) | def add_shape_heightfield(
method add_shape_gaussian (line 5907) | def add_shape_gaussian(
method add_site (line 6008) | def add_site(
method approximate_meshes (line 6064) | def approximate_meshes(
method add_rod (line 6344) | def add_rod(
method add_rod_graph (line 6531) | def add_rod_graph(
method add_particle (line 6917) | def add_particle(
method add_particles (line 6963) | def add_particles(
method add_spring (line 7009) | def add_spring(
method add_triangle (line 7057) | def add_triangle(
method add_triangles (line 7140) | def add_triangles(
method add_tetrahedron (line 7253) | def add_tetrahedron(
method add_edge (line 7320) | def add_edge(
method add_edges (line 7391) | def add_edges(
method add_cloth_grid (line 7488) | def add_cloth_grid(
method add_cloth_mesh (line 7608) | def add_cloth_mesh(
method add_particle_grid (line 7741) | def add_particle_grid(
method add_soft_grid (line 7843) | def add_soft_grid(
method add_soft_mesh (line 8006) | def add_soft_mesh(
method _update_body_mass (line 8213) | def _update_body_mass(self, i: int, m: float, inertia: Mat33, p: Vec3,...
method _validate_parent_body (line 8247) | def _validate_parent_body(self, parent_body: int, child: int) -> None:
method _validate_kinematic_joint_attachment (line 8284) | def _validate_kinematic_joint_attachment(self, child: int, parent: int...
method _validate_kinematic_articulation_joints (line 8296) | def _validate_kinematic_articulation_joints(self, joint_indices: Itera...
method _find_articulation_for_body (line 8301) | def _find_articulation_for_body(self, body_id: int) -> int | None:
method _validate_base_joint_params (line 8362) | def _validate_base_joint_params(floating: bool | None, base_joint: dic...
method _check_sequential_composition (line 8412) | def _check_sequential_composition(self, parent_body: int) -> int | None:
method _finalize_imported_articulation (line 8445) | def _finalize_imported_articulation(
method _add_base_joint (line 8503) | def _add_base_joint(
method _add_base_joints_to_floating_bodies (line 8583) | def _add_base_joints_to_floating_bodies(
method request_contact_attributes (line 8619) | def request_contact_attributes(self, *attributes: str) -> None:
method request_state_attributes (line 8632) | def request_state_attributes(self, *attributes: str) -> None:
method set_coloring (line 8647) | def set_coloring(self, particle_color_groups: Iterable[Iterable[int] |...
method color (line 8661) | def color(
method _validate_world_ordering (line 8755) | def _validate_world_ordering(self):
method _validate_joints (line 8859) | def _validate_joints(self):
method _validate_shapes (line 8898) | def _validate_shapes(self) -> bool:
method _validate_structure (line 8938) | def _validate_structure(self) -> None:
method validate_joint_ordering (line 9151) | def validate_joint_ordering(self) -> bool:
method _build_world_starts (line 9224) | def _build_world_starts(self):
method finalize (line 9424) | def finalize(
method _test_group_pair (line 10410) | def _test_group_pair(self, group_a: int, group_b: int) -> bool:
method _test_world_and_group_pair (line 10430) | def _test_world_and_group_pair(
method find_shape_contact_pairs (line 10453) | def find_shape_contact_pairs(self, model: Model):
FILE: newton/_src/sim/collide.py
class ContactWriterData (line 31) | class ContactWriterData:
function write_contact (line 59) | def write_contact(
function compute_shape_aabbs (line 142) | def compute_shape_aabbs(
function prepare_geom_data_kernel (line 243) | def prepare_geom_data_kernel(
function _estimate_rigid_contact_max (line 270) | def _estimate_rigid_contact_max(model: Model) -> int:
function _normalize_broad_phase_mode (line 374) | def _normalize_broad_phase_mode(mode: str) -> str:
function _infer_broad_phase_mode_from_instance (line 381) | def _infer_broad_phase_mode_from_instance(broad_phase: BroadPhaseAllPair...
class CollisionPipeline (line 394) | class CollisionPipeline:
method __init__ (line 413) | def __init__(
method rigid_contact_max (line 663) | def rigid_contact_max(self) -> int:
method soft_contact_max (line 668) | def soft_contact_max(self) -> int:
method contacts (line 672) | def contacts(self) -> Contacts:
method _build_excluded_pairs (line 701) | def _build_excluded_pairs(model: Model) -> wp.array[wp.vec2i] | None:
method collide (line 714) | def collide(
FILE: newton/_src/sim/contacts.py
class Contacts (line 10) | class Contacts:
method validate_extended_attributes (line 34) | def validate_extended_attributes(cls, attributes: tuple[str, ...]) -> ...
method __init__ (line 54) | def __init__(
method clear (line 202) | def clear(self):
method device (line 246) | def device(self):
FILE: newton/_src/sim/control.py
class Control (line 9) | class Control:
method __init__ (line 19) | def __init__(self):
method clear (line 63) | def clear(self) -> None:
method _clear_namespaced_arrays (line 82) | def _clear_namespaced_arrays(self) -> None:
FILE: newton/_src/sim/enums.py
class BodyFlags (line 8) | class BodyFlags(IntEnum):
class JointType (line 29) | class JointType(IntEnum):
method dof_count (line 58) | def dof_count(self, num_axes: int) -> tuple[int, int]:
method constraint_count (line 90) | def constraint_count(self, num_axes: int) -> int:
class EqType (line 116) | class EqType(IntEnum):
class JointTargetMode (line 134) | class JointTargetMode(IntEnum):
method from_gains (line 165) | def from_gains(
FILE: newton/_src/sim/graph_coloring.py
class ColoringAlgorithm (line 12) | class ColoringAlgorithm(Enum):
function validate_graph_coloring (line 18) | def validate_graph_coloring(edge_indices: wp.array2d[int], colors: wp.ar...
function count_color_group_size (line 27) | def count_color_group_size(
function fill_color_groups (line 37) | def fill_color_groups(
function convert_to_color_groups (line 53) | def convert_to_color_groups(num_colors, particle_colors, return_wp_array...
function _canonicalize_edges_np (line 89) | def _canonicalize_edges_np(edges_np: np.ndarray) -> np.ndarray:
function construct_tetmesh_graph_edges (line 98) | def construct_tetmesh_graph_edges(tet_indices: np.array, tet_active_mask):
function construct_trimesh_graph_edges (line 143) | def construct_trimesh_graph_edges(
function construct_particle_graph (line 244) | def construct_particle_graph(
function color_graph (line 287) | def color_graph(
function plot_graph (line 360) | def plot_graph(
function combine_independent_particle_coloring (line 428) | def combine_independent_particle_coloring(color_groups_1, color_groups_2...
function color_rigid_bodies (line 475) | def color_rigid_bodies(
FILE: newton/_src/sim/ik/ik_common.py
class IKJacobianType (line 16) | class IKJacobianType(Enum):
function _eval_fk_articulation_batched (line 32) | def _eval_fk_articulation_batched(
function eval_fk_batched (line 79) | def eval_fk_batched(model, joint_q, joint_qd, body_q, body_qd):
function fk_accum (line 108) | def fk_accum(
function compute_costs (line 123) | def compute_costs(
FILE: newton/_src/sim/ik/ik_lbfgs_optimizer.py
function _scale_negate (line 21) | def _scale_negate(
function _fan_out_problem_idx (line 32) | def _fan_out_problem_idx(
function _generate_candidates_velocity (line 41) | def _generate_candidates_velocity(
function _apply_residual_mask (line 62) | def _apply_residual_mask(
function _accumulate_gradients (line 72) | def _accumulate_gradients(
class BatchCtx (line 81) | class BatchCtx:
class IKOptimizerLBFGS (line 105) | class IKOptimizerLBFGS:
method __new__ (line 136) | def __new__(
method __init__ (line 159) | def __init__(
method _alloc_solver_buffers (line 233) | def _alloc_solver_buffers(self, grad: bool) -> None:
method _alloc_line_search_buffers (line 270) | def _alloc_line_search_buffers(self, grad: bool, line_search_alphas: S...
method _alloc_line_search_analytic_buffers (line 347) | def _alloc_line_search_analytic_buffers(self) -> None:
method _alloc_mixed_buffers (line 377) | def _alloc_mixed_buffers(self) -> None:
method _build_residual_offsets (line 418) | def _build_residual_offsets(self) -> None:
method _ctx_solver (line 425) | def _ctx_solver(
method _ctx_candidates (line 461) | def _ctx_candidates(self) -> BatchCtx:
method _validate_ctx (line 520) | def _validate_ctx(
method _gradient_at (line 570) | def _gradient_at(self, ctx: BatchCtx, out_grad: wp.array2d[wp.float32]...
method _grad_autodiff (line 581) | def _grad_autodiff(self, ctx: BatchCtx, out_grad: wp.array2d[wp.float3...
method _grad_analytic (line 625) | def _grad_analytic(
method _for_objectives_residuals (line 680) | def _for_objectives_residuals(self, ctx: BatchCtx) -> None:
method _residuals_autodiff (line 700) | def _residuals_autodiff(self, ctx: BatchCtx) -> None:
method _residuals_analytic (line 712) | def _residuals_analytic(self, ctx: BatchCtx) -> None:
method _init_objectives (line 724) | def _init_objectives(self) -> None:
method _init_cuda_streams (line 735) | def _init_cuda_streams(self) -> None:
method _parallel_for_objectives (line 750) | def _parallel_for_objectives(self, fn: Callable[..., None], *extra: An...
method step (line 768) | def step(
method reset (line 796) | def reset(self) -> None:
method compute_costs (line 813) | def compute_costs(self, joint_q: wp.array2d[wp.float32]) -> wp.array[w...
method _compute_residuals (line 832) | def _compute_residuals(
method _compute_motion_subspace (line 847) | def _compute_motion_subspace(
method _integrate_dq (line 875) | def _integrate_dq(
method _step (line 907) | def _step(self, joint_q: wp.array2d[wp.float32], iteration: int = 0) -...
method _compute_initial_slope (line 942) | def _compute_initial_slope(self) -> None:
method _compute_search_direction (line 953) | def _compute_search_direction(self) -> None:
method _update_history (line 975) | def _update_history(self) -> None:
method _line_search (line 998) | def _line_search(self, joint_q: wp.array2d[wp.float32]) -> None:
method _line_search_select_best (line 1060) | def _line_search_select_best(self, joint_q: wp.array2d[wp.float32]) ->...
method _build_specialized (line 1097) | def _build_specialized(cls, key: tuple[int, int, int, int, str]) -> ty...
FILE: newton/_src/sim/ik/ik_lm_optimizer.py
class BatchCtx (line 21) | class BatchCtx:
function _accept_reject (line 41) | def _accept_reject(
function _update_lm_state (line 54) | def _update_lm_state(
class IKOptimizerLM (line 83) | class IKOptimizerLM:
method __new__ (line 112) | def __new__(
method __init__ (line 132) | def __init__(
method _init_objectives (line 180) | def _init_objectives(self) -> None:
method _init_cuda_streams (line 191) | def _init_cuda_streams(self) -> None:
method _parallel_for_objectives (line 206) | def _parallel_for_objectives(self, fn: Callable[..., None], *extra: An...
method _alloc_solver_buffers (line 224) | def _alloc_solver_buffers(self, grad: bool) -> None:
method _build_residual_offsets (line 262) | def _build_residual_offsets(self) -> None:
method _ctx_solver (line 270) | def _ctx_solver(
method _validate_ctx_for_mode (line 294) | def _validate_ctx_for_mode(self, ctx: BatchCtx) -> None:
method _for_objectives_residuals (line 320) | def _for_objectives_residuals(self, ctx: BatchCtx) -> None:
method _residuals_autodiff (line 340) | def _residuals_autodiff(self, ctx: BatchCtx) -> None:
method _residuals_analytic (line 352) | def _residuals_analytic(self, ctx: BatchCtx) -> None:
method _jacobian_at (line 364) | def _jacobian_at(self, ctx: BatchCtx) -> wp.array3d[wp.float32]:
method _jacobian_autodiff (line 386) | def _jacobian_autodiff(self, ctx: BatchCtx) -> None:
method _jacobian_analytic (line 422) | def _jacobian_analytic(self, ctx: BatchCtx, *, accumulate: bool) -> None:
method step (line 448) | def step(
method _compute_residuals (line 480) | def _compute_residuals(
method _compute_motion_subspace (line 495) | def _compute_motion_subspace(
method _integrate_dq (line 523) | def _integrate_dq(
method _step (line 555) | def _step(
method reset (line 638) | def reset(self) -> None:
method compute_costs (line 643) | def compute_costs(self, joint_q: wp.array2d[wp.float32]) -> wp.array[w...
method _solve_tiled (line 662) | def _solve_tiled(
method _build_specialized (line 673) | def _build_specialized(cls, key: tuple[int, int, str]) -> type[IKOptim...
FILE: newton/_src/sim/ik/ik_objectives.py
class IKObjective (line 15) | class IKObjective:
method __init__ (line 30) | def __init__(self) -> None:
method set_batch_layout (line 36) | def set_batch_layout(self, total_residuals: int, residual_offset: int,...
method _require_batch_layout (line 57) | def _require_batch_layout(self) -> None:
method residual_dim (line 61) | def residual_dim(self) -> int:
method compute_residuals (line 65) | def compute_residuals(
method compute_jacobian_autodiff (line 93) | def compute_jacobian_autodiff(
method supports_analytic (line 115) | def supports_analytic(self) -> bool:
method bind_device (line 119) | def bind_device(self, device: wp.DeviceLike) -> None:
method init_buffers (line 123) | def init_buffers(self, model: Model, jacobian_mode: IKJacobianType) ->...
method compute_jacobian_analytic (line 133) | def compute_jacobian_analytic(
function _pos_residuals (line 160) | def _pos_residuals(
function _pos_jac_fill (line 184) | def _pos_jac_fill(
function _update_position_target (line 200) | def _update_position_target(
function _update_position_targets (line 210) | def _update_position_targets(
function _pos_jac_analytic (line 220) | def _pos_jac_analytic(
class IKObjectivePosition (line 257) | class IKObjectivePosition(IKObjective):
method __init__ (line 267) | def __init__(
method init_buffers (line 283) | def init_buffers(self, model: Model, jacobian_mode: IKJacobianType) ->...
method supports_analytic (line 324) | def supports_analytic(self) -> bool:
method set_target_position (line 328) | def set_target_position(self, problem_idx: int, new_position: wp.vec3)...
method set_target_positions (line 345) | def set_target_positions(self, new_positions: wp.array[wp.vec3]) -> None:
method residual_dim (line 363) | def residual_dim(self) -> int:
method compute_residuals (line 367) | def compute_residuals(
method compute_jacobian_autodiff (line 409) | def compute_jacobian_autodiff(
method compute_jacobian_analytic (line 454) | def compute_jacobian_analytic(
function _limit_residuals (line 499) | def _limit_residuals(
function _limit_jac_fill (line 529) | def _limit_jac_fill(
function _limit_jac_analytic (line 542) | def _limit_jac_analytic(
class IKObjectiveJointLimit (line 575) | class IKObjectiveJointLimit(IKObjective):
method __init__ (line 591) | def __init__(
method init_buffers (line 607) | def init_buffers(self, model: Model, jacobian_mode: IKJacobianType) ->...
method supports_analytic (line 634) | def supports_analytic(self) -> bool:
method residual_dim (line 638) | def residual_dim(self) -> int:
method compute_residuals (line 642) | def compute_residuals(
method compute_jacobian_autodiff (line 685) | def compute_jacobian_autodiff(
method compute_jacobian_analytic (line 722) | def compute_jacobian_analytic(
function _rot_residuals (line 766) | def _rot_residuals(
function _rot_jac_fill (line 812) | def _rot_jac_fill(
function _update_rotation_target (line 829) | def _update_rotation_target(
function _update_rotation_targets (line 839) | def _update_rotation_targets(
function _rot_jac_analytic (line 849) | def _rot_jac_analytic(
class IKObjectiveRotation (line 875) | class IKObjectiveRotation(IKObjective):
method __init__ (line 889) | def __init__(
method init_buffers (line 907) | def init_buffers(self, model: Model, jacobian_mode: IKJacobianType) ->...
method supports_analytic (line 948) | def supports_analytic(self) -> bool:
method set_target_rotation (line 952) | def set_target_rotation(self, problem_idx: int, new_rotation: wp.vec4)...
method set_target_rotations (line 969) | def set_target_rotations(self, new_rotations: wp.array[wp.vec4]) -> None:
method residual_dim (line 988) | def residual_dim(self) -> int:
method compute_residuals (line 992) | def compute_residuals(
method compute_jacobian_autodiff (line 1035) | def compute_jacobian_autodiff(
method compute_jacobian_analytic (line 1080) | def compute_jacobian_analytic(
FILE: newton/_src/sim/ik/ik_solver.py
class IKOptimizer (line 22) | class IKOptimizer(str, Enum):
class IKSampler (line 32) | class IKSampler(str, Enum):
function _sample_none_kernel (line 49) | def _sample_none_kernel(
function _sample_gauss_kernel (line 63) | def _sample_gauss_kernel(
function _sample_uniform_kernel (line 95) | def _sample_uniform_kernel(
function _sample_roberts_kernel (line 120) | def _sample_roberts_kernel(
function _select_best_seed_indices (line 145) | def _select_best_seed_indices(
function _gather_best_seed (line 166) | def _gather_best_seed(
function _pull_seed (line 180) | def _pull_seed(
function _set_seed (line 189) | def _set_seed(
class IKSolver (line 196) | class IKSolver:
method __init__ (line 227) | def __init__(
method step (line 332) | def step(
method reset (line 389) | def reset(self) -> None:
method joint_q (line 401) | def joint_q(self) -> wp.array2d[wp.float32]:
method costs (line 406) | def costs(self) -> wp.array[wp.float32]:
method __getattr__ (line 410) | def __getattr__(self, name: str) -> Any:
method _sample (line 413) | def _sample(self, joint_q_in: wp.array2d[wp.float32]) -> None:
method _compute_roberts_basis (line 487) | def _compute_roberts_basis(n_coords: int) -> np.ndarray:
FILE: newton/_src/sim/model.py
class Model (line 26) | class Model:
class AttributeAssignment (line 49) | class AttributeAssignment(IntEnum):
class AttributeFrequency (line 66) | class AttributeFrequency(IntEnum):
class AttributeNamespace (line 107) | class AttributeNamespace:
method __init__ (line 115) | def __init__(self, name: str):
method __repr__ (line 123) | def __repr__(self):
method __init__ (line 129) | def __init__(self, device: Devicelike | None = None):
method state (line 799) | def state(self, requires_grad: bool | None = None) -> State:
method control (line 852) | def control(self, requires_grad: bool | None = None, clone_variables: ...
method set_gravity (line 895) | def set_gravity(
method _init_collision_pipeline (line 930) | def _init_collision_pipeline(self):
method contacts (line 942) | def contacts(
method collide (line 968) | def collide(
method request_state_attributes (line 996) | def request_state_attributes(self, *attributes: str) -> None:
method request_contact_attributes (line 1008) | def request_contact_attributes(self, *attributes: str) -> None:
method get_requested_contact_attributes (line 1018) | def get_requested_contact_attributes(self) -> set[str]:
method _add_custom_attributes (line 1027) | def _add_custom_attributes(
method add_attribute (line 1082) | def add_attribute(
method get_attribute_frequency (line 1134) | def get_attribute_frequency(self, name: str) -> Model.AttributeFrequen...
method get_custom_frequency_count (line 1153) | def get_custom_frequency_count(self, frequency: str) -> int:
method get_requested_state_attributes (line 1170) | def get_requested_state_attributes(self) -> list[str]:
FILE: newton/_src/sim/state.py
class State (line 9) | class State:
method validate_extended_attributes (line 37) | def validate_extended_attributes(cls, attributes: tuple[str, ...]) -> ...
method __init__ (line 57) | def __init__(self) -> None:
method clear_forces (line 117) | def clear_forces(self) -> None:
method assign (line 130) | def assign(self, other: State) -> None:
method requires_grad (line 183) | def requires_grad(self) -> bool:
method body_count (line 192) | def body_count(self) -> int:
method particle_count (line 199) | def particle_count(self) -> int:
method joint_coord_count (line 206) | def joint_coord_count(self) -> int:
method joint_dof_count (line 213) | def joint_dof_count(self) -> int:
FILE: newton/_src/solvers/featherstone/kernels.py
function compute_spatial_inertia (line 18) | def compute_spatial_inertia(
function compute_com_transforms (line 40) | def compute_com_transforms(
function zero_kinematic_body_forces (line 51) | def zero_kinematic_body_forces(
function transform_spatial_inertia (line 63) | def transform_spatial_inertia(t: wp.transform, I: wp.spatial_matrix):
function jcalc_transform (line 139) | def jcalc_transform(
function jcalc_motion (line 239) | def jcalc_motion(
function jcalc_tau (line 343) | def jcalc_tau(
function jcalc_integrate (line 417) | def jcalc_integrate(
function compute_link_transform (line 540) | def compute_link_transform(
function eval_rigid_fk (line 594) | def eval_rigid_fk(
function spatial_cross (line 637) | def spatial_cross(a: wp.spatial_vector, b: wp.spatial_vector):
function spatial_cross_dual (line 651) | def spatial_cross_dual(a: wp.spatial_vector, b: wp.spatial_vector):
function dense_index (line 665) | def dense_index(stride: int, i: int, j: int):
function compute_link_velocity (line 670) | def compute_link_velocity(
function convert_body_force_com_to_origin (line 758) | def convert_body_force_com_to_origin(
function eval_rigid_id (line 783) | def eval_rigid_id(
function eval_rigid_tau (line 837) | def eval_rigid_tau(
function eval_rigid_jacobian (line 919) | def eval_rigid_jacobian(
function spatial_mass (line 962) | def spatial_mass(
function eval_rigid_mass (line 979) | def eval_rigid_mass(
function dense_gemm (line 999) | def dense_gemm(
function create_inertia_matrix_kernel (line 1062) | def create_inertia_matrix_kernel(num_joints, num_dofs):
function create_batched_cholesky_kernel (line 1092) | def create_batched_cholesky_kernel(num_dofs):
function create_inertia_matrix_cholesky_kernel (line 1108) | def create_inertia_matrix_cholesky_kernel(num_joints, num_dofs):
function eval_dense_gemm_batched (line 1150) | def eval_dense_gemm_batched(
function dense_cholesky (line 1185) | def dense_cholesky(
function adj_dense_cholesky (line 1217) | def adj_dense_cholesky(
function eval_dense_cholesky_batched (line 1231) | def eval_dense_cholesky_batched(
function dense_subs (line 1249) | def dense_subs(
function dense_solve (line 1279) | def dense_solve(
function adj_dense_solve (line 1295) | def adj_dense_solve(
function eval_dense_solve_batched (line 1327) | def eval_dense_solve_batched(
function integrate_generalized_joints (line 1344) | def integrate_generalized_joints(
function zero_kinematic_joint_qdd (line 1382) | def zero_kinematic_joint_qdd(
function copy_kinematic_joint_state (line 1401) | def copy_kinematic_joint_state(
function eval_single_articulation_fk_with_velocity_conversion (line 1436) | def eval_single_articulation_fk_with_velocity_conversion(
function convert_articulation_free_distance_body_qd (line 1598) | def convert_articulation_free_distance_body_qd(
function eval_articulation_fk_with_velocity_conversion (line 1643) | def eval_articulation_fk_with_velocity_conversion(
function eval_fk_with_velocity_conversion (line 1709) | def eval_fk_with_velocity_conversion(
FILE: newton/_src/solvers/featherstone/solver_featherstone.py
class SolverFeatherstone (line 47) | class SolverFeatherstone(SolverBase):
method __init__ (line 103) | def __init__(
method _update_kinematic_state (line 152) | def _update_kinematic_state(self):
method notify_model_changed (line 177) | def notify_model_changed(self, flags: int) -> None:
method _compute_articulation_indices (line 182) | def _compute_articulation_indices(self, model):
method _allocate_model_aux_vars (line 252) | def _allocate_model_aux_vars(self, model):
method _allocate_state_aux_vars (line 286) | def _allocate_state_aux_vars(self, model, target, requires_grad):
method step (line 325) | def step(
FILE: newton/_src/solvers/flags.py
class SolverNotifyFlags (line 10) | class SolverNotifyFlags(IntEnum):
FILE: newton/_src/solvers/implicit_mpm/contact_solver_kernels.py
function compute_collider_inv_mass (line 11) | def compute_collider_inv_mass(
function project_on_friction_cone (line 43) | def project_on_friction_cone(
function solve_coulomb_isotropic (line 64) | def solve_coulomb_isotropic(
function filter_collider_impulse_warmstart (line 87) | def filter_collider_impulse_warmstart(
function apply_nodal_impulse_warmstart (line 102) | def apply_nodal_impulse_warmstart(
function solve_nodal_friction (line 126) | def solve_nodal_friction(
function apply_subgrid_impulse (line 173) | def apply_subgrid_impulse(
function apply_subgrid_impulse_warmstart (line 197) | def apply_subgrid_impulse_warmstart(
function compute_collider_delassus_diagonal (line 215) | def compute_collider_delassus_diagonal(
function solve_subgrid_friction (line 244) | def solve_subgrid_friction(
FILE: newton/_src/solvers/implicit_mpm/implicit_mpm_model.py
function _particle_parameter (line 38) | def _particle_parameter(
function _merge_meshes (line 55) | def _merge_meshes(
function _get_shape_mesh (line 80) | def _get_shape_mesh(model: newton.Model, shape_id: int, geo_type: newton...
function _apply_shape_transforms (line 166) | def _apply_shape_transforms(
function _get_body_collision_shapes (line 177) | def _get_body_collision_shapes(model: newton.Model, body_index: int):
function _get_shape_collision_materials (line 186) | def _get_shape_collision_materials(model: newton.Model, shape_ids: list[...
function _create_body_collider_mesh (line 194) | def _create_body_collider_mesh(
class MaterialParameters (line 227) | class MaterialParameters:
class ImplicitMPMModel (line 258) | class ImplicitMPMModel:
method __init__ (line 270) | def __init__(self, model: newton.Model, options: "SolverImplicitMPM.Co...
method notify_particle_material_changed (line 297) | def notify_particle_material_changed(self):
method notify_collider_changed (line 327) | def notify_collider_changed(self):
method setup_particle_material (line 343) | def setup_particle_material(self):
method setup_collider (line 378) | def setup_collider(
method has_compliant_particles (line 582) | def has_compliant_particles(self):
method has_hardening (line 586) | def has_hardening(self):
method has_compliant_colliders (line 590) | def has_compliant_colliders(self):
FILE: newton/_src/solvers/implicit_mpm/implicit_mpm_solver_kernels.py
function integrate_fraction (line 63) | def integrate_fraction(s: fem.Sample, phi: fem.Field, domain: fem.Domain...
function integrate_collider_fraction (line 68) | def integrate_collider_fraction(
function integrate_collider_fraction_apic (line 79) | def integrate_collider_fraction_apic(
function integrate_mass (line 103) | def integrate_mass(
function integrate_velocity (line 119) | def integrate_velocity(
function integrate_velocity_apic (line 144) | def integrate_velocity_apic(
function free_velocity (line 162) | def free_velocity(
function hardening_law (line 181) | def hardening_law(Jp: float, hardening: float):
function get_elastic_parameters (line 192) | def get_elastic_parameters(
function extract_elastic_parameters (line 206) | def extract_elastic_parameters(
function get_yield_parameters (line 216) | def get_yield_parameters(i: int, material_parameters: MaterialParameters...
function integrate_elastic_parameters (line 232) | def integrate_elastic_parameters(
function integrate_yield_parameters (line 244) | def integrate_yield_parameters(
function integrate_particle_stress (line 258) | def integrate_particle_stress(
function average_yield_parameters (line 270) | def average_yield_parameters(
function average_elastic_parameters (line 281) | def average_elastic_parameters(
function advect_particles (line 292) | def advect_particles(
function update_particle_strains (line 323) | def update_particle_strains(
function project_particle_strain (line 387) | def project_particle_strain(
function update_particle_frames (line 404) | def update_particle_frames(
function strain_delta_form (line 434) | def strain_delta_form(
function compute_unilateral_strain_offset (line 448) | def compute_unilateral_strain_offset(
function stress_strain_relationship (line 463) | def stress_strain_relationship(sig: wp.mat33, compliance: float, poisson...
function strain_rhs (line 468) | def strain_rhs(
function compliance_form (line 496) | def compliance_form(
function collision_weight_field (line 526) | def collision_weight_field(
function mass_form (line 540) | def mass_form(
function compute_eigenvalues (line 550) | def compute_eigenvalues(
function rotate_matrix_rows (line 604) | def rotate_matrix_rows(
function make_rotate_vectors (line 636) | def make_rotate_vectors(nodes_per_element: int):
function make_inverse_rotate_vectors (line 671) | def make_inverse_rotate_vectors(nodes_per_element: int):
function inverse_scale_vector (line 703) | def inverse_scale_vector(
function inverse_scale_sym_tensor (line 718) | def inverse_scale_sym_tensor(
function rotate_matrix_columns (line 731) | def rotate_matrix_columns(
function compute_bounds (line 765) | def compute_bounds(
function clamp_coordinates (line 815) | def clamp_coordinates(
function pad_voxels (line 823) | def pad_voxels(particle_q: wp.array[wp.vec3i], padded_q: wp.array4d[wp.v...
function positive_modn (line 833) | def positive_modn(x: int, n: int):
function allocate_by_voxels (line 837) | def allocate_by_voxels(particle_q, voxel_size, padding_voxels: int = 0):
function node_color (line 859) | def node_color(
function make_cell_color_kernel (line 888) | def make_cell_color_kernel(geo_partition: fem.GeometryPartition):
function fill_uniform_color_block_indices (line 922) | def fill_uniform_color_block_indices(
function make_dynamic_color_block_indices_kernel (line 932) | def make_dynamic_color_block_indices_kernel(geo_partition: fem.GeometryP...
function compute_color_offsets (line 956) | def compute_color_offsets(
function mark_active_cells (line 977) | def mark_active_cells(
function scatter_field_dof_values (line 995) | def scatter_field_dof_values(
FILE: newton/_src/solvers/implicit_mpm/rasterized_collisions.py
class Collider (line 42) | class Collider:
function get_average_face_normal (line 77) | def get_average_face_normal(
function collision_sdf (line 114) | def collision_sdf(
function collider_volumes_kernel (line 221) | def collider_volumes_kernel(
function collider_is_dynamic (line 234) | def collider_is_dynamic(collider_id: int, collider: Collider, body_mass:...
function project_outside_collider (line 244) | def project_outside_collider(
function rasterize_collider_kernel (line 320) | def rasterize_collider_kernel(
function fill_collider_rigidity_matrices (line 394) | def fill_collider_rigidity_matrices(
function world_position (line 444) | def world_position(
function collider_gradient_field (line 452) | def collider_gradient_field(s: fem.Sample, domain: fem.Domain, distance:...
function normalize_gradient (line 488) | def normalize_gradient(
function rasterize_collider (line 496) | def rasterize_collider(
function interpolate_collider_normals (line 576) | def interpolate_collider_normals(
function build_rigidity_operator (line 612) | def build_rigidity_operator(
FILE: newton/_src/solvers/implicit_mpm/render_grains.py
function sample_grains (line 13) | def sample_grains(
function transform_grains (line 27) | def transform_grains(
function advect_grains (line 50) | def advect_grains(
function advect_grains_from_particles (line 64) | def advect_grains_from_particles(
function project_grains (line 85) | def project_grains(
function sample_render_grains (line 106) | def sample_render_grains(state: newton.State, particle_radius: wp.array,...
function update_render_grains (line 141) | def update_render_grains(
FILE: newton/_src/solvers/implicit_mpm/rheology_solver_kernels.py
class YieldParamVec (line 39) | class YieldParamVec(wp.types.vector(length=6, dtype=wp.float32)):
method from_values (line 56) | def from_values(
function get_dilatancy (line 76) | def get_dilatancy(yield_params: YieldParamVec):
function get_viscosity (line 81) | def get_viscosity(yield_params: YieldParamVec):
function normal_yield_bounds (line 86) | def normal_yield_bounds(yield_params: YieldParamVec):
function shear_yield_stress (line 92) | def shear_yield_stress(yield_params: YieldParamVec, r_N: float):
function shear_yield_stress_camclay (line 111) | def shear_yield_stress_camclay(yield_params: YieldParamVec, r_N: float):
function _symmetric_part_op (line 125) | def _symmetric_part_op(b: wp.vec3, u: wp.vec3):
function _symmetric_part_transposed_op (line 130) | def _symmetric_part_transposed_op(b: wp.vec3, sig: vec6):
function compute_delassus_diagonal (line 135) | def compute_delassus_diagonal(
function unilateral_offset_to_strain_rhs (line 217) | def unilateral_offset_to_strain_rhs(offset: float):
function preprocess_stress_and_strain (line 222) | def preprocess_stress_and_strain(
function postprocess_stress_and_strain (line 256) | def postprocess_stress_and_strain(
function eval_sliding_residual (line 317) | def eval_sliding_residual(alpha: float, D: Any, b_T: Any, gamma: float, ...
function solve_sliding_no_dilatancy (line 338) | def solve_sliding_no_dilatancy(
function solve_sliding_aniso (line 382) | def solve_sliding_aniso(
function solve_flow_rule_camclay (line 474) | def solve_flow_rule_camclay(
function make_solve_flow_rule (line 553) | def make_solve_flow_rule(has_viscosity: bool = True, has_dilatancy: bool...
function project_stress (line 621) | def project_stress(
function _world_to_local (line 646) | def _world_to_local(
function _local_to_world (line 656) | def _local_to_world(
function make_apply_stress_delta (line 665) | def make_apply_stress_delta(strain_velocity_node_count: int = -1):
function apply_stress_delta_jacobi (line 697) | def apply_stress_delta_jacobi(
function apply_velocity_delta (line 724) | def apply_velocity_delta(
function apply_stress_gs (line 754) | def apply_stress_gs(
function make_compute_local_strain (line 792) | def make_compute_local_strain(has_compliance_mat: bool = True, strain_ve...
function make_solve_local_stress (line 835) | def make_solve_local_stress(has_viscosity: bool, has_dilatancy: bool, ha...
function make_jacobi_solve_kernel (line 881) | def make_jacobi_solve_kernel(
function make_gs_solve_kernel (line 941) | def make_gs_solve_kernel(
function jacobi_preconditioner (line 1026) | def jacobi_preconditioner(
function evaluate_strain_residual (line 1044) | def evaluate_strain_residual(
FILE: newton/_src/solvers/implicit_mpm/solve_rheology.py
function _tiled_sum_kernel (line 44) | def _tiled_sum_kernel(
class ArraySquaredNorm (line 56) | class ArraySquaredNorm:
method __init__ (line 59) | def __init__(self, max_length: int, device=None, temporary_store=None):
method compute_squared_norm (line 83) | def compute_squared_norm(self, data: wp.array[Any]):
method release (line 116) | def release(self):
method __del__ (line 124) | def __del__(self):
function update_condition (line 129) | def update_condition(
function apply_rigidity_operator (line 147) | def apply_rigidity_operator(rigidity_operator, delta_collider_impulse, c...
class _ScopedDisableGC (line 172) | class _ScopedDisableGC:
method __enter__ (line 177) | def __enter__(self):
method __exit__ (line 181) | def __exit__(self, exc_type, exc_value, traceback):
class MomentumData (line 187) | class MomentumData:
class RheologyData (line 202) | class RheologyData:
class CollisionData (line 249) | class CollisionData:
class _DelassusOperator (line 280) | class _DelassusOperator:
method __init__ (line 281) | def __init__(
method compute_diagonal_factorization (line 300) | def compute_diagonal_factorization(self, split_mass: bool):
method require_strain_mat_transpose (line 331) | def require_strain_mat_transpose(self):
method preprocess_stress_and_strain (line 336) | def preprocess_stress_and_strain(self):
method size (line 350) | def size(self):
method release (line 353) | def release(self):
method apply_stress_delta (line 357) | def apply_stress_delta(self, stress_delta: wp.array[vec6], velocity: w...
method apply_velocity_delta (line 372) | def apply_velocity_delta(
method postprocess_stress_and_strain (line 399) | def postprocess_stress_and_strain(self):
class _RheologySolver (line 428) | class _RheologySolver:
method __init__ (line 429) | def __init__(
method size (line 470) | def size(self):
method eval_residual (line 473) | def eval_residual(self):
method release (line 477) | def release(self):
class _GaussSeidelSolver (line 483) | class _GaussSeidelSolver(_RheologySolver):
method __init__ (line 484) | def __init__(
method name (line 561) | def name(self):
method solve_granularity (line 565) | def solve_granularity(self):
method apply_initial_guess (line 568) | def apply_initial_guess(self):
method solve (line 573) | def solve(self):
class _JacobiSolver (line 579) | class _JacobiSolver(_RheologySolver):
method __init__ (line 580) | def __init__(
method name (line 625) | def name(self):
method solve_granularity (line 629) | def solve_granularity(self):
method apply_initial_guess (line 632) | def apply_initial_guess(self):
method solve (line 637) | def solve(self):
class _CGSolver (line 644) | class _CGSolver:
method __init__ (line 645) | def __init__(
method _delassus_matvec (line 668) | def _delassus_matvec(self, x: wp.array[vec6], y: wp.array[vec6], z: wp...
method _preconditioner_matvec (line 678) | def _preconditioner_matvec(self, x, y, z, alpha, beta):
method solve (line 693) | def solve(self, tol: float, tolerance_scale: float, max_iterations: in...
method name (line 725) | def name(self):
method release (line 728) | def release(self):
class _ContactSolver (line 732) | class _ContactSolver:
method __init__ (line 733) | def __init__(
method release (line 769) | def release(self):
method apply_rigidity_operator (line 775) | def apply_rigidity_operator(self):
class _NodalContactSolver (line 785) | class _NodalContactSolver(_ContactSolver):
method __init__ (line 786) | def __init__(
method apply_initial_guess (line 812) | def apply_initial_guess(self):
method solve (line 829) | def solve(self):
class _SubgridContactSolver (line 834) | class _SubgridContactSolver(_ContactSolver):
method __init__ (line 835) | def __init__(
method apply_initial_guess (line 897) | def apply_initial_guess(self):
method solve (line 912) | def solve(self):
method release (line 917) | def release(self):
function _run_solver_loop (line 922) | def _run_solver_loop(
function solve_rheology (line 1001) | def solve_rheology(
FILE: newton/_src/solvers/implicit_mpm/solver_implicit_mpm.py
function _as_2d_array (line 78) | def _as_2d_array(array, shape, dtype):
function _make_grid_basis_space (line 90) | def _make_grid_basis_space(grid: fem.Geometry, basis_str: str, family: f...
function _make_pic_basis_space (line 114) | def _make_pic_basis_space(pic: fem.PicQuadrature, basis_str: str):
class ImplicitMPMScratchpad (line 123) | class ImplicitMPMScratchpad:
method __init__ (line 126) | def __init__(self):
method rebuild_function_spaces (line 174) | def rebuild_function_spaces(
method _create_velocity_function_space (line 215) | def _create_velocity_function_space(self, temporary_store: fem.Tempora...
method _create_collider_function_space (line 240) | def _create_collider_function_space(self, temporary_store: fem.Tempora...
method _create_strain_function_space (line 274) | def _create_strain_function_space(self, temporary_store: fem.Temporary...
method require_velocity_space_fields (line 302) | def require_velocity_space_fields(self, has_compliant_particles: bool):
method require_collision_space_fields (line 344) | def require_collision_space_fields(self):
method require_strain_space_fields (line 382) | def require_strain_space_fields(self):
method collider_node_count (line 436) | def collider_node_count(self) -> int:
method velocity_node_count (line 440) | def velocity_node_count(self) -> int:
method velocity_nodes_per_element (line 444) | def velocity_nodes_per_element(self) -> int:
method strain_node_count (line 448) | def strain_node_count(self) -> int:
method strain_nodes_per_element (line 452) | def strain_nodes_per_element(self) -> int:
method allocate_temporaries (line 455) | def allocate_temporaries(
method release_temporaries (line 494) | def release_temporaries(self):
class LastStepData (line 516) | class LastStepData:
method __init__ (line 524) | def __init__(self):
method _ws_stress_space (line 529) | def _ws_stress_space(self, scratch: ImplicitMPMScratchpad, smoothed: b...
method require_strain_space_fields (line 536) | def require_strain_space_fields(self, scratch: ImplicitMPMScratchpad, ...
method rebind_strain_space_fields (line 541) | def rebind_strain_space_fields(self, scratch: ImplicitMPMScratchpad, s...
method require_collision_space_fields (line 551) | def require_collision_space_fields(self, scratch: ImplicitMPMScratchpad):
method rebind_collision_space_fields (line 556) | def rebind_collision_space_fields(self, scratch: ImplicitMPMScratchpad):
method require_collider_previous_position (line 566) | def require_collider_previous_position(self, collider_body_q: wp.array...
method save_collider_current_position (line 572) | def save_collider_current_position(self, collider_body_q: wp.array | N...
class SolverImplicitMPM (line 578) | class SolverImplicitMPM(SolverBase):
class Config (line 607) | class Config:
method register_custom_attributes (line 663) | def register_custom_attributes(cls, builder: newton.ModelBuilder) -> N...
method __init__ (line 865) | def __init__(
method setup_collider (line 951) | def setup_collider(
method voxel_size (line 1001) | def voxel_size(self) -> float:
method step (line 1006) | def step(
method notify_model_changed (line 1037) | def notify_model_changed(self, flags: int) -> None:
method collect_collider_impulses (line 1040) | def collect_collider_impulses(self, state: newton.State) -> tuple[wp.a...
method collider_body_index (line 1061) | def collider_body_index(self) -> wp.array:
method project_outside (line 1069) | def project_outside(self, state_in: newton.State, state_out: newton.St...
method update_particle_frames (line 1111) | def update_particle_frames(
method sample_render_grains (line 1140) | def sample_render_grains(self, state: newton.State, grains_per_particl...
method update_render_grains (line 1154) | def update_render_grains(
method _allocate_grid (line 1172) | def _allocate_grid(
method _create_geometry_partition (line 1244) | def _create_geometry_partition(
method _rebuild_scratchpad (line 1274) | def _rebuild_scratchpad(self, pic: fem.PicQuadrature):
method _particles_to_cells (line 1310) | def _particles_to_cells(self, positions: wp.array) -> fem.PicQuadrature:
method _particle_grid_locations (line 1358) | def _particle_grid_locations(self, domain: fem.GeometryDomain, positio...
method _particle_grid_locations_gimp (line 1398) | def _particle_grid_locations_gimp(
method _step_impl (line 1502) | def _step_impl(
method _compute_unconstrained_velocity (line 1566) | def _compute_unconstrained_velocity(
method _rasterize_colliders (line 1639) | def _rasterize_colliders(
method _build_collider_rigidity_operator (line 1707) | def _build_collider_rigidity_operator(
method _build_elasticity_system (line 1732) | def _build_elasticity_system(
method _build_plasticity_system (line 1813) | def _build_plasticity_system(
method _build_strain_eigenbasis (line 1920) | def _build_strain_eigenbasis(
method _apply_strain_eigenbasis (line 1972) | def _apply_strain_eigenbasis(
method _unapply_strain_eigenbasis (line 2032) | def _unapply_strain_eigenbasis(
method _solve_rheology (line 2073) | def _solve_rheology(
method _update_particles (line 2134) | def _update_particles(
method _save_data (line 2213) | def _save_data(
method _require_velocity_space_fields (line 2236) | def _require_velocity_space_fields(self, scratch: ImplicitMPMScratchpa...
method _require_collision_space_fields (line 2241) | def _require_collision_space_fields(self, scratch: ImplicitMPMScratchp...
method _require_strain_space_fields (line 2247) | def _require_strain_space_fields(self, scratch: ImplicitMPMScratchpad,...
method _load_warmstart (line 2252) | def _load_warmstart(
method _warmstart_fields (line 2279) | def _warmstart_fields(
method _save_for_next_warmstart (line 2328) | def _save_for_next_warmstart(
method _max_colors (line 2364) | def _max_colors(self):
method _compute_coloring (line 2369) | def _compute_coloring(
method _timer (line 2487) | def _timer(self, name: str):
FILE: newton/_src/solvers/kamino/_src/core/bodies.py
class RigidBodyDescriptor (line 44) | class RigidBodyDescriptor(Descriptor):
method __repr__ (line 96) | def __repr__(self) -> str:
class RigidBodiesModel (line 113) | class RigidBodiesModel:
class RigidBodiesData (line 218) | class RigidBodiesData:
method clear_all_wrenches (line 286) | def clear_all_wrenches(self):
method clear_constraint_wrenches (line 297) | def clear_constraint_wrenches(self):
method clear_actuation_wrenches (line 305) | def clear_actuation_wrenches(self):
method clear_external_wrenches (line 311) | def clear_external_wrenches(self):
function make_symmetric (line 325) | def make_symmetric(A: mat33f) -> mat33f:
function transform_body_inertial_properties (line 339) | def transform_body_inertial_properties(
function _update_body_inertias (line 376) | def _update_body_inertias(
function _update_body_wrenches (line 402) | def _update_body_wrenches(
function _convert_body_origin_to_com (line 430) | def _convert_body_origin_to_com(
function _convert_body_com_to_origin (line 457) | def _convert_body_com_to_origin(
function _convert_base_origin_to_com (line 484) | def _convert_base_origin_to_com(
function _convert_geom_offset_origin_to_com (line 504) | def _convert_geom_offset_origin_to_com(
function convert_geom_offset_origin_to_com (line 529) | def convert_geom_offset_origin_to_com(
function update_body_inertias (line 544) | def update_body_inertias(model: RigidBodiesModel, data: RigidBodiesData):
function update_body_wrenches (line 560) | def update_body_wrenches(model: RigidBodiesModel, data: RigidBodiesData):
function convert_body_origin_to_com (line 577) | def convert_body_origin_to_com(
function convert_body_com_to_origin (line 593) | def convert_body_com_to_origin(
function convert_base_origin_to_com (line 609) | def convert_base_origin_to_com(
FILE: newton/_src/solvers/kamino/_src/core/builder.py
class ModelBuilderKamino (line 55) | class ModelBuilderKamino:
method __init__ (line 60) | def __init__(self, default_world: bool = False):
method max_contacts_per_pair (line 109) | def max_contacts_per_pair(self) -> int | None:
method max_contacts_per_pair (line 115) | def max_contacts_per_pair(self, value: int | None):
method num_worlds (line 119) | def num_worlds(self) -> int:
method num_bodies (line 124) | def num_bodies(self) -> int:
method num_joints (line 129) | def num_joints(self) -> int:
method num_geoms (line 134) | def num_geoms(self) -> int:
method num_materials (line 139) | def num_materials(self) -> int:
method num_body_dofs (line 144) | def num_body_dofs(self) -> int:
method num_joint_coords (line 149) | def num_joint_coords(self) -> int:
method num_joint_dofs (line 154) | def num_joint_dofs(self) -> int:
method num_passive_joint_coords (line 159) | def num_passive_joint_coords(self) -> int:
method num_passive_joint_dofs (line 164) | def num_passive_joint_dofs(self) -> int:
method num_actuated_joint_coords (line 169) | def num_actuated_joint_coords(self) -> int:
method num_actuated_joint_dofs (line 174) | def num_actuated_joint_dofs(self) -> int:
method num_joint_cts (line 179) | def num_joint_cts(self) -> int:
method num_dynamic_joint_cts (line 184) | def num_dynamic_joint_cts(self) -> int:
method num_kinematic_joint_cts (line 189) | def num_kinematic_joint_cts(self) -> int:
method worlds (line 194) | def worlds(self) -> list[WorldDescriptor]:
method up_axes (line 199) | def up_axes(self) -> list[Axis]:
method gravity (line 204) | def gravity(self) -> list[GravityDescriptor]:
method bodies (line 209) | def bodies(self) -> list[RigidBodyDescriptor]:
method joints (line 214) | def joints(self) -> list[JointDescriptor]:
method geoms (line 219) | def geoms(self) -> list[GeometryDescriptor]:
method materials (line 224) | def materials(self) -> list[MaterialDescriptor]:
method add_world (line 232) | def add_world(
method add_rigid_body (line 276) | def add_rigid_body(
method add_rigid_body_descriptor (line 318) | def add_rigid_body_descriptor(self, body: RigidBodyDescriptor, world_i...
method add_joint (line 352) | def add_joint(
method add_joint_descriptor (line 435) | def add_joint_descriptor(self, joint: JointDescriptor, world_index: in...
method add_geometry (line 475) | def add_geometry(
method add_geometry_descriptor (line 572) | def add_geometry_descriptor(self, geom: GeometryDescriptor, world_inde...
method add_material (line 607) | def add_material(self, material: MaterialDescriptor, world_index: int ...
method add_builder (line 631) | def add_builder(self, other: ModelBuilderKamino):
method set_up_axis (line 704) | def set_up_axis(self, axis: Axis, world_index: int = 0):
method set_gravity (line 726) | def set_gravity(self, gravity: GravityDescriptor, world_index: int = 0):
method set_default_material (line 748) | def set_default_material(self, material: MaterialDescriptor, world_ind...
method set_material_pair (line 766) | def set_material_pair(
method set_base_body (line 793) | def set_base_body(self, body_key: int | str, world_index: int = 0):
method set_base_joint (line 817) | def set_base_joint(self, joint_key: int | str, world_index: int = 0):
method finalize (line 845) | def finalize(
method make_collision_candidate_pairs (line 1432) | def make_collision_candidate_pairs(self, allow_neighbors: bool = False...
method make_collision_excluded_pairs (line 1541) | def make_collision_excluded_pairs(self, allow_neighbors: bool = False)...
method compute_num_collidable_geoms (line 1623) | def compute_num_collidable_geoms(
method compute_required_contact_capacity (line 1659) | def compute_required_contact_capacity(
method _check_world_index (line 1705) | def _check_world_index(self, world_index: int) -> WorldDescriptor:
method _compute_world_offsets (line 1724) | def _compute_world_offsets(self):
method _collect_geom_max_contact_hints (line 1773) | def _collect_geom_max_contact_hints(self) -> tuple[int, list[int]]:
method _insert_entity (line 1789) | def _insert_entity(entity_list: list[EntityDescriptorType], entity: En...
method _check_body_inertia (line 1813) | def _check_body_inertia(m_i: float, i_I_i: mat33f):
method _check_body_pose (line 1835) | def _check_body_pose(q_i: transformf):
FILE: newton/_src/solvers/kamino/_src/core/control.py
class ControlKamino (line 20) | class ControlKamino:
method copy_to (line 71) | def copy_to(self, other: ControlKamino) -> None:
method copy_from (line 82) | def copy_from(self, other: ControlKamino) -> None:
method from_newton (line 94) | def from_newton(control: Control) -> ControlKamino:
method to_newton (line 112) | def to_newton(control: ControlKamino) -> Control:
FILE: newton/_src/solvers/kamino/_src/core/conversions.py
function convert_entity_local_transforms (line 29) | def convert_entity_local_transforms(model: Model) -> dict[str, np.ndarray]:
function compute_required_contact_capacity (line 189) | def compute_required_contact_capacity(
function convert_model_joint_transforms (line 269) | def convert_model_joint_transforms(model: Model, joints: JointsModel) ->...
FILE: newton/_src/solvers/kamino/_src/core/data.py
class DataKaminoInfo (line 33) | class DataKaminoInfo:
class DataKamino (line 94) | class DataKamino:
method copy_body_state_from (line 127) | def copy_body_state_from(self, state: StateKamino) -> None:
method copy_body_state_to (line 147) | def copy_body_state_to(self, state: StateKamino) -> None:
method copy_joint_state_from (line 169) | def copy_joint_state_from(self, state: StateKamino) -> None:
method copy_joint_state_to (line 190) | def copy_joint_state_to(self, state: StateKamino) -> None:
method copy_joint_control_from (line 213) | def copy_joint_control_from(self, control: ControlKamino) -> None:
FILE: newton/_src/solvers/kamino/_src/core/geometry.py
class GeometryDescriptor (line 41) | class GeometryDescriptor(Descriptor):
method is_collidable (line 158) | def is_collidable(self) -> bool:
method __hash__ (line 163) | def __hash__(self):
method __repr__ (line 172) | def __repr__(self):
class GeometriesModel (line 195) | class GeometriesModel:
class GeometriesData (line 336) | class GeometriesData:
function _update_geometries_state (line 362) | def _update_geometries_state(
function update_geometries_state (line 416) | def update_geometries_state(
FILE: newton/_src/solvers/kamino/_src/core/gravity.py
class GravityDescriptor (line 60) | class GravityDescriptor(Descriptor):
method __init__ (line 72) | def __init__(
method __repr__ (line 99) | def __repr__(self):
method enabled (line 112) | def enabled(self) -> bool:
method enabled (line 117) | def enabled(self, on: bool):
method acceleration (line 122) | def acceleration(self) -> float:
method acceleration (line 127) | def acceleration(self, g: float):
method direction (line 132) | def direction(self) -> vec3f:
method direction (line 137) | def direction(self, dir: vec3f):
method dir_accel (line 141) | def dir_accel(self) -> vec4f:
method vector (line 145) | def vector(self) -> vec4f:
class GravityModel (line 152) | class GravityModel:
method from_newton (line 178) | def from_newton(model_in: Model) -> GravityModel:
function convert_model_gravity (line 188) | def convert_model_gravity(model_in: Model, gravity_out: GravityModel | N...
FILE: newton/_src/solvers/kamino/_src/core/inertia.py
function solid_sphere_body_moment_of_inertia (line 29) | def solid_sphere_body_moment_of_inertia(m: float, r: float) -> mat33f:
function solid_cylinder_body_moment_of_inertia (line 35) | def solid_cylinder_body_moment_of_inertia(m: float, r: float, h: float) ...
function solid_cone_body_moment_of_inertia (line 42) | def solid_cone_body_moment_of_inertia(m: float, r: float, h: float) -> m...
function solid_ellipsoid_body_moment_of_inertia (line 49) | def solid_ellipsoid_body_moment_of_inertia(m: float, a: float, b: float,...
function solid_cuboid_body_moment_of_inertia (line 57) | def solid_cuboid_body_moment_of_inertia(m: float, w: float, h: float, d:...
FILE: newton/_src/solvers/kamino/_src/core/joints.py
class JointActuationType (line 83) | class JointActuationType(IntEnum):
method __str__ (line 110) | def __str__(self):
method __repr__ (line 115) | def __repr__(self):
method to_newton (line 120) | def to_newton(act_type: JointActuationType) -> JointTargetMode:
method from_newton (line 147) | def from_newton(target_mode: JointTargetMode) -> JointActuationType:
class JointCorrectionMode (line 171) | class JointCorrectionMode(IntEnum):
method bound (line 196) | def bound(self) -> float:
method from_string (line 210) | def from_string(cls, s: str) -> JointCorrectionMode:
method __str__ (line 218) | def __str__(self):
method __repr__ (line 223) | def __repr__(self):
method parse_usd_attribute (line 228) | def parse_usd_attribute(value: str, context: dict[str, Any] | None = N...
class JointDoFType (line 239) | class JointDoFType(IntEnum):
method __str__ (line 399) | def __str__(self):
method __repr__ (line 404) | def __repr__(self):
method num_coords (line 409) | def num_coords(self) -> int:
method num_dofs (line 435) | def num_dofs(self) -> int:
method num_cts (line 461) | def num_cts(self) -> int:
method cts_axes (line 487) | def cts_axes(self) -> Vector[Any, Int]:
method dofs_axes (line 513) | def dofs_axes(self) -> Vector[Any, Int]:
method coords_storage_type (line 539) | def coords_storage_type(self) -> Any:
method coords_physical_type (line 565) | def coords_physical_type(self) -> Any:
method reference_coords (line 591) | def reference_coords(self) -> list[float]:
method coords_bound (line 616) | def coords_bound(self, correction: JointCorrectionMode) -> list[float]:
method to_newton (line 645) | def to_newton(dof_type: JointDoFType) -> JointType | None:
method from_newton (line 675) | def from_newton(
method axes_matrix_from_joint_type (line 782) | def axes_matrix_from_joint_type(
class JointDescriptor (line 870) | class JointDescriptor(Descriptor):
method num_coords (line 1124) | def num_coords(self) -> int:
method num_dofs (line 1131) | def num_dofs(self) -> int:
method num_passive_coords (line 1138) | def num_passive_coords(self) -> int:
method num_passive_dofs (line 1145) | def num_passive_dofs(self) -> int:
method num_actuated_coords (line 1152) | def num_actuated_coords(self) -> int:
method num_actuated_dofs (line 1159) | def num_actuated_dofs(self) -> int:
method num_cts (line 1166) | def num_cts(self) -> int:
method num_dynamic_cts (line 1173) | def num_dynamic_cts(self) -> int:
method num_kinematic_cts (line 1180) | def num_kinematic_cts(self) -> int:
method is_binary (line 1187) | def is_binary(self) -> bool:
method is_unary (line 1194) | def is_unary(self) -> bool:
method is_passive (line 1201) | def is_passive(self) -> bool:
method is_actuated (line 1208) | def is_actuated(self) -> bool:
method is_dynamic (line 1215) | def is_dynamic(self) -> bool:
method is_implicit_pd (line 1222) | def is_implicit_pd(self) -> bool:
method has_base_body (line 1228) | def has_base_body(self, bid: int) -> bool:
method has_follower_body (line 1236) | def has_follower_body(self, bid: int) -> bool:
method is_connected_to_body (line 1244) | def is_connected_to_body(self, bid: int) -> bool:
method __post_init__ (line 1256) | def __post_init__(self):
method __repr__ (line 1339) | def __repr__(self):
method _check_dofs_array (line 1391) | def _check_dofs_array(x: ArrayLike | float | None, size: int, default:...
method _check_parameter_values (line 1442) | def _check_parameter_values(self):
class JointsModel (line 1478) | class JointsModel:
class JointsData (line 1817) | class JointsData:
method reset_state (line 2057) | def reset_state(self, q_j_0: wp.array | None = None):
method reset_references (line 2072) | def reset_references(self, q_j_ref: wp.array | None = None, dq_j_ref: ...
method clear_residuals (line 2091) | def clear_residuals(self):
method clear_constraint_reactions (line 2098) | def clear_constraint_reactions(self):
method clear_actuation_forces (line 2104) | def clear_actuation_forces(self):
method clear_wrenches (line 2110) | def clear_wrenches(self):
method clear_all (line 2120) | def clear_all(self):
FILE: newton/_src/solvers/kamino/_src/core/materials.py
class MaterialMuxMode (line 75) | class MaterialMuxMode(IntEnum):
class MaterialDescriptor (line 95) | class MaterialDescriptor(Descriptor):
method __repr__ (line 175) | def __repr__(self) -> str:
class MaterialPairProperties (line 192) | class MaterialPairProperties:
class MaterialsModel (line 233) | class MaterialsModel:
class MaterialPairsModel (line 285) | class MaterialPairsModel:
function material_average (line 338) | def material_average(
function material_max (line 356) | def material_max(
function material_min (line 374) | def material_min(
function make_get_material_pair_properties (line 391) | def make_get_material_pair_properties(muxmode: MaterialMuxMode = Materia...
class MaterialManager (line 474) | class MaterialManager:
method __init__ (line 485) | def __init__(
method num_materials (line 526) | def num_materials(self) -> int:
method num_material_pairs (line 533) | def num_material_pairs(self) -> int:
method materials (line 541) | def materials(self) -> list[MaterialDescriptor]:
method pairs (line 548) | def pairs(self) -> list[list[MaterialPairProperties]]:
method default (line 555) | def default(self) -> MaterialDescriptor:
method default (line 562) | def default(self, material: MaterialDescriptor):
method default_pair (line 577) | def default_pair(self) -> MaterialPairProperties:
method has_material (line 583) | def has_material(self, name: str) -> bool:
method register (line 598) | def register(self, material: MaterialDescriptor) -> int:
method register_pair (line 633) | def register_pair(
method configure_pair (line 659) | def configure_pair(self, first: int | str, second: int | str, material...
method merge (line 679) | def merge(self, other: "MaterialManager"):
method __getitem__ (line 703) | def __getitem__(self, key) -> MaterialDescriptor:
method index (line 734) | def index(self, key: str | int) -> int:
method restitution_vector (line 767) | def restitution_vector(self) -> np.ndarray:
method restitution_matrix (line 787) | def restitution_matrix(self) -> np.ndarray:
method static_friction_vector (line 817) | def static_friction_vector(self) -> np.ndarray:
method static_friction_matrix (line 837) | def static_friction_matrix(self) -> np.ndarray:
method dynamic_friction_vector (line 867) | def dynamic_friction_vector(self) -> np.ndarray:
method dynamic_friction_matrix (line 887) | def dynamic_friction_matrix(self) -> np.ndarray:
FILE: newton/_src/solvers/kamino/_src/core/math.py
function squared_norm (line 91) | def squared_norm(x: Any) -> Float:
function R_x (line 101) | def R_x(theta: float32) -> mat33f:
function R_y (line 117) | def R_y(theta: float32) -> mat33f:
function R_z (line 133) | def R_z(theta: float32) -> mat33f:
function unskew (line 149) | def unskew(S: mat33f) -> vec3f:
function G_of (line 168) | def G_of(q: quatf) -> mat34f:
function H_of (line 195) | def H_of(q: quatf) -> mat34f:
function quat_from_vec4 (line 222) | def quat_from_vec4(v: vec4f) -> quatf:
function quat_to_vec4 (line 230) | def quat_to_vec4(q: quatf) -> vec4f:
function quat_conj (line 238) | def quat_conj(q: quatf) -> quatf:
function quat_positive (line 247) | def quat_positive(q: quatf) -> quatf:
function quat_imaginary (line 260) | def quat_imaginary(q: quatf) -> vec3f:
function quat_apply (line 269) | def quat_apply(q: quatf, v: vec3f) -> vec3f:
function quat_derivative (line 282) | def quat_derivative(q: quatf, omega: vec3f) -> quatf:
function quat_log (line 299) | def quat_log(q: quatf) -> vec3f:
function quat_log_decomposed (line 327) | def quat_log_decomposed(q: quatf) -> vec4f:
function quat_exp (line 360) | def quat_exp(v: vec3f) -> quatf:
function quat_product (line 393) | def quat_product(q1: quatf, q2: quatf) -> quatf:
function quat_box_plus (line 413) | def quat_box_plus(q: quatf, v: vec3f) -> quatf:
function quat_from_x_rot (line 429) | def quat_from_x_rot(angle_rad: float32) -> quatf:
function quat_from_y_rot (line 437) | def quat_from_y_rot(angle_rad: float32) -> quatf:
function quat_from_z_rot (line 445) | def quat_from_z_rot(angle_rad: float32) -> quatf:
function quat_to_euler_xyz (line 453) | def quat_to_euler_xyz(q: quatf) -> vec3f:
function quat_from_euler_xyz (line 471) | def quat_from_euler_xyz(rpy: vec3f) -> quatf:
function quat_left_jacobian_inverse (line 479) | def quat_left_jacobian_inverse(q: quatf) -> mat33f:
function quat_normalized_apply (line 503) | def quat_normalized_apply(q: quatf, v: vec3f) -> vec3f:
function quat_conj_normalized_apply (line 514) | def quat_conj_normalized_apply(q: quatf, v: vec3f) -> vec3f:
function quat_twist_angle (line 525) | def quat_twist_angle(q: quatf, axis: vec3f) -> wp.float32:
function unit_quat_apply (line 546) | def unit_quat_apply(q: quatf, v: vec3f) -> vec3f:
function unit_quat_conj_apply (line 556) | def unit_quat_conj_apply(q: quatf, v: vec3f) -> vec3f:
function unit_quat_to_rotation_matrix (line 567) | def unit_quat_to_rotation_matrix(q: quatf) -> mat33f:
function unit_quat_conj_to_rotation_matrix (line 584) | def unit_quat_conj_to_rotation_matrix(q: quatf) -> mat33f:
function unit_quat_apply_jacobian (line 602) | def unit_quat_apply_jacobian(q: quatf, v: vec3f) -> mat34f:
function unit_quat_conj_apply_jacobian (line 635) | def unit_quat_conj_apply_jacobian(q: quatf, v: vec3f) -> mat34f:
function screw (line 673) | def screw(linear: vec3f, angular: vec3f) -> vec6f:
function screw_linear (line 688) | def screw_linear(s: vec6f) -> vec3f:
function screw_angular (line 702) | def screw_angular(s: vec6f) -> vec3f:
function screw_transform_matrix_from_points (line 716) | def screw_transform_matrix_from_points(r_A: vec3f, r_B: vec3f) -> mat66f:
function contact_wrench_matrix_from_points (line 761) | def contact_wrench_matrix_from_points(r_k: vec3f, r_i: vec3f) -> mat63f:
function expand6d (line 797) | def expand6d(X: mat33f) -> mat66f:
function compute_body_twist_update_with_eom (line 827) | def compute_body_twist_update_with_eom(
function compute_body_pose_update_with_logmap (line 852) | def compute_body_pose_update_with_logmap(
function tril_index (line 877) | def tril_index(row: Any, col: Any) -> Any:
FILE: newton/_src/solvers/kamino/_src/core/model.py
class ModelKaminoInfo (line 66) | class ModelKaminoInfo:
class ModelKamino (line 434) | class ModelKamino:
method device (line 489) | def device(self) -> wp.DeviceLike:
method requires_grad (line 494) | def requires_grad(self) -> bool:
method data (line 502) | def data(
method state (line 614) | def state(self, requires_grad: bool = False, device: wp.DeviceLike = N...
method control (line 644) | def control(self, requires_grad: bool = False, device: wp.DeviceLike =...
method from_newton (line 671) | def from_newton(model: Model) -> ModelKamino:
FILE: newton/_src/solvers/kamino/_src/core/shapes.py
function is_primitive_geo_type (line 53) | def is_primitive_geo_type(geo_type: GeoType) -> bool:
function is_explicit_geo_type (line 66) | def is_explicit_geo_type(geo_type: GeoType) -> bool:
class ShapeDescriptor (line 75) | class ShapeDescriptor(ABC, Descriptor):
method __init__ (line 78) | def __init__(self, geo_type: GeoType, name: str = "", uid: str | None ...
method __hash__ (line 91) | def __hash__(self) -> int:
method __repr__ (line 96) | def __repr__(self):
method type (line 101) | def type(self) -> GeoType:
method is_solid (line 106) | def is_solid(self) -> bool:
method paramsvec (line 112) | def paramsvec(self) -> vec4f:
method params (line 117) | def params(self) -> ShapeParamsLike:
method data (line 122) | def data(self) -> ShapeDataLike:
class EmptyShape (line 131) | class EmptyShape(ShapeDescriptor):
method __init__ (line 136) | def __init__(self, name: str = "empty", uid: str | None = None):
method __repr__ (line 140) | def __repr__(self):
method paramsvec (line 146) | def paramsvec(self) -> vec4f:
method params (line 151) | def params(self) -> ShapeParamsLike:
method data (line 156) | def data(self) -> None:
class SphereShape (line 160) | class SphereShape(ShapeDescriptor):
method __init__ (line 168) | def __init__(self, radius: float, name: str = "sphere", uid: str | Non...
method __repr__ (line 173) | def __repr__(self):
method paramsvec (line 179) | def paramsvec(self) -> vec4f:
method params (line 184) | def params(self) -> float:
method data (line 189) | def data(self) -> None:
class CylinderShape (line 193) | class CylinderShape(ShapeDescriptor):
method __init__ (line 202) | def __init__(self, radius: float, half_height: float, name: str = "cyl...
method __repr__ (line 208) | def __repr__(self):
method paramsvec (line 214) | def paramsvec(self) -> vec4f:
method params (line 219) | def params(self) -> tuple[float, float]:
method data (line 224) | def data(self) -> None:
class ConeShape (line 228) | class ConeShape(ShapeDescriptor):
method __init__ (line 237) | def __init__(self, radius: float, half_height: float, name: str = "con...
method __repr__ (line 243) | def __repr__(self):
method paramsvec (line 249) | def paramsvec(self) -> vec4f:
method params (line 254) | def params(self) -> tuple[float, float]:
method data (line 259) | def data(self) -> None:
class CapsuleShape (line 263) | class CapsuleShape(ShapeDescriptor):
method __init__ (line 272) | def __init__(self, radius: float, half_height: float, name: str = "cap...
method __repr__ (line 278) | def __repr__(self):
method paramsvec (line 284) | def paramsvec(self) -> vec4f:
method params (line 289) | def params(self) -> tuple[float, float]:
method data (line 294) | def data(self) -> None:
class BoxShape (line 298) | class BoxShape(ShapeDescriptor):
method __init__ (line 308) | def __init__(self, hx: float, hy: float, hz: float, name: str = "box",...
method __repr__ (line 315) | def __repr__(self):
method paramsvec (line 321) | def paramsvec(self) -> vec4f:
method params (line 326) | def params(self) -> tuple[float, float, float]:
method data (line 331) | def data(self) -> None:
class EllipsoidShape (line 335) | class EllipsoidShape(ShapeDescriptor):
method __init__ (line 345) | def __init__(self, a: float, b: float, c: float, name: str = "ellipsoi...
method __repr__ (line 352) | def __repr__(self):
method paramsvec (line 358) | def paramsvec(self) -> vec4f:
method params (line 363) | def params(self) -> tuple[float, float, float]:
method data (line 368) | def data(self) -> None:
class PlaneShape (line 372) | class PlaneShape(ShapeDescriptor):
method __init__ (line 381) | def __init__(self, normal: Vec3, distance: float, name: str = "plane",...
method __repr__ (line 387) | def __repr__(self):
method paramsvec (line 395) | def paramsvec(self) -> vec4f:
method params (line 400) | def params(self) -> tuple[float, float, float, float]:
method data (line 405) | def data(self) -> None:
class MeshShape (line 414) | class MeshShape(ShapeDescriptor):
method __init__ (line 434) | def __init__(
method __hash__ (line 487) | def __hash__(self) -> int:
method __repr__ (line 492) | def __repr__(self):
method paramsvec (line 508) | def paramsvec(self) -> vec4f:
method params (line 513) | def params(self) -> tuple[float, float, float]:
method data (line 519) | def data(self) -> Mesh:
method vertices (line 523) | def vertices(self) -> np.ndarray:
method indices (line 528) | def indices(self) -> np.ndarray:
method normals (line 533) | def normals(self) -> np.ndarray | None:
method uvs (line 538) | def uvs(self) -> np.ndarray | None:
method color (line 543) | def color(self) -> Vec3 | None:
class HFieldShape (line 548) | class HFieldShape(ShapeDescriptor):
method __init__ (line 555) | def __init__(self, name: str = "hfield", uid: str | None = None):
method __repr__ (line 561) | def __repr__(self):
method paramsvec (line 566) | def paramsvec(self) -> vec4f:
method params (line 571) | def params(self) -> tuple[float, float, float]:
function max_contacts_for_shape_pair (line 601) | def max_contacts_for_shape_pair(type_a: int, type_b: int) -> tuple[int, ...
FILE: newton/_src/solvers/kamino/_src/core/size.py
class SizeKamino (line 34) | class SizeKamino:
method __repr__ (line 191) | def __repr__(self):
FILE: newton/_src/solvers/kamino/_src/core/state.py
class StateKamino (line 32) | class StateKamino:
method copy_to (line 125) | def copy_to(self, other: StateKamino) -> None:
method copy_from (line 139) | def copy_from(self, other: StateKamino) -> None:
method convert_to_body_com_state (line 162) | def convert_to_body_com_state(
method convert_to_body_frame_state (line 194) | def convert_to_body_frame_state(
method from_newton (line 227) | def from_newton(
method to_newton (line 321) | def to_newton(model: Model, state: StateKamino, convert_to_body_frame:...
FILE: newton/_src/solvers/kamino/_src/core/time.py
class TimeModel (line 39) | class TimeModel:
method set_uniform_timestep (line 62) | def set_uniform_timestep(self, dt: float):
method set_timesteps (line 81) | def set_timesteps(self, dt: list[float] | np.ndarray):
class TimeData (line 108) | class TimeData:
method reset (line 131) | def reset(self):
function _advance_time (line 145) | def _advance_time(
function advance_time (line 172) | def advance_time(model: TimeModel, data: TimeData):
FILE: newton/_src/solvers/kamino/_src/core/types.py
function override (line 25) | def override(func):
class vec1i (line 81) | class vec1i(wp.types.vector(length=1, dtype=int32)):
class vec1f (line 85) | class vec1f(wp.types.vector(length=1, dtype=float32)):
class vec2i (line 89) | class vec2i(wp.types.vector(length=2, dtype=int32)):
class vec2f (line 93) | class vec2f(wp.types.vector(length=2, dtype=float32)):
class vec3i (line 97) | class vec3i(wp.types.vector(length=3, dtype=int32)):
class vec3f (line 101) | class vec3f(wp.types.vector(length=3, dtype=float32)):
class vec4i (line 105) | class vec4i(wp.types.vector(length=4, dtype=int32)):
class vec4f (line 109) | class vec4f(wp.types.vector(length=4, dtype=float32)):
class vec5i (line 113) | class vec5i(wp.types.vector(length=5, dtype=int32)):
class vec5f (line 117) | class vec5f(wp.types.vector(length=5, dtype=float32)):
class vec6i (line 121) | class vec6i(wp.types.vector(length=6, dtype=int32)):
class vec6f (line 125) | class vec6f(wp.types.vector(length=6, dtype=float32)):
class vec7f (line 129) | class vec7f(wp.types.vector(length=7, dtype=float32)):
class vec8f (line 133) | class vec8f(wp.types.vector(length=8, dtype=float32)):
class vec14f (line 137) | class vec14f(wp.types.vector(length=14, dtype=float32)):
class mat22f (line 146) | class mat22f(wp.types.matrix(shape=(2, 2), dtype=float32)):
class mat33f (line 150) | class mat33f(wp.types.matrix(shape=(3, 3), dtype=float32)):
class mat44f (line 154) | class mat44f(wp.types.matrix(shape=(4, 4), dtype=float32)):
class mat61f (line 158) | class mat61f(wp.types.matrix(shape=(6, 1), dtype=float32)):
class mat16f (line 162) | class mat16f(wp.types.matrix(shape=(1, 6), dtype=float32)):
class mat62f (line 166) | class mat62f(wp.types.matrix(shape=(6, 2), dtype=float32)):
class mat26f (line 170) | class mat26f(wp.types.matrix(shape=(2, 6), dtype=float32)):
class mat63f (line 174) | class mat63f(wp.types.matrix(shape=(6, 3), dtype=float32)):
class mat36f (line 178) | class mat36f(wp.types.matrix(shape=(3, 6), dtype=float32)):
class mat64f (line 182) | class mat64f(wp.types.matrix(shape=(6, 4), dtype=float32)):
class mat46f (line 186) | class mat46f(wp.types.matrix(shape=(4, 6), dtype=float32)):
class mat65f (line 190) | class mat65f(wp.types.matrix(shape=(6, 5), dtype=float32)):
class mat56f (line 194) | class mat56f(wp.types.matrix(shape=(5, 6), dtype=float32)):
class mat66f (line 198) | class mat66f(wp.types.matrix(shape=(6, 6), dtype=float32)):
class mat34f (line 202) | class mat34f(wp.types.matrix(shape=(3, 4), dtype=float32)):
class mat43f (line 206) | class mat43f(wp.types.matrix(shape=(4, 3), dtype=float32)):
class mat38f (line 210) | class mat38f(wp.types.matrix(shape=(3, 8), dtype=float32)):
class mat83f (line 214) | class mat83f(wp.types.matrix(shape=(8, 3), dtype=float32)):
class quatf (line 223) | class quatf(wp.types.quaternion(dtype=float32)):
class transformf (line 232) | class transformf(wp.types.transformation(dtype=float32)):
class Axis (line 241) | class Axis(IntEnum):
method from_string (line 249) | def from_string(cls, axis_str: str) -> Axis:
method from_any (line 260) | def from_any(cls, value: AxisType) -> Axis:
method __str__ (line 270) | def __str__(self):
method __repr__ (line 274) | def __repr__(self):
method __eq__ (line 278) | def __eq__(self, other):
method __hash__ (line 286) | def __hash__(self):
method to_vector (line 289) | def to_vector(self) -> tuple[float, float, float]:
method to_matrix (line 297) | def to_matrix(self) -> Mat33:
method to_vec3 (line 305) | def to_vec3(self) -> vec3f:
method to_mat33 (line 308) | def to_mat33(self) -> mat33f:
function axis_to_vec3 (line 316) | def axis_to_vec3(axis: AxisType | Vec3) -> vec3f:
function axis_to_mat33 (line 326) | def axis_to_mat33(axis: AxisType | Vec3) -> mat33f:
class Descriptor (line 342) | class Descriptor:
method _assert_valid_uid (line 356) | def _assert_valid_uid(uid: str) -> str:
method __post_init__ (line 375) | def __post_init__(self):
method __hash__ (line 384) | def __hash__(self):
method __repr__ (line 388) | def __repr__(self):
FILE: newton/_src/solvers/kamino/_src/core/world.py
class WorldDescriptor (line 37) | class WorldDescriptor(Descriptor):
method has_base_body (line 340) | def has_base_body(self):
method base_body_name (line 345) | def base_body_name(self):
method has_base_joint (line 350) | def has_base_joint(self):
method base_joint_name (line 355) | def base_joint_name(self):
method add_body (line 391) | def add_body(self, body: RigidBodyDescriptor):
method add_joint (line 417) | def add_joint(self, joint: JointDescriptor):
method add_geometry (line 506) | def add_geometry(self, geom: GeometryDescriptor):
method add_material (line 525) | def add_material(self, material: MaterialDescriptor):
method set_material (line 549) | def set_material(self, material: MaterialDescriptor, index: int):
method set_base_body (line 562) | def set_base_body(self, body_idx: int):
method set_base_joint (line 577) | def set_base_joint(self, joint_idx: int):
FILE: newton/_src/solvers/kamino/_src/dynamics/delassus.py
function _build_delassus_elementwise_dense (line 106) | def _build_delassus_elementwise_dense(
function _build_delassus_elementwise_sparse (line 197) | def _build_delassus_elementwise_sparse(
function _add_joint_armature_diagonal_regularization_dense (line 282) | def _add_joint_armature_diagonal_regularization_dense(
function _regularize_delassus_diagonal_dense (line 317) | def _regularize_delassus_diagonal_dense(
function _merge_inv_mass_matrix_kernel (line 343) | def _merge_inv_mass_matrix_kernel(
function _make_merge_preconditioner_kernel (line 390) | def _make_merge_preconditioner_kernel(block_type: BlockDType):
function _add_armature_regularization_sparse (line 446) | def _add_armature_regularization_sparse(
function _add_armature_regularization_preconditioned_sparse (line 479) | def _add_armature_regularization_preconditioned_sparse(
function _compute_block_sparse_delassus_diagonal (line 516) | def _compute_block_sparse_delassus_diagonal(
function _add_matrix_diag_product (line 576) | def _add_matrix_diag_product(
function _scale_row_vector_kernel (line 601) | def _scale_row_vector_kernel(
function _make_block_sparse_gemv_regularization_kernel (line 626) | def _make_block_sparse_gemv_regularization_kernel(alpha: float32):
class DelassusOperator (line 695) | class DelassusOperator:
method __init__ (line 700) | def __init__(
method num_worlds (line 763) | def num_worlds(self) -> int:
method num_maxdims (line 771) | def num_maxdims(self) -> int:
method num_maxsize (line 779) | def num_maxsize(self) -> int:
method operator (line 787) | def operator(self) -> DenseLinearOperatorData:
method solver (line 794) | def solver(self) -> LinearSolverType:
method info (line 802) | def info(self) -> DenseSquareMultiLinearInfo:
method D (line 809) | def D(self) -> wp.array:
method finalize (line 815) | def finalize(
method zero (line 903) | def zero(self):
method build (line 910) | def build(
method regularize (line 1012) | def regularize(self, eta: wp.array):
method compute (line 1027) | def compute(self, reset_to_zero: bool = True):
method solve (line 1054) | def solve(self, v: wp.array, x: wp.array):
method solve_inplace (line 1077) | def solve_inplace(self, x: wp.array):
class BlockSparseMatrixFreeDelassusOperator (line 1101) | class BlockSparseMatrixFreeDelassusOperator(BlockSparseLinearOperators):
method __init__ (line 1154) | def __init__(
method finalize (line 1244) | def finalize(
method assign (line 1377) | def assign(self, jacobians: SparseSystemJacobians):
method set_needs_update (line 1406) | def set_needs_update(self):
method update (line 1412) | def update(self):
method set_regularization (line 1532) | def set_regularization(self, eta: wp.array | None):
method set_preconditioner (line 1548) | def set_preconditioner(self, preconditioner: wp.array | None):
method diagonal (line 1564) | def diagonal(self, diag: wp.array):
method compute (line 1616) | def compute(self, reset_to_zero: bool = True):
method solve (line 1650) | def solve(self, v: wp.array, x: wp.array):
method solve_inplace (line 1680) | def solve_inplace(self, x: wp.array):
method info (line 1715) | def info(self) -> DenseSquareMultiLinearInfo | None:
method num_matrices (line 1722) | def num_matrices(self) -> int:
method max_of_max_dims (line 1729) | def max_of_max_dims(self) -> tuple[int, int]:
method sum_of_max_dims (line 1737) | def sum_of_max_dims(self) -> int:
method dtype (line 1744) | def dtype(self) -> FloatType:
method device (line 1748) | def device(self) -> wp.DeviceLike:
method constraint_jacobian (line 1752) | def constraint_jacobian(self) -> BlockSparseMatrices:
method matvec (line 1759) | def matvec(self, x: wp.array, y: wp.array, world_mask: wp.array):
method matvec_transpose (line 1805) | def matvec_transpose(self, y: wp.array, x: wp.array, world_mask: wp.ar...
method gemv (line 1818) | def gemv(self, x: wp.array, y: wp.array, world_mask: wp.array, alpha: ...
method gemv_transpose (line 1872) | def gemv_transpose(self, y: wp.array, x: wp.array, world_mask: wp.arra...
FILE: newton/_src/solvers/kamino/_src/dynamics/dual.py
class DualProblemConfigStruct (line 97) | class DualProblemConfigStruct:
class DualProblemData (line 115) | class DualProblemData:
function gravity_plus_coriolis_wrench (line 335) | def gravity_plus_coriolis_wrench(
function gravity_plus_coriolis_wrench_split (line 350) | def gravity_plus_coriolis_wrench_split(
function _build_nonlinear_generalized_force (line 370) | def _build_nonlinear_generalized_force(
function _build_generalized_free_velocity (line 412) | def _build_generalized_free_velocity(
function _build_free_velocity_bias_joint_dynamics (line 465) | def _build_free_velocity_bias_joint_dynamics(
function _build_free_velocity_bias_joint_kinematics (line 508) | def _build_free_velocity_bias_joint_kinematics(
function _build_free_velocity_bias_limits (line 558) | def _build_free_velocity_bias_limits(
function _build_free_velocity_bias_contacts (line 601) | def _build_free_velocity_bias_contacts(
function _build_free_velocity (line 689) | def _build_free_velocity(
function _build_free_velocity_sparse (line 766) | def _build_free_velocity_sparse(
function _build_dual_preconditioner_all_constraints (line 825) | def _build_dual_preconditioner_all_constraints(
function _build_dual_preconditioner_all_constraints_sparse (line 889) | def _build_dual_preconditioner_all_constraints_sparse(
function _apply_dual_preconditioner_to_matrix (line 948) | def _apply_dual_preconditioner_to_matrix(
function _apply_dual_preconditioner_to_vector (line 996) | def _apply_dual_preconditioner_to_vector(
class DualProblem (line 1035) | class DualProblem:
class Config (line 1041) | class Config(ConfigBase):
method to_struct (line 1052) | def to_struct(self) -> DualProblemConfigStruct:
method validate (line 1065) | def validate(self) -> None:
method __post_init__ (line 1073) | def __post_init__(self):
method __init__ (line 1077) | def __init__(
method device (line 1156) | def device(self) -> wp.DeviceLike:
method size (line 1163) | def size(self) -> SizeKamino:
method config (line 1173) | def config(self) -> list[DualProblem.Config]:
method config (line 1180) | def config(self, value: list[DualProblem.Config] | DualProblem.Config):
method delassus (line 1188) | def delassus(self) -> DelassusOperator | BlockSparseMatrixFreeDelassus...
method data (line 1197) | def data(self) -> DualProblemData:
method sparse (line 1204) | def sparse(self) -> bool:
method finalize (line 1214) | def finalize(
method zero (line 1377) | def zero(self):
method build (line 1389) | def build(
method _check_config (line 1483) | def _check_config(
method _build_nonlinear_generalized_force (line 1509) | def _build_nonlinear_generalized_force(model: ModelKamino, data: DataK...
method _build_generalized_free_velocity (line 1531) | def _build_generalized_free_velocity(self, model: ModelKamino, data: D...
method _build_free_velocity_bias (line 1555) | def _build_free_velocity_bias(
method _build_free_velocity (line 1647) | def _build_free_velocity(self, model: ModelKamino, data: DataKamino, j...
method _build_dual_preconditioner (line 1671) | def _build_dual_preconditioner(self):
method _apply_dual_preconditioner_to_dual (line 1709) | def _apply_dual_preconditioner_to_dual(self):
method _apply_dual_preconditioner_to_matrix (line 1745) | def _apply_dual_preconditioner_to_matrix(self, X: wp.array):
method _apply_dual_preconditioner_to_vector (line 1763) | def _apply_dual_preconditioner_to_vector(self, x: wp.array):
FILE: newton/_src/solvers/kamino/_src/dynamics/wrenches.py
function _compute_joint_dof_body_wrenches_dense (line 40) | def _compute_joint_dof_body_wrenches_dense(
function _compute_joint_dof_body_wrenches_sparse (line 111) | def _compute_joint_dof_body_wrenches_sparse(
function _compute_joint_cts_body_wrenches_dense (line 171) | def _compute_joint_cts_body_wrenches_dense(
function _compute_limit_cts_body_wrenches_dense (line 270) | def _compute_limit_cts_body_wrenches_dense(
function _compute_contact_cts_body_wrenches_dense (line 358) | def _compute_contact_cts_body_wrenches_dense(
function _compute_cts_body_wrenches_sparse (line 449) | def _compute_cts_body_wrenches_sparse(
function compute_joint_dof_body_wrenches_dense (line 519) | def compute_joint_dof_body_wrenches_dense(
function compute_joint_dof_body_wrenches_sparse (line 558) | def compute_joint_dof_body_wrenches_sparse(
function compute_joint_dof_body_wrenches (line 595) | def compute_joint_dof_body_wrenches(
function compute_constraint_body_wrenches_dense (line 612) | def compute_constraint_body_wrenches_dense(
function compute_constraint_body_wrenches_sparse (line 713) | def compute_constraint_body_wrenches_sparse(
function compute_constraint_body_wrenches (line 760) | def compute_constraint_body_wrenches(
FILE: newton/_src/solvers/kamino/_src/geometry/aggregation.py
function _aggregate_contact_force_per_body (line 42) | def _aggregate_contact_force_per_body(
function _aggregate_static_contact_flag_per_body (line 116) | def _aggregate_static_contact_flag_per_body(
function _aggregate_contact_force_per_body_geom (line 175) | def _aggregate_contact_force_per_body_geom(
function _aggregate_body_pair_contact_flag_per_world (line 249) | def _aggregate_body_pair_contact_flag_per_world(
class ContactAggregationData (line 323) | class ContactAggregationData:
class ContactAggregation (line 397) | class ContactAggregation:
method __init__ (line 414) | def __init__(
method body_net_force (line 459) | def body_net_force(self) -> wp.array:
method body_contact_flag (line 464) | def body_contact_flag(self) -> wp.array:
method body_static_contact_flag (line 469) | def body_static_contact_flag(self) -> wp.array:
method geom_net_force (line 474) | def geom_net_force(self) -> wp.array:
method geom_contact_flag (line 479) | def geom_contact_flag(self) -> wp.array:
method body_pair_contact_flag (line 484) | def body_pair_contact_flag(self) -> wp.array:
method finalize (line 492) | def finalize(
method compute (line 539) | def compute(self, skip_if_no_contacts: bool = False):
method set_body_pair_filter (line 641) | def set_body_pair_filter(self, body_a_idx: int, body_b_idx: int) -> None:
method compute_body_pair_contact (line 658) | def compute_body_pair_contact(self) -> None:
FILE: newton/_src/solvers/kamino/_src/geometry/contacts.py
class ContactMode (line 125) | class ContactMode(IntEnum):
method make_compute_mode_func (line 159) | def make_compute_mode_func(vn_tol: float = DEFAULT_VN_MIN, vt_tol: flo...
class ContactsKaminoData (line 198) | class ContactsKaminoData:
method _default_num_world_max_contacts (line 206) | def _default_num_world_max_contacts() -> list[int]:
method clear (line 335) | def clear(self):
method reset (line 342) | def reset(self):
function make_contact_frame_znorm (line 363) | def make_contact_frame_znorm(n: vec3f) -> mat33f:
function make_contact_frame_xnorm (line 375) | def make_contact_frame_xnorm(n: vec3f) -> mat33f:
class ContactsKamino (line 391) | class ContactsKamino:
method __init__ (line 400) | def __init__(
method default_max_world_contacts (line 426) | def default_max_world_contacts(self) -> int:
method default_max_world_contacts (line 434) | def default_max_world_contacts(self, max_contacts: int):
method device (line 446) | def device(self) -> wp.DeviceLike:
method data (line 453) | def data(self) -> ContactsKaminoData:
method model_max_contacts_host (line 461) | def model_max_contacts_host(self) -> int:
method world_max_contacts_host (line 470) | def world_max_contacts_host(self) -> list[int]:
method model_max_contacts (line 479) | def model_max_contacts(self) -> wp.array:
method model_active_contacts (line 488) | def model_active_contacts(self) -> wp.array:
method world_max_contacts (line 497) | def world_max_contacts(self) -> wp.array:
method world_active_contacts (line 506) | def world_active_contacts(self) -> wp.array:
method wid (line 515) | def wid(self) -> wp.array:
method cid (line 524) | def cid(self) -> wp.array:
method gid_AB (line 533) | def gid_AB(self) -> wp.array:
method bid_AB (line 542) | def bid_AB(self) -> wp.array:
method position_A (line 551) | def position_A(self) -> wp.array:
method position_B (line 560) | def position_B(self) -> wp.array:
method gapfunc (line 569) | def gapfunc(self) -> wp.array:
method frame (line 579) | def frame(self) -> wp.array:
method material (line 588) | def material(self) -> wp.array:
method key (line 597) | def key(self) -> wp.array:
method reaction (line 611) | def reaction(self) -> wp.array:
method velocity (line 621) | def velocity(self) -> wp.array:
method mode (line 631) | def mode(self) -> wp.array:
method finalize (line 645) | def finalize(self, capacity: int | list[int], device: wp.DeviceLike = ...
method clear (line 719) | def clear(self):
method reset (line 727) | def reset(self):
method _assert_has_data (line 739) | def _assert_has_data(self):
function _convert_contacts_newton_to_kamino (line 750) | def _convert_contacts_newton_to_kamino(
function _convert_contacts_kamino_to_newton (line 883) | def _convert_contacts_kamino_to_newton(
function convert_contacts_newton_to_kamino (line 952) | def convert_contacts_newton_to_kamino(
function convert_contacts_kamino_to_newton (line 1027) | def convert_contacts_kamino_to_newton(
FILE: newton/_src/solvers/kamino/_src/geometry/detector.py
class CollisionPipelineType (line 65) | class CollisionPipelineType(IntEnum):
method from_string (line 84) | def from_string(cls, s: str) -> CollisionPipelineType:
method __str__ (line 92) | def __str__(self):
method __repr__ (line 97) | def __repr__(self):
class BroadPhaseType (line 102) | class BroadPhaseType(IntEnum):
method from_string (line 132) | def from_string(cls, s: str) -> BroadPhaseType:
method __str__ (line 140) | def __str__(self):
method __repr__ (line 145) | def __repr__(self):
class CollisionDetector (line 155) | class CollisionDetector:
method __init__ (line 184) | def __init__(
method device (line 235) | def device(self) -> wp.DeviceLike:
method model (line 240) | def model(self) -> ModelKamino | None:
method config (line 245) | def config(self) -> CollisionDetector.Config | None:
method contacts (line 250) | def contacts(self) -> ContactsKamino | None:
method model_max_contacts (line 255) | def model_max_contacts(self) -> int:
method world_max_contacts (line 260) | def world_max_contacts(self) -> list[int]:
method finalize (line 268) | def finalize(
method collide (line 382) | def collide(self, data: DataKamino, state: StateKamino, contacts: Cont...
FILE: newton/_src/solvers/kamino/_src/geometry/keying.py
function make_bitmask (line 38) | def make_bitmask(num_bits: int) -> int:
function build_pair_key2 (line 63) | def build_pair_key2(index_A: wp.uint32, index_B: wp.uint32) -> wp.uint64:
function make_build_pair_key3_func (line 83) | def make_build_pair_key3_func(main_key_bits: int, aux_key_bits: int | No...
function binary_search_find_pair (line 133) | def binary_search_find_pair(
function binary_search_find_range_start (line 171) | def binary_search_find_range_start(
function uint64_sentinel_value (line 209) | def uint64_sentinel_value() -> wp.uint64: ...
function _prepare_key_sort (line 218) | def _prepare_key_sort(
function prepare_key_sort (line 255) | def prepare_key_sort(
class KeySorter (line 287) | class KeySorter:
method __init__ (line 292) | def __init__(self, max_num_keys: int, device: wp.DeviceLike = None):
method device (line 326) | def device(self) -> wp.DeviceLike:
method sorted_keys (line 331) | def sorted_keys(self) -> wp.array:
method sorted_keys_int64 (line 336) | def sorted_keys_int64(self) -> wp.array:
method sorted_to_unsorted_map (line 341) | def sorted_to_unsorted_map(self) -> wp.array:
method sort (line 345) | def sort(self, num_active_keys: wp.array, keys: wp.array):
FILE: newton/_src/solvers/kamino/_src/geometry/primitive/broadphase.py
class BoundingVolumeType (line 62) | class BoundingVolumeType(IntEnum):
method from_string (line 72) | def from_string(cls, s: str) -> BoundingVolumeType:
method __str__ (line 80) | def __str__(self):
method __repr__ (line 85) | def __repr__(self):
class BoundingVolumesData (line 91) | class BoundingVolumesData:
class CollisionCandidatesModel (line 121) | class CollisionCandidatesModel:
method _default_world_geom_pairs (line 128) | def _default_world_geom_pairs() -> list[int]:
class CollisionCandidatesData (line 163) | class CollisionCandidatesData:
method clear (line 197) | def clear(self):
method zero (line 204) | def zero(self):
function bs_sphere (line 219) | def bs_sphere(radius: float32) -> float32:
function bs_cylinder (line 224) | def bs_cylinder(radius: float32, half_height: float32) -> float32:
function bs_cone (line 229) | def bs_cone(radius: float32, half_height: float32) -> float32:
function bs_capsule (line 234) | def bs_capsule(radius: float32, half_height: float32) -> float32:
function bs_ellipsoid (line 239) | def bs_ellipsoid(abc: vec3f) -> float32:
function bs_box (line 244) | def bs_box(half_extents: vec3f) -> float32:
function bs_plane (line 251) | def bs_plane(normal: vec3f, distance: float32) -> float32:
function bs_geom (line 256) | def bs_geom(sid: int32, params: vec4f, margin: float32) -> float32:
function has_bs_overlap (line 284) | def has_bs_overlap(pose1: transformf, pose2: transformf, radius1: float3...
function compute_tight_aabb_from_local_extents (line 306) | def compute_tight_aabb_from_local_extents(pose: transformf, extents: vec...
function aabb_sphere (line 339) | def aabb_sphere(pose: transformf, radius: float32, margin: float32) -> v...
function aabb_cylinder (line 349) | def aabb_cylinder(pose: transformf, radius: float32, half_height: float3...
function aabb_cone (line 355) | def aabb_cone(pose: transformf, radius: float32, half_height: float32, m...
function aabb_capsule (line 361) | def aabb_capsule(pose: transformf, radius: float32, half_height: float32...
function aabb_ellipsoid (line 367) | def aabb_ellipsoid(pose: transformf, abc: vec3f, margin: float32) -> vec6f:
function aabb_box (line 373) | def aabb_box(pose: transformf, half_extents: vec3f, margin: float32) -> ...
function aabb_plane (line 379) | def aabb_plane(pose: transformf, normal: vec3f, distance: float32, margi...
function aabb_geom (line 384) | def aabb_geom(sid: int32, params: vec4f, margin: float32, pose: transfor...
function has_aabb_overlap (line 415) | def has_aabb_overlap(aabb1: vec6f, aabb2: vec6f) -> wp.bool:
function add_active_pair (line 428) | def add_active_pair(
function _update_geometries_state_and_aabb (line 472) | def _update_geometries_state_and_aabb(
function _update_geometries_state_and_bs (line 515) | def _update_geometries_state_and_bs(
function _nxn_broadphase_aabb (line 558) | def _nxn_broadphase_aabb(
function _nxn_broadphase_bs (line 638) | def _nxn_broadphase_bs(
function update_geoms_aabb (line 729) | def update_geoms_aabb(
function nxn_broadphase_aabb (line 767) | def nxn_broadphase_aabb(
function update_geoms_bs (line 805) | def update_geoms_bs(
function nxn_broadphase_bs (line 843) | def nxn_broadphase_bs(
function primitive_broadphase_explicit (line 884) | def primitive_broadphase_explicit(
FILE: newton/_src/solvers/kamino/_src/geometry/primitive/narrowphase.py
class Box (line 97) | class Box:
class Sphere (line 106) | class Sphere:
class Capsule (line 115) | class Capsule:
class Cylinder (line 126) | class Cylinder:
class Plane (line 137) | class Plane:
class Ellipsoid (line 145) | class Ellipsoid:
function make_box (line 154) | def make_box(pose: transformf, params: vec4f, gid: int32, bid: int32) ->...
function make_sphere (line 165) | def make_sphere(pose: transformf, params: vec4f, gid: int32, bid: int32)...
function make_capsule (line 176) | def make_capsule(pose: transformf, params: vec4f, gid: int32, bid: int32...
function make_cylinder (line 191) | def make_cylinder(pose: transformf, params: vec4f, gid: int32, bid: int3...
function make_plane (line 206) | def make_plane(pose: transformf, params: vec4f, gid: int32, bid: int32) ...
function make_ellipsoid (line 218) | def make_ellipsoid(pose: transformf, params: vec4f, gid: int32, bid: int...
function add_single_contact (line 235) | def add_single_contact(
function make_add_multiple_contacts (line 322) | def make_add_multiple_contacts(MAX_CONTACTS: int, SHARED_NORMAL: bool):
function sphere_sphere (line 456) | def sphere_sphere(
function sphere_cylinder (line 516) | def sphere_cylinder(
function sphere_cone (line 583) | def sphere_cone():
function sphere_capsule (line 588) | def sphere_capsule(
function sphere_box (line 655) | def sphere_box(
function sphere_ellipsoid (line 715) | def sphere_ellipsoid():
function cylinder_cylinder (line 720) | def cylinder_cylinder():
function cylinder_cone (line 725) | def cylinder_cone():
function cylinder_capsule (line 730) | def cylinder_capsule():
function cylinder_box (line 735) | def cylinder_box():
function cylinder_ellipsoid (line 740) | def cylinder_ellipsoid():
function cone_cone (line 745) | def cone_cone():
function cone_capsule (line 750) | def cone_capsule():
function cone_box (line 755) | def cone_box():
function cone_ellipsoid (line 760) | def cone_ellipsoid():
function capsule_capsule (line 765) | def capsule_capsule(
function capsule_box (line 836) | def capsule_box(
function capsule_ellipsoid (line 904) | def capsule_ellipsoid():
function box_box (line 909) | def box_box(
function box_ellipsoid (line 971) | def box_ellipsoid():
function ellipsoid_ellipsoid (line 976) | def ellipsoid_ellipsoid():
function plane_sphere (line 981) | def plane_sphere(
function plane_box (line 1045) | def plane_box(
function plane_ellipsoid (line 1107) | def plane_ellipsoid(
function plane_capsule (line 1169) | def plane_capsule(
function plane_cylinder (line 1279) | def plane_cylinder(
function _primitive_narrowphase (line 1346) | def _primitive_narrowphase(
function primitive_narrowphase (line 1786) | def primitive_narrowphase(
FILE: newton/_src/solvers/kamino/_src/geometry/primitive/pipeline.py
class CollisionPipelinePrimitive (line 39) | class CollisionPipelinePrimitive:
method __init__ (line 47) | def __init__(
method device (line 94) | def device(self) -> wp.DeviceLike:
method finalize (line 102) | def finalize(
method collide (line 179) | def collide(self, data: DataKamino, state: StateKamino, contacts: Cont...
method _assert_finalized (line 218) | def _assert_finalized(self):
method _assert_shapes_supported (line 232) | def _assert_shapes_supported(model: ModelKamino, skip_checks: bool = F...
FILE: newton/_src/solvers/kamino/_src/geometry/unified.py
class ContactWriterDataKamino (line 55) | class ContactWriterDataKamino:
function convert_geom_params_to_newton_scale (line 101) | def convert_geom_params_to_newton_scale(geo_type: int32, params: vec4f) ...
function write_contact_unified_kamino (line 129) | def write_contact_unified_kamino(
function _compute_collision_radius (line 255) | def _compute_collision_radius(geo_type: int32, scale: vec3f) -> float32:
function _convert_geom_data_kamino_to_newton (line 279) | def _convert_geom_data_kamino_to_newton(
function _update_geom_poses_and_compute_aabbs (line 321) | def _update_geom_poses_and_compute_aabbs(
class CollisionPipelineUnifiedKamino (line 411) | class CollisionPipelineUnifiedKamino:
method __init__ (line 420) | def __init__(
method device (line 561) | def device(self) -> wp.DeviceLike:
method model (line 566) | def model(self) -> ModelKamino:
method collide (line 574) | def collide(self, data: DataKamino, state: StateKamino, contacts: Cont...
method _convert_geometry_data (line 621) | def _convert_geometry_data(self):
method _update_geom_data (line 649) | def _update_geom_data(self, data: DataKamino, state: StateKamino):
method _run_broadphase (line 681) | def _run_broadphase(self):
method _run_narrowphase (line 732) | def _run_narrowphase(self, data: DataKamino, contacts: ContactsKamino):
FILE: newton/_src/solvers/kamino/_src/integrators/euler.py
function euler_semi_implicit_with_logmap (line 60) | def euler_semi_implicit_with_logmap(
function _integrate_semi_implicit_euler_inplace (line 103) | def _integrate_semi_implicit_euler_inplace(
function integrate_euler_semi_implicit (line 161) | def integrate_euler_semi_implicit(model: ModelKamino, data: DataKamino, ...
class IntegratorEuler (line 187) | class IntegratorEuler(IntegratorBase):
method __init__ (line 209) | def __init__(self, model: ModelKamino, alpha: float | None = None):
method integrate (line 232) | def integrate(
FILE: newton/_src/solvers/kamino/_src/integrators/integrator.py
class IntegratorBase (line 41) | class IntegratorBase:
method __init__ (line 50) | def __init__(self, model: ModelKamino):
method integrate (line 64) | def integrate(
FILE: newton/_src/solvers/kamino/_src/integrators/moreau.py
function moreau_jean_semi_implicit_with_logmap (line 63) | def moreau_jean_semi_implicit_with_logmap(
function _integrate_moreau_jean_first_inplace (line 106) | def _integrate_moreau_jean_first_inplace(
function _integrate_moreau_jean_second_inplace (line 140) | def _integrate_moreau_jean_second_inplace(
class IntegratorMoreauJean (line 199) | class IntegratorMoreauJean(IntegratorBase):
method __init__ (line 239) | def __init__(self, model: ModelKamino, alpha: float | None = None):
method integrate (line 262) | def integrate(
method _integrate1 (line 328) | def _integrate1(self, model: ModelKamino, data: DataKamino):
method _integrate2 (line 354) | def _integrate2(self, model: ModelKamino, data: DataKamino):
FILE: newton/_src/solvers/kamino/_src/kinematics/constraints.py
function get_max_constraints_per_world (line 40) | def get_max_constraints_per_world(
function make_unilateral_constraints_info (line 82) | def make_unilateral_constraints_info(
function _update_constraints_info (line 262) | def _update_constraints_info(
function _unpack_joint_constraint_solutions (line 303) | def _unpack_joint_constraint_solutions(
function _unpack_limit_constraint_solutions (line 351) | def _unpack_limit_constraint_solutions(
function _unpack_contact_constraint_solutions (line 400) | def _unpack_contact_constraint_solutions(
function update_constraints_info (line 462) | def update_constraints_info(
function unpack_constraint_solutions (line 491) | def unpack_constraint_solutions(
FILE: newton/_src/solvers/kamino/_src/kinematics/jacobians.py
function make_store_joint_jacobian_dense_func (line 64) | def make_store_joint_jacobian_dense_func(axes: Any):
function make_store_joint_jacobian_sparse_func (line 126) | def make_store_joint_jacobian_sparse_func(axes: Any):
function store_joint_cts_jacobian_dense (line 170) | def store_joint_cts_jacobian_dense(
function store_joint_dofs_jacobian_dense (line 227) | def store_joint_dofs_jacobian_dense(
function store_joint_cts_jacobian_sparse (line 284) | def store_joint_cts_jacobian_sparse(
function store_joint_dofs_jacobian_sparse (line 338) | def store_joint_dofs_jacobian_sparse(
function _build_joint_jacobians_dense (line 397) | def _build_joint_jacobians_dense(
function _configure_jacobians_sparse (line 486) | def _configure_jacobians_sparse(
function _build_joint_jacobians_sparse (line 500) | def _build_joint_jacobians_sparse(
function _build_limit_jacobians_dense (line 588) | def _build_limit_jacobians_dense(
function _build_limit_jacobians_sparse (line 658) | def _build_limit_jacobians_sparse(
function _build_contact_jacobians_dense (line 732) | def _build_contact_jacobians_dense(
function _build_contact_jacobians_sparse (line 814) | def _build_contact_jacobians_sparse(
function store_col_major_jacobian_block (line 898) | def store_col_major_jacobian_block(
function _update_col_major_joint_jacobians (line 915) | def _update_col_major_joint_jacobians(
function _update_col_major_limit_jacobians (line 992) | def _update_col_major_limit_jacobians(
function _update_col_major_contact_jacobians (line 1074) | def _update_col_major_contact_jacobians(
class DenseSystemJacobiansData (line 1159) | class DenseSystemJacobiansData:
method __init__ (line 1164) | def __init__(self):
class DenseSystemJacobians (line 1203) | class DenseSystemJacobians:
method __init__ (line 1208) | def __init__(
method data (line 1247) | def data(self) -> DenseSystemJacobiansData:
method finalize (line 1253) | def finalize(
method build (line 1312) | def build(
class SparseSystemJacobians (line 1426) | class SparseSystemJacobians:
method __init__ (line 1431) | def __init__(
method finalize (line 1475) | def finalize(
method build (line 1677) | def build(
class ColMajorSparseConstraintJacobians (line 1816) | class ColMajorSparseConstraintJacobians(BlockSparseLinearOperators):
method __init__ (line 1830) | def __init__(
method finalize (line 1866) | def finalize(
method update (line 2023) | def update(
FILE: newton/_src/solvers/kamino/_src/kinematics/joints.py
function correct_rotational_coord (line 79) | def correct_rotational_coord(q_j_in: float32, q_j_ref: float32 = 0.0, q_...
function correct_quat_vector_coord (line 89) | def correct_quat_vector_coord(q_j_in: vec4f, q_j_ref: vec4f) -> vec4f:
function correct_joint_coord_free (line 103) | def correct_joint_coord_free(q_j_in: vec7f, q_j_ref: vec7f, q_j_limit: v...
function correct_joint_coord_revolute (line 110) | def correct_joint_coord_revolute(q_j_in: vec1f, q_j_ref: vec1f, q_j_limi...
function correct_joint_coord_prismatic (line 117) | def correct_joint_coord_prismatic(q_j_in: vec1f, q_j_ref: vec1f, q_j_lim...
function correct_joint_coord_cylindrical (line 123) | def correct_joint_coord_cylindrical(q_j_in: vec2f, q_j_ref: vec2f, q_j_l...
function correct_joint_coord_universal (line 130) | def correct_joint_coord_universal(q_j_in: vec2f, q_j_ref: vec2f, q_j_lim...
function correct_joint_coord_spherical (line 138) | def correct_joint_coord_spherical(q_j_in: vec4f, q_j_ref: vec4f, q_j_lim...
function correct_joint_coord_gimbal (line 144) | def correct_joint_coord_gimbal(q_j_in: vec3f, q_j_ref: vec3f, q_j_limit:...
function correct_joint_coord_cartesian (line 153) | def correct_joint_coord_cartesian(q_j_in: vec3f, q_j_ref: vec3f, q_j_lim...
function get_joint_coord_correction_function (line 158) | def get_joint_coord_correction_function(dof_type: JointDoFType):
function map_to_joint_coords_free (line 191) | def map_to_joint_coords_free(j_r_j: vec3f, j_q_j: quatf) -> vec7f:
function map_to_joint_coords_revolute (line 198) | def map_to_joint_coords_revolute(j_r_j: vec3f, j_q_j: quatf) -> vec1f:
function map_to_joint_coords_prismatic (line 206) | def map_to_joint_coords_prismatic(j_r_j: vec3f, j_q_j: quatf) -> vec1f:
function map_to_joint_coords_cylindrical (line 212) | def map_to_joint_coords_cylindrical(j_r_j: vec3f, j_q_j: quatf) -> vec2f:
function map_to_joint_coords_universal (line 219) | def map_to_joint_coords_universal(j_r_j: vec3f, j_q_j: quatf) -> vec2f:
function map_to_joint_coords_spherical (line 227) | def map_to_joint_coords_spherical(j_r_j: vec3f, j_q_j: quatf) -> vec4f:
function map_to_joint_coords_gimbal (line 233) | def map_to_joint_coords_gimbal(j_r_j: vec3f, j_q_j: quatf) -> vec3f:
function map_
Copy disabled (too large)
Download .json
Condensed preview — 730 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (18,267K chars).
[
{
"path": ".claude/skills/newton-api-design/SKILL.md",
"chars": 3815,
"preview": "---\nname: newton-api-design\ndescription: Use when designing, adding, or reviewing public API for the Newton physics engi"
},
{
"path": ".coderabbit.yml",
"chars": 971,
"preview": "# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json\nlanguage: \"en-US\"\nearly_access: false\n"
},
{
"path": ".gitattributes",
"chars": 58,
"preview": "*.jpg !text !filter !merge !diff\nCHANGELOG.md merge=union\n"
},
{
"path": ".github/ISSUE_TEMPLATE/1-bug-report.yml",
"chars": 1059,
"preview": "name: Bug Report\ndescription: Create a report to help us improve Newton.\ntitle: \"[BUG] \"\nlabels: [\"bug\"]\nbody:\n - type:"
},
{
"path": ".github/ISSUE_TEMPLATE/2-feature-request.yml",
"chars": 687,
"preview": "name: Feature Request\ndescription: Suggest an idea for Newton.\ntitle: \"[REQ] \"\nlabels: [\"feature request\"]\nbody:\n - typ"
},
{
"path": ".github/ISSUE_TEMPLATE/3-documentation.yml",
"chars": 635,
"preview": "name: Documentation\ndescription: Report an error or suggest improvements for the documentation.\ntitle: \"[DOCS] \"\nlabels:"
},
{
"path": ".github/ISSUE_TEMPLATE/config.yml",
"chars": 184,
"preview": "blank_issues_enabled: true\ncontact_links:\n - name: Question\n url: https://github.com/newton-physics/newton/discussio"
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 1029,
"preview": "## Description\n\n<!-- What does this PR change and why?\n Reference any issues closed by this PR with \"Closes #1234\". "
},
{
"path": ".github/codecov.yml",
"chars": 144,
"preview": "coverage:\n status:\n project: off\n patch: off\n\ncomment:\n layout: \"diff, flags, files\"\n\nfixes:\n - \"/var/snap/amaz"
},
{
"path": ".github/workflows/aws_gpu_benchmarks.yml",
"chars": 8589,
"preview": "name: GPU Benchmarks on AWS EC2 (Reusable)\n\n# This is a reusable workflow that uses machulav/ec2-github-runner to run GP"
},
{
"path": ".github/workflows/aws_gpu_tests.yml",
"chars": 9428,
"preview": "name: GPU Unit Tests on AWS EC2 (Reusable)\n\n# This is a reusable workflow that uses machulav/ec2-github-runner to run GP"
},
{
"path": ".github/workflows/ci.yml",
"chars": 5903,
"preview": "name: CI\npermissions:\n contents: read\nenv:\n PYTHONFAULTHANDLER: \"1\" # Dump tracebacks on fatal signals (SIGSEGV, SIGAB"
},
{
"path": ".github/workflows/docs-dev.yml",
"chars": 3189,
"preview": "name: Deploy dev documentation\n\non:\n push:\n branches:\n - main\n workflow_dispatch:\n\n# Ensure only one deploymen"
},
{
"path": ".github/workflows/docs-release.yml",
"chars": 5809,
"preview": "name: Deploy release documentation\n\non:\n push:\n tags:\n - 'v*'\n workflow_dispatch:\n inputs:\n version:\n "
},
{
"path": ".github/workflows/merge_queue_aws_gpu.yml",
"chars": 421,
"preview": "name: Merge Queue - AWS GPU\n\non:\n merge_group:\n\njobs:\n run-tests:\n name: Run GPU Tests\n if: github.repository =="
},
{
"path": ".github/workflows/minimum_deps_tests.yml",
"chars": 7582,
"preview": "name: Minimum Dependency Version Tests on AWS EC2 (Reusable)\n\n# Standalone workflow that tests Newton with the lowest co"
},
{
"path": ".github/workflows/mujoco_warp_tests.yml",
"chars": 7907,
"preview": "name: MuJoCo Warp Tests on AWS EC2 (Reusable)\n\n# Standalone workflow that tests Newton with the latest mujoco-warp from "
},
{
"path": ".github/workflows/pr.yml",
"chars": 2789,
"preview": "name: Pull Request\npermissions:\n contents: read\n\non:\n merge_group:\n pull_request:\n branches:\n - main\n - "
},
{
"path": ".github/workflows/pr_closed.yml",
"chars": 1478,
"preview": "name: Cancel workflows on PR close\n\non:\n pull_request_target:\n types: [closed]\n\njobs:\n cancel-pr-workflows:\n nam"
},
{
"path": ".github/workflows/pr_license_check.yml",
"chars": 1597,
"preview": "name: License Check\npermissions:\n contents: read\n pull-requests: read\n\non:\n merge_group:\n pull_request:\n branches"
},
{
"path": ".github/workflows/pr_target_aws_gpu_benchmarks.yml",
"chars": 5017,
"preview": "name: Pull Request - AWS GPU Benchmarks\n\non:\n pull_request_target:\n\nconcurrency:\n group: ${{ github.workflow }}-pr-${{"
},
{
"path": ".github/workflows/pr_target_aws_gpu_tests.yml",
"chars": 4929,
"preview": "name: Pull Request - AWS GPU Tests\n\non:\n pull_request_target:\n\nconcurrency:\n group: ${{ github.workflow }}-pr-${{ gith"
},
{
"path": ".github/workflows/push_aws_gpu.yml",
"chars": 575,
"preview": "name: Push - AWS GPU\n\n# This workflow triggers GPU tests for pushes to main/release branches.\n# It replaces the old push"
},
{
"path": ".github/workflows/release.yml",
"chars": 3028,
"preview": "name: Release\n\n# This workflow runs when a tag is pushed.\n# The publish-to-pypi job requires manual approval via the 'py"
},
{
"path": ".github/workflows/scheduled_nightly.yml",
"chars": 10272,
"preview": "name: Scheduled Nightly Tests\n\n# Orchestrator that dispatches all nightly test suites sequentially.\n# Each sub-workflow "
},
{
"path": ".github/workflows/warp_nightly_tests.yml",
"chars": 7584,
"preview": "name: Warp Nightly Build Tests on AWS EC2 (Reusable)\n\n# Standalone workflow that tests Newton with the latest nightly wa"
},
{
"path": ".gitignore",
"chars": 887,
"preview": "# Python-generated files\n__pycache__/\n*.py[oc]\nbuild/\ndist/\nwheels/\n*.egg-info\n\n# Virtual Environments \n.venv\n\n# Tool ca"
},
{
"path": ".licenserc-docs.yaml",
"chars": 734,
"preview": "header:\n license:\n spdx-id: CC-BY-4.0\n copyright-owner: The Newton Developers\n\n content: |\n SPDX-FileCopy"
},
{
"path": ".licenserc.yaml",
"chars": 687,
"preview": "header:\n license:\n spdx-id: Apache-2.0\n copyright-owner: The Newton Developers\n\n content: |\n # SPDX-FileC"
},
{
"path": ".pre-commit-config.yaml",
"chars": 1404,
"preview": "ci:\n autofix_commit_msg: |\n [pre-commit.ci] auto code formatting\n autofix_prs: false\n autoupdate_branch: \"\"\n auto"
},
{
"path": ".python-version",
"chars": 5,
"preview": "3.12\n"
},
{
"path": "AGENTS.md",
"chars": 3774,
"preview": "# Newton Development Guidelines\n\n- `newton/_src/` is internal. Examples and docs must not import from `newton._src`. Exp"
},
{
"path": "CHANGELOG.md",
"chars": 13461,
"preview": "# Changelog\n\n## [Unreleased]\n\n### Added\n\n- Add repeatable `--warp-config KEY=VALUE` CLI option for overriding `warp.conf"
},
{
"path": "CITATION.cff",
"chars": 330,
"preview": "cff-version: 1.2.0\nmessage: \"If you use Newton, please cite it using this metadata.\"\ntitle: \"Newton: GPU-accelerated phy"
},
{
"path": "CLAUDE.md",
"chars": 11,
"preview": "@AGENTS.md\n"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 148,
"preview": "By participating in this community, you agree to abide by the Linux Foundation [Code of Conduct](https://lfprojects.org/"
},
{
"path": "CONTRIBUTING.md",
"chars": 6467,
"preview": "# Overview\n\nNewton is a project of the Linux Foundation and aims to be governed in a transparent, accessible way for the"
},
{
"path": "LICENSE.md",
"chars": 10173,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "README.md",
"chars": 36551,
"preview": "[](https://opensource.org/licenses/Apache-2.0)\n in the newt"
},
{
"path": "asv/benchmarks/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "asv/benchmarks/benchmark_ik.py",
"chars": 4198,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2026 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n##############"
},
{
"path": "asv/benchmarks/benchmark_mujoco.py",
"chars": 24179,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n##############"
},
{
"path": "asv/benchmarks/compilation/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "asv/benchmarks/compilation/bench_example_load.py",
"chars": 4687,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport subproc"
},
{
"path": "asv/benchmarks/setup/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "asv/benchmarks/setup/bench_model.py",
"chars": 6220,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport gc\nimpo"
},
{
"path": "asv/benchmarks/simulation/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "asv/benchmarks/simulation/bench_anymal.py",
"chars": 1576,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "asv/benchmarks/simulation/bench_cable.py",
"chars": 1612,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2026 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "asv/benchmarks/simulation/bench_cloth.py",
"chars": 2238,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "asv/benchmarks/simulation/bench_contacts.py",
"chars": 5559,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2026 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "asv/benchmarks/simulation/bench_heightfield.py",
"chars": 3603,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2026 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "asv/benchmarks/simulation/bench_ik.py",
"chars": 3577,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2026 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "asv/benchmarks/simulation/bench_mujoco.py",
"chars": 9176,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport os\nimpo"
},
{
"path": "asv/benchmarks/simulation/bench_quadruped_xpbd.py",
"chars": 1731,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "asv/benchmarks/simulation/bench_selection.py",
"chars": 1800,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "asv/benchmarks/simulation/bench_sensor_tiled_camera.py",
"chars": 8761,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "asv/benchmarks/simulation/bench_viewer.py",
"chars": 3228,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport os\nimpo"
},
{
"path": "asv.conf.json",
"chars": 946,
"preview": "{\n \"version\": 1,\n \"project\": \"newton\",\n \"project_url\": \"https://github.com/newton-physics/newton\",\n \"repo\": \".\",\n \""
},
{
"path": "docs/Makefile",
"chars": 642,
"preview": "# Minimal makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line, and also\n# from the "
},
{
"path": "docs/_ext/autodoc_filter.py",
"chars": 3429,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "docs/_ext/autodoc_wpfunc.py",
"chars": 3683,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Sphinx exte"
},
{
"path": "docs/_static/custom.css",
"chars": 796,
"preview": "/* Reduce spacing between class members */\n.py-attribute, .py-method, .py-property, .py-class {\n margin-top: 0.5em !i"
},
{
"path": "docs/_static/gh-pages-404.html",
"chars": 823,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <title>Page Not Found - Newton Documentation</title>\n <script>"
},
{
"path": "docs/_static/switcher.json",
"chars": 114,
"preview": "[\n {\n \"name\": \"dev\",\n \"version\": \"dev\",\n \"url\": \"https://newton-physics.github.io/newton/latest/\"\n }\n]\n"
},
{
"path": "docs/_templates/autosummary/class.rst",
"chars": 148,
"preview": "{{ fullname | escape | underline }}\n\n.. autoclass:: {{ fullname }}\n :members:\n :undoc-members:\n :show-inheritance:"
},
{
"path": "docs/_templates/class.rst",
"chars": 592,
"preview": "{{ fullname | escape | underline}}\n\n.. currentmodule:: {{ module }}\n\n.. autoclass:: {{ objname }}\n :members:\n :inher"
},
{
"path": "docs/_templates/genindex.html",
"chars": 1861,
"preview": "{#\n basic/genindex.html\n ~~~~~~~~~~~~~~~~~~~\n\n Template for an \"all indices\" page.\n\n :copyright: Copyright 2"
},
{
"path": "docs/_templates/py-modindex.html",
"chars": 1445,
"preview": "{#\n basic/modindex.html\n ~~~~~~~~~~~~~~~~~~~\n\n Template for the module index.\n\n :copyright: Copyright 2007-2"
},
{
"path": "docs/_templates/search.html",
"chars": 990,
"preview": "{#\n basic/search.html\n ~~~~~~~~~~~~~~~~\n\n Template for the search page.\n\n :copyright: Copyright 2007-2023 by"
},
{
"path": "docs/_templates/sidebar-nav-bs.html",
"chars": 640,
"preview": "{# Displays the TOC-subtree for pages nested under the currently active top-level TOCtree element. #}\n<nav class=\"bd-doc"
},
{
"path": "docs/api/newton.rst",
"chars": 1366,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nnewton\n======"
},
{
"path": "docs/api/newton_geometry.rst",
"chars": 949,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nnewton.geomet"
},
{
"path": "docs/api/newton_ik.rst",
"chars": 525,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nnewton.ik\n==="
},
{
"path": "docs/api/newton_math.rst",
"chars": 651,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nnewton.math\n="
},
{
"path": "docs/api/newton_selection.rst",
"chars": 312,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nnewton.select"
},
{
"path": "docs/api/newton_sensors.rst",
"chars": 376,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nnewton.sensor"
},
{
"path": "docs/api/newton_solvers.rst",
"chars": 10183,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nnewton.solver"
},
{
"path": "docs/api/newton_solvers_style3d.rst",
"chars": 513,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nnewton.solver"
},
{
"path": "docs/api/newton_usd.rst",
"chars": 976,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nnewton.usd\n=="
},
{
"path": "docs/api/newton_utils.rst",
"chars": 779,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nnewton.utils\n"
},
{
"path": "docs/api/newton_viewer.rst",
"chars": 377,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nnewton.viewer"
},
{
"path": "docs/concepts/articulations.rst",
"chars": 30117,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\n.. currentmod"
},
{
"path": "docs/concepts/collisions.rst",
"chars": 65177,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\n.. currentmod"
},
{
"path": "docs/concepts/conventions.rst",
"chars": 23731,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\n\nConventions\n"
},
{
"path": "docs/concepts/custom_attributes.rst",
"chars": 33668,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\n.. currentmod"
},
{
"path": "docs/concepts/extended_attributes.rst",
"chars": 4111,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\n.. currentmod"
},
{
"path": "docs/concepts/mass_inertia.rst",
"chars": 9763,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2026 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\n.. _Mass and "
},
{
"path": "docs/concepts/sensors.rst",
"chars": 5604,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nSensors\n====="
},
{
"path": "docs/concepts/sites.rst",
"chars": 7559,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nSites (Abstra"
},
{
"path": "docs/concepts/usd_parsing.rst",
"chars": 24564,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\n.. _usd_parsi"
},
{
"path": "docs/concepts/worlds.rst",
"chars": 15784,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\n.. _Worlds:\n\n"
},
{
"path": "docs/conf.py",
"chars": 15568,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n# Configuratio"
},
{
"path": "docs/faq.rst",
"chars": 5990,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nFrequently As"
},
{
"path": "docs/generate_api.py",
"chars": 10093,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Generate co"
},
{
"path": "docs/guide/development.rst",
"chars": 28931,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nDevelopment\n="
},
{
"path": "docs/guide/installation.rst",
"chars": 9781,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\n.. currentmod"
},
{
"path": "docs/guide/overview.rst",
"chars": 5154,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nNewton Physic"
},
{
"path": "docs/guide/release.rst",
"chars": 8403,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2026 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nRelease Proce"
},
{
"path": "docs/guide/tutorials.rst",
"chars": 382,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nTutorials\n==="
},
{
"path": "docs/guide/visualization.rst",
"chars": 19974,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\n.. currentmod"
},
{
"path": "docs/images/examples/resize.bat",
"chars": 424,
"preview": "@echo off\nREM resize all PNGs to half size, crop to square, and convert to JPG\nfor %%f in (*.png) do (\n echo Processi"
},
{
"path": "docs/images/examples/resize.sh",
"chars": 227,
"preview": "# resize all pngs in a directory by 2x in dimension, crop to square, + convert to jpg\nfor f in *.png; do ffmpeg -y -i \"$"
},
{
"path": "docs/index.rst",
"chars": 1413,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\n.. raw:: html"
},
{
"path": "docs/integrations/index.rst",
"chars": 205,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nNewton Integr"
},
{
"path": "docs/integrations/isaac-lab.rst",
"chars": 347,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\nIsaac Lab Int"
},
{
"path": "docs/integrations/mujoco.rst",
"chars": 13193,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\n.. currentmod"
},
{
"path": "docs/make.bat",
"chars": 800,
"preview": "@ECHO OFF\r\n\r\npushd %~dp0\r\n\r\nREM Command file for Sphinx documentation\r\n\r\nif \"%SPHINXBUILD%\" == \"\" (\r\n\tset SPHINXBUILD=sp"
},
{
"path": "docs/migration.rst",
"chars": 18478,
"preview": ".. SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n.. SPDX-License-Identifier: CC-BY-4.0\n\n.. currentmod"
},
{
"path": "docs/print_api.py",
"chars": 1539,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport importl"
},
{
"path": "docs/serve.py",
"chars": 4092,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"\nSimple HTT"
},
{
"path": "docs/tutorials/00_introduction.ipynb",
"chars": 15941,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"raw\",\n \"metadata\": {\n \"nbsphinx\": \"hidden\",\n \"vscode\": {\n \"languageId\": \""
},
{
"path": "newton/__init__.py",
"chars": 2047,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n# ============"
},
{
"path": "newton/_src/core/__init__.py",
"chars": 293,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom ..math im"
},
{
"path": "newton/_src/core/types.py",
"chars": 6426,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Common defi"
},
{
"path": "newton/_src/geometry/__init__.py",
"chars": 1790,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom .broad_ph"
},
{
"path": "newton/_src/geometry/broad_phase_common.py",
"chars": 10901,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Common util"
},
{
"path": "newton/_src/geometry/broad_phase_nxn.py",
"chars": 18761,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"NxN (all-pa"
},
{
"path": "newton/_src/geometry/broad_phase_sap.py",
"chars": 26910,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Sweep and P"
},
{
"path": "newton/_src/geometry/collision_convex.py",
"chars": 7455,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"\nHigh-level"
},
{
"path": "newton/_src/geometry/collision_core.py",
"chars": 45353,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "newton/_src/geometry/collision_primitive.py",
"chars": 52494,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n##############"
},
{
"path": "newton/_src/geometry/contact_data.py",
"chars": 3351,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"\nContact da"
},
{
"path": "newton/_src/geometry/contact_reduction.py",
"chars": 15652,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Contact red"
},
{
"path": "newton/_src/geometry/contact_reduction_global.py",
"chars": 51220,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Global GPU "
},
{
"path": "newton/_src/geometry/contact_reduction_hydroelastic.py",
"chars": 53191,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Hydroelasti"
},
{
"path": "newton/_src/geometry/differentiable_contacts.py",
"chars": 4447,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2026 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Post-proces"
},
{
"path": "newton/_src/geometry/flags.py",
"chars": 888,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom enum impo"
},
{
"path": "newton/_src/geometry/hashtable.py",
"chars": 8763,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"GPU-friendl"
},
{
"path": "newton/_src/geometry/inertia.py",
"chars": 35294,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Helper func"
},
{
"path": "newton/_src/geometry/kernels.py",
"chars": 54262,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "newton/_src/geometry/mpr.py",
"chars": 16982,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n# This code is"
},
{
"path": "newton/_src/geometry/multicontact.py",
"chars": 35974,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n# This code is"
},
{
"path": "newton/_src/geometry/narrow_phase.py",
"chars": 98754,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "newton/_src/geometry/raycast.py",
"chars": 29589,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n# Some ray int"
},
{
"path": "newton/_src/geometry/remesh.py",
"chars": 76612,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Point cloud"
},
{
"path": "newton/_src/geometry/sdf_contact.py",
"chars": 51918,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom typing im"
},
{
"path": "newton/_src/geometry/sdf_hydroelastic.py",
"chars": 73887,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"SDF-based h"
},
{
"path": "newton/_src/geometry/sdf_mc.py",
"chars": 6952,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Marching Cu"
},
{
"path": "newton/_src/geometry/sdf_texture.py",
"chars": 76548,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2026 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Texture-bas"
},
{
"path": "newton/_src/geometry/sdf_utils.py",
"chars": 61653,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport logging"
},
{
"path": "newton/_src/geometry/simplex_solver.py",
"chars": 19846,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n# This code is"
},
{
"path": "newton/_src/geometry/support_function.py",
"chars": 13210,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"\nSupport ma"
},
{
"path": "newton/_src/geometry/terrain_generator.py",
"chars": 25856,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Compact pro"
},
{
"path": "newton/_src/geometry/types.py",
"chars": 74917,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport enum\nim"
},
{
"path": "newton/_src/geometry/utils.py",
"chars": 30175,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport context"
},
{
"path": "newton/_src/math/__init__.py",
"chars": 8455,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom typing im"
},
{
"path": "newton/_src/math/spatial.py",
"chars": 8090,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "newton/_src/sensors/__init__.py",
"chars": 105,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n"
},
{
"path": "newton/_src/sensors/sensor_contact.py",
"chars": 31024,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "newton/_src/sensors/sensor_frame_transform.py",
"chars": 9934,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Frame Trans"
},
{
"path": "newton/_src/sensors/sensor_imu.py",
"chars": 7028,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"IMU Sensor "
},
{
"path": "newton/_src/sensors/sensor_raycast.py",
"chars": 17125,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport math\nim"
},
{
"path": "newton/_src/sensors/sensor_tiled_camera.py",
"chars": 22255,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "newton/_src/sensors/warp_raytrace/__init__.py",
"chars": 478,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom .render_c"
},
{
"path": "newton/_src/sensors/warp_raytrace/bvh.py",
"chars": 8271,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "newton/_src/sensors/warp_raytrace/gaussians.py",
"chars": 6626,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "newton/_src/sensors/warp_raytrace/lighting.py",
"chars": 3921,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "newton/_src/sensors/warp_raytrace/ray_intersect.py",
"chars": 13910,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "newton/_src/sensors/warp_raytrace/raytrace.py",
"chars": 31105,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "newton/_src/sensors/warp_raytrace/render.py",
"chars": 9678,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "newton/_src/sensors/warp_raytrace/render_context.py",
"chars": 32351,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "newton/_src/sensors/warp_raytrace/textures.py",
"chars": 2446,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "newton/_src/sensors/warp_raytrace/tiling.py",
"chars": 2384,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "newton/_src/sensors/warp_raytrace/types.py",
"chars": 3275,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport enum\nfr"
},
{
"path": "newton/_src/sensors/warp_raytrace/utils.py",
"chars": 22027,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "newton/_src/sim/__init__.py",
"chars": 714,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom .articula"
},
{
"path": "newton/_src/sim/articulation.py",
"chars": 44423,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "newton/_src/sim/builder.py",
"chars": 508263,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"A module fo"
},
{
"path": "newton/_src/sim/collide.py",
"chars": 41554,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "newton/_src/sim/contacts.py",
"chars": 14676,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "newton/_src/sim/control.py",
"chars": 4071,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "newton/_src/sim/enums.py",
"chars": 7294,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom enum impo"
},
{
"path": "newton/_src/sim/graph_coloring.py",
"chars": 20862,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warning"
},
{
"path": "newton/_src/sim/ik/__init__.py",
"chars": 669,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Inverse-kin"
},
{
"path": "newton/_src/sim/ik/ik_common.py",
"chars": 3670,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Common enum"
},
{
"path": "newton/_src/sim/ik/ik_lbfgs_optimizer.py",
"chars": 59456,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"L-BFGS opti"
},
{
"path": "newton/_src/sim/ik/ik_lm_optimizer.py",
"chars": 34054,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Levenberg-M"
},
{
"path": "newton/_src/sim/ik/ik_objectives.py",
"chars": 39611,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Objective d"
},
{
"path": "newton/_src/sim/ik/ik_solver.py",
"chars": 16943,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Frontend wr"
},
{
"path": "newton/_src/sim/model.py",
"chars": 66438,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Implementat"
},
{
"path": "newton/_src/sim/state.py",
"chars": 8757,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "newton/_src/solvers/__init__.py",
"chars": 712,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom .feathers"
},
{
"path": "newton/_src/solvers/featherstone/__init__.py",
"chars": 199,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom .solver_f"
},
{
"path": "newton/_src/solvers/featherstone/kernels.py",
"chars": 53519,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom __future_"
},
{
"path": "newton/_src/solvers/featherstone/solver_featherstone.py",
"chars": 33899,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport numpy a"
},
{
"path": "newton/_src/solvers/flags.py",
"chars": 2461,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Solver flag"
},
{
"path": "newton/_src/solvers/implicit_mpm/__init__.py",
"chars": 190,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom .solver_i"
},
{
"path": "newton/_src/solvers/implicit_mpm/contact_solver_kernels.py",
"chars": 7806,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2026 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "newton/_src/solvers/implicit_mpm/implicit_mpm_model.py",
"chars": 23954,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Implicit MP"
},
{
"path": "newton/_src/solvers/implicit_mpm/implicit_mpm_solver_kernels.py",
"chars": 30326,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2026 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom typing im"
},
{
"path": "newton/_src/solvers/implicit_mpm/rasterized_collisions.py",
"chars": 24316,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "newton/_src/solvers/implicit_mpm/render_grains.py",
"chars": 5936,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport warp as"
},
{
"path": "newton/_src/solvers/implicit_mpm/rheology_solver_kernels.py",
"chars": 34610,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2026 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nfrom typing im"
},
{
"path": "newton/_src/solvers/implicit_mpm/solve_rheology.py",
"chars": 39470,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\nimport gc\nimpo"
},
{
"path": "newton/_src/solvers/implicit_mpm/solver_implicit_mpm.py",
"chars": 101783,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Implicit MP"
},
{
"path": "newton/_src/solvers/kamino/README.md",
"chars": 5879,
"preview": "# Kamino\n\n<div style=\"background-color:#fff3cd; border:1px solid #ffecb5; padding:0.75em 1em; border-radius:6px;\">\n<stro"
},
{
"path": "newton/_src/solvers/kamino/__init__.py",
"chars": 376,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"\nKamino: A "
},
{
"path": "newton/_src/solvers/kamino/_src/__init__.py",
"chars": 1236,
"preview": "# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"\nKamino: A "
}
]
// ... and 530 more files (download for full content)
About this extraction
This page contains the full source code of the newton-physics/newton GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 730 files (16.8 MB), approximately 4.5M tokens, and a symbol index with 14598 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.